modeprint.c: use PRIu64 for printing uint64_t
PATCH 1/1 modeprint.c: use PRIu64 for printing uint64_t
Signed-off-by Matt Turner <[email protected]>
--- tests/modeprint/modeprint.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
tests/modeprint/modeprint.c +4 -3
@@ -36,6 +36,7 @@#include <stdint.h> #include <unistd.h> #include <string.h> +#include <inttypes.h> #include "xf86drm.h" #include "xf86drmMode.h"
@@ -101,7 +102,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_tif (props->count_values) {printf ("\tvalues :" );for (j =0 ; j < props->count_values; j++) -printf (" %llu" , props->values[j]); +printf (" %" PRIu64, props->values[j]);printf ("\n" ); }
@@ -116,7 +117,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_tprintf ("blob is %d length, %08X\n" , blob->length, *(uint32_t *)blob->data);drmModeFreePropertyBlob (blob); }else { -printf ("error getting blob %llu\n" , value); +printf ("error getting blob %" PRIu64"\n" , value); } }else {
@@ -132,7 +133,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_tif (props->count_enums && name) {printf ("\tcon_value : %s\n" , name); }else { -printf ("\tcon_value : %lld\n" , value); +printf ("\tcon_value : %" PRIu64"\n" , value); } }
Signature · 1 line
1.7.3.4
Quoted 45 lines · Matt Turner
Signed-off-by Matt Turner <[email protected]>---
tests/modeprint/modeprint.c | 7 ++++---1 files changed, 4 insertions(+), 3 deletions(-)tests/modeprint/modeprint.c +4
-4@@ -36,6 +36,7 @@ #include <stdint.h> #include <unistd.h> #include <string.h> +#include <inttypes.h> #include "xf86drm.h" #include "xf86drmMode.h"@@ -101,7 +102,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t if (props->count_values) { printf("\tvalues :"); for (j = 0; j < props->count_values; j++) - printf(" %llu", props->values[j]); + printf(" %" PRIu64, props->values[j]); printf("\n"); }@@ -116,7 +117,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t printf("blob is %d length, %08X\n", blob->length, *(uint32_t *)blob->data); drmModeFreePropertyBlob(blob); } else { - printf("error getting blob %llu\n", value); + printf("error getting blob %" PRIu64 "\n", value); } } else {@@ -132,7 +133,7 @@ int printProperty(int fd, drmModeResPtr res, drmModePropertyPtr props, uint64_t if (props->count_enums && name) { printf("\tcon_value : %s\n", name); } else { - printf("\tcon_value : %lld\n", value); + printf("\tcon_value : %" PRIu64 "\n", value); } } --
Quoted 1 line
1.7.3.4
This patch still applies, and still fixes warnings. Please commit.
Matt