1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

With printf(), use PRIu64 with a cast to uint64_t instead

of %zu, because some pre-C99 libc versions don't support %zu.
This commit is contained in:
Lasse Collin 2008-01-06 19:45:27 +02:00
parent 4e7e54c4c5
commit c15a7abf66
2 changed files with 11 additions and 8 deletions

View file

@ -140,13 +140,14 @@ These aren't implemented yet.
if (mem_limit == 0) if (mem_limit == 0)
mem_limit = 1; mem_limit = 1;
// We use PRIu64 instead of %zu to support pre-C99 libc.
puts(_("On this system and configuration, the tool will use")); puts(_("On this system and configuration, the tool will use"));
printf(_(" * roughly %zu MiB of memory at maximum; and\n"), printf(_(" * roughly %" PRIu64 " MiB of memory at maximum; and\n"),
mem_limit); (uint64_t)(mem_limit));
printf(N_( printf(N_(" * at maximum of one thread for (de)compression.\n\n",
" * at maximum of one thread for (de)compression.\n\n", " * at maximum of %" PRIu64
" * at maximum of %zu threads for (de)compression.\n\n", " threads for (de)compression.\n\n",
opt_threads), opt_threads); (uint64_t)(opt_threads)), (uint64_t)(opt_threads));
printf(_("Report bugs to <%s> (in English or Finnish).\n"), printf(_("Report bugs to <%s> (in English or Finnish).\n"),
PACKAGE_BUGREPORT); PACKAGE_BUGREPORT);

View file

@ -108,10 +108,12 @@ help(void)
"\n" "\n"
"With no FILE, or when FILE is -, read standard input.\n" "With no FILE, or when FILE is -, read standard input.\n"
"\n" "\n"
"On this configuration, the tool will use about %zu MiB of memory at maximum.\n" "On this configuration, the tool will use about %" PRIu64
" MiB of memory at maximum.\n"
"\n" "\n"
"Report bugs to <" PACKAGE_BUGREPORT "> (in English or Finnish).\n", "Report bugs to <" PACKAGE_BUGREPORT "> (in English or Finnish).\n",
argv0, (mem_limit + 512 * 1024) / (1024 * 1024)); argv0, (uint64_t)((mem_limit + 512 * 1024) / (1024 * 1024)));
// Using PRIu64 above instead of %zu to support pre-C99 libc.
exit(0); exit(0);
} }