aboutsummaryrefslogtreecommitdiff
path: root/coreutils/factor.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/factor.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/factor.c')
-rw-r--r--coreutils/factor.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/coreutils/factor.c b/coreutils/factor.c
index 205cdc053..8782d3d1e 100644
--- a/coreutils/factor.c
+++ b/coreutils/factor.c
@@ -161,7 +161,7 @@ static NOINLINE void factorize(wide_t N)
161 } 161 }
162 end: 162 end:
163 if (N > 1) 163 if (N > 1)
164 printf(" %llu", N); 164 printf(" %"LL_FMT"u", N);
165 bb_putchar('\n'); 165 bb_putchar('\n');
166} 166}
167 167
@@ -175,7 +175,7 @@ static void factorize_numstr(const char *numstr)
175 N = bb_strtoull(numstr, NULL, 10); 175 N = bb_strtoull(numstr, NULL, 10);
176 if (errno) 176 if (errno)
177 bb_show_usage(); 177 bb_show_usage();
178 printf("%llu:", N); 178 printf("%"LL_FMT"u:", N);
179 factorize(N); 179 factorize(N);
180} 180}
181 181