From a788dc640fe1184dfe4c5c3dc9de8ecf34375556 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Thu, 9 Mar 2017 14:10:29 +0000 Subject: [PATCH 14/26] icotool/extract.c: Use correct printf format for uint32_t. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit "%d" is for printing ints only. To print other types, use the macros defined in the portable header. For uint32_t the correct way is "%"PRIu32. Warnings were all of the form shown below: extract.c:356:16: error: format ‘%d’ expects argument of type ‘int’, but argument 7 has type ‘uint32_t {aka unsigned int}’ [-Werror=format=] printf(_("--%s --index=%d --width=%d --height=%d --bit-depth=%d --palette-size=%d"), ^ Signed-off-by: Richard W.M. Jones --- icotool/extract.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/icotool/extract.c b/icotool/extract.c index ad83864..cb8b5dc 100644 --- a/icotool/extract.c +++ b/icotool/extract.c @@ -21,6 +21,7 @@ #include /* POSIX/Gnulib */ #include /* C89 */ #include /* C89 */ +#include #if HAVE_PNG_H # include #else @@ -183,7 +184,7 @@ extract_icons(FILE *in, char *inname, bool listmode, ExtractNameGen outfile_gen, matched++; if (listmode) { - printf(_("--%s --index=%d --width=%d --height=%d --bit-depth=%d --palette-size=%d"), + printf(_("--%s --index=%d --width=%d --height=%d --bit-depth=%" PRIu32 " --palette-size=%" PRIu32), (dir.type == 1 ? "icon" : "cursor"), completed, width, height, bit_count, palette_count); if (dir.type == 2) @@ -352,7 +353,7 @@ extract_icons(FILE *in, char *inname, bool listmode, ExtractNameGen outfile_gen, } if (listmode) { - printf(_("--%s --index=%d --width=%d --height=%d --bit-depth=%d --palette-size=%d"), + printf(_("--%s --index=%d --width=%d --height=%d --bit-depth=%" PRIu32 " --palette-size=%" PRIu32), (dir.type == 1 ? "icon" : "cursor"), completed, width, height, bitmap.bit_count, palette_count); if (dir.type == 2) -- 2.10.2