Blob Blame History Raw
Caution: Checking __WORDSIZE == 64 is not enough.

 On x86_64, << printf("%7" PRIu64, (__u64)1); >> lets gcc throw a warning.
 __u64 seems to be a long int; uint64_t a long long int; PRIu64 "llu".
 So __u64 is not compatible with PRIu64, even though it is a 64bit value.

diff -ru e2tools-0.0.16-orig/ls.c e2tools-0.0.16-lld/ls.c
--- e2tools-0.0.16-orig/ls.c	2007-12-08 23:57:40.000000000 +0100
+++ e2tools-0.0.16-lld/ls.c	2007-12-09 03:10:24.000000000 +0100
@@ -44,6 +44,8 @@
 #include "e2tools.h"
 #include "elist.h"
 #include <regex.h>
+#include <stdint.h>
+#include <inttypes.h>
 
 /*
  * list directory
@@ -657,8 +659,8 @@
   if (LINUX_S_ISDIR(info->inode.i_mode))
     printf("%7d", info->inode.i_size);
   else
-    printf("%7lld", info->inode.i_size |
-           ((__u64)info->inode.i_size_high << 32));
+    printf("%7" PRIu64, (uint64_t)(info->inode.i_size |
+				  ((__u64)info->inode.i_size_high << 32)));
   printf(" %s %s\n", datestr, info->name);
 
 } /* end of long_disp */