aboutsummaryrefslogtreecommitdiff
path: root/coreutils/sum.c
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2017-02-01 22:29:58 +0100
committerRon Yorston <rmy@pobox.com>2017-07-18 09:51:30 +0100
commit18afed0f98d020608c65293ecb9246dab6c58db3 (patch)
tree376aa1289f3f0e934e8381507c337d68e1e4b89a /coreutils/sum.c
parentd416bdac2fff5eed7cfa70499ff61c8b8a9ca7ce (diff)
downloadbusybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.tar.gz
busybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.tar.bz2
busybox-w32-18afed0f98d020608c65293ecb9246dab6c58db3.zip
Use %I64* formats with MinGW instead of %ll* formats
The MSVC runtime uses the format specified %I64 for 64-bit data types; It does not understand e.g. %llu for unsigned long longs. However, mingw-w64 provides a compatibility mode in its runtime wrapper which can be activated by defining the constant __USE_MINGW_ANSI_STDIO=1 in which case we must refrain from overriding the %ll* formats. This fixes quite a couple of compile warnings when building with the mingw-w64 compiler. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Diffstat (limited to 'coreutils/sum.c')
-rw-r--r--coreutils/sum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/sum.c b/coreutils/sum.c
index c55293dc9..2a91f963c 100644
--- a/coreutils/sum.c
+++ b/coreutils/sum.c
@@ -82,9 +82,9 @@ static unsigned sum_file(const char *file, unsigned type)
82 if (type >= SUM_SYSV) { 82 if (type >= SUM_SYSV) {
83 r = (s & 0xffff) + ((s & 0xffffffff) >> 16); 83 r = (s & 0xffff) + ((s & 0xffffffff) >> 16);
84 s = (r & 0xffff) + (r >> 16); 84 s = (r & 0xffff) + (r >> 16);
85 printf("%u %llu %s\n", s, (total_bytes + 511) / 512, file); 85 printf("%u %"LL_FMT"u %s\n", s, (total_bytes + 511) / 512, file);
86 } else 86 } else
87 printf("%05u %5llu %s\n", s, (total_bytes + 1023) / 1024, file); 87 printf("%05u %5"OFF_FMT"u %s\n", s, (total_bytes + 1023) / 1024, file);
88 return 1; 88 return 1;
89#undef buf 89#undef buf
90} 90}