Skip to contentSkip to conversation

Use PRIu64 for printing uint64_t

PATCH In review Ian Jackson 2 participants 2 messages May 6, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use PRIu64 for printing uint64_t

Properly use PRIu64 to print a uint64_t. Un-breaks the build on modern compilers.

tools/libxl/xl_cmdimpl.c +2 -2
index 46da813..8ee421a 100644
@@ -2799,8 +2799,8 @@ static void output_physinfo(void)
     vinfo = libxl_get_version_info(&ctx);
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
-        printf("total_memory           : %lu\n", info.total_pages / i);
-        printf("free_memory            : %lu\n", info.free_pages / i);
+        printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
+        printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
     }
 
     return;
#1 lore raw

dup :)

Quoted 26 lines · Ian Jackson

Properly use PRIu64 to print a uint64_t. Un-breaks the build on modern compilers.

tools/libxl/xl_cmdimpl.c +2 -2
index 46da813..8ee421a 100644
@@ -2799,8 +2799,8 @@ static void output_physinfo(void)
     vinfo = libxl_get_version_info(&ctx);
     if (vinfo) {
         i = (1 << 20) / vinfo->pagesize;
-        printf("total_memory           : %lu\n", info.total_pages / i);
-        printf("free_memory            : %lu\n", info.free_pages / i);
+        printf("total_memory           : %"PRIu64"\n", info.total_pages / i);
+        printf("free_memory            : %"PRIu64"\n", info.free_pages / i);
     }
 
     return;

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel