david/ipxe
david
/
ipxe
Archived
1
0
Fork 0

[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 <mdc@etherboot.org>
This commit is contained in:
Thomas Miletich 2009-10-17 16:52:30 +02:00 committed by Marty Connor
parent 7296f1f21c
commit 78e54426c0
1 changed files with 5 additions and 5 deletions

View File

@ -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 );