From 78e54426c046f5f55526ca9d51a129f2b7e28bc3 Mon Sep 17 00:00:00 2001 From: Thomas Miletich Date: Sat, 17 Oct 2009 16:52:30 +0200 Subject: [zbin] Fix compilation warnings for util/zbin.c Recent gcc versions generate warnings when compiling util/zbin.c ( tested with gcc-4.3.3 ): util/zbin.c: In function ‘process_zinfo_pack’: util/zbin.c:200: warning: format ‘%#zx’ expects type ‘size_t’, but argument 6 has type ‘long unsigned int’ util/zbin.c: In function ‘process_zinfo_add’: util/zbin.c:257: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 4 has type ‘int’ util/zbin.c:266: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 4 has type ‘int’ util/zbin.c:266: warning: format ‘%d’ expects type ‘int’, but argument 8 has type ‘long unsigned int’ util/zbin.c:286: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 6 has type ‘int’ util/zbin.c:286: warning: format ‘%#lx’ expects type ‘long unsigned int’, but argument 7 has type ‘size_t’ This patch eliminates these warnings. Tested with gcc-4.3.3 on Ubuntu 9.04 and gcc-4.1.2 on Debian Etch. Signed-off-by: Marty Connor --- src/util/zbin.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/zbin.c b/src/util/zbin.c index 2adc35c9..96e2891b 100644 --- a/src/util/zbin.c +++ b/src/util/zbin.c @@ -197,7 +197,7 @@ static int process_zinfo_pack ( struct input_file *input, if ( DEBUG ) { fprintf ( stderr, "PACK [%#zx,%#zx) to [%#zx,%#zx)\n", offset, ( offset + len ), output->len, - ( output->len + packed_len ) ); + ( size_t )( output->len + packed_len ) ); } output->len += packed_len; @@ -252,18 +252,18 @@ static int process_zinfo_add ( struct input_file *input, ( ( 1UL << ( 8 * datasize ) ) - 1 ) : ~0UL ); if ( val < 0 ) { - fprintf ( stderr, "Add %s%#lx+%#lx at %#zx %sflows field\n", + fprintf ( stderr, "Add %s%#x+%#lx at %#zx %sflows field\n", ( ( addend < 0 ) ? "-" : "" ), abs ( addend ), size, offset, ( ( addend < 0 ) ? "under" : "over" ) ); return -1; } if ( val & ~mask ) { - fprintf ( stderr, "Add %s%#lx+%#lx at %#zx overflows %d-byte " + fprintf ( stderr, "Add %s%#x+%#lx at %#zx overflows %d-byte " "field (%d bytes too big)\n", ( ( addend < 0 ) ? "-" : "" ), abs ( addend ), size, offset, datasize, - ( ( val - mask - 1 ) * add->divisor ) ); + ( int )( ( val - mask - 1 ) * add->divisor ) ); return -1; } @@ -280,7 +280,7 @@ static int process_zinfo_add ( struct input_file *input, } if ( DEBUG ) { - fprintf ( stderr, "ADDx [%#zx,%#zx) (%s%#lx+(%#lx/%#x)) = " + fprintf ( stderr, "ADDx [%#zx,%#zx) (%s%#x+(%#x/%#x)) = " "%#lx\n", offset, ( offset + datasize ), ( ( addend < 0 ) ? "-" : "" ), abs ( addend ), output->len, add->divisor, val ); -- cgit v1.2.3-55-g7522