diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-15 21:30:45 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-05-15 21:30:45 +0000 |
commit | 6b06cb80be64fcf207bee734cc678c25434ed1a4 (patch) | |
tree | aebc37ae3a2658fba3f57003102fa0dfb1a10ac8 /archival | |
parent | 43d5d429fd7a80ca02eb8388f058fd9654cc118d (diff) | |
download | busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.gz busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.tar.bz2 busybox-w32-6b06cb80be64fcf207bee734cc678c25434ed1a4.zip |
more of -Wall fixes from Cristian Ionescu-Idbohrn.
Some are fixing real bugs.
function old new delta
syslogd_main 938 958 +20
get_signum 136 143 +7
obj_load 777 782 +5
recv_from_to 210 214 +4
get_next_block 1795 1799 +4
display_topmem_process_list 1117 1121 +4
logread_main 484 487 +3
buffer_fill_and_print 73 76 +3
kill_main 687 689 +2
ll_remember_index 240 241 +1
do_stats 452 453 +1
if_readconf 166 165 -1
display_process_list 1192 1191 -1
run_applet_and_exit 507 505 -2
print_signames 33 31 -2
parse_one_line 1092 1090 -2
find_out_spec 57 55 -2
add_ksymoops_symbols 421 419 -2
ash_main 1407 1402 -5
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 11/8 up/down: 54/-17) Total: 37 bytes
Diffstat (limited to 'archival')
-rw-r--r-- | archival/libunarchive/archive_xread_all_eof.c | 2 | ||||
-rw-r--r-- | archival/libunarchive/decompress_bunzip2.c | 8 | ||||
-rw-r--r-- | archival/libunarchive/decompress_unlzma.c | 6 | ||||
-rw-r--r-- | archival/libunarchive/decompress_unzip.c | 6 |
4 files changed, 11 insertions, 11 deletions
diff --git a/archival/libunarchive/archive_xread_all_eof.c b/archival/libunarchive/archive_xread_all_eof.c index 7e082ab1d..c93dfa282 100644 --- a/archival/libunarchive/archive_xread_all_eof.c +++ b/archival/libunarchive/archive_xread_all_eof.c | |||
@@ -12,7 +12,7 @@ ssize_t archive_xread_all_eof(archive_handle_t *archive_handle, | |||
12 | ssize_t size; | 12 | ssize_t size; |
13 | 13 | ||
14 | size = full_read(archive_handle->src_fd, buf, count); | 14 | size = full_read(archive_handle->src_fd, buf, count); |
15 | if (size != 0 && size != count) { | 15 | if (size != 0 && size != (ssize_t)count) { |
16 | bb_error_msg_and_die("short read: %u of %u", | 16 | bb_error_msg_and_die("short read: %u of %u", |
17 | (unsigned)size, (unsigned)count); | 17 | (unsigned)size, (unsigned)count); |
18 | } | 18 | } |
diff --git a/archival/libunarchive/decompress_bunzip2.c b/archival/libunarchive/decompress_bunzip2.c index c1b12732c..f74fdf1ad 100644 --- a/archival/libunarchive/decompress_bunzip2.c +++ b/archival/libunarchive/decompress_bunzip2.c | |||
@@ -103,7 +103,7 @@ static unsigned get_bits(bunzip_data *bd, int bits_wanted) | |||
103 | /* If we need to get more data from the byte buffer, do so. (Loop getting | 103 | /* If we need to get more data from the byte buffer, do so. (Loop getting |
104 | one byte at a time to enforce endianness and avoid unaligned access.) */ | 104 | one byte at a time to enforce endianness and avoid unaligned access.) */ |
105 | 105 | ||
106 | while (bd->inbufBitCount < bits_wanted) { | 106 | while ((int)(bd->inbufBitCount) < bits_wanted) { |
107 | 107 | ||
108 | /* If we need to read more data from file into byte buffer, do so */ | 108 | /* If we need to read more data from file into byte buffer, do so */ |
109 | 109 | ||
@@ -172,7 +172,7 @@ static int get_next_block(bunzip_data *bd) | |||
172 | 172 | ||
173 | if (get_bits(bd, 1)) return RETVAL_OBSOLETE_INPUT; | 173 | if (get_bits(bd, 1)) return RETVAL_OBSOLETE_INPUT; |
174 | origPtr = get_bits(bd, 24); | 174 | origPtr = get_bits(bd, 24); |
175 | if (origPtr > dbufSize) return RETVAL_DATA_ERROR; | 175 | if ((int)origPtr > dbufSize) return RETVAL_DATA_ERROR; |
176 | 176 | ||
177 | /* mapping table: if some byte values are never used (encoding things | 177 | /* mapping table: if some byte values are never used (encoding things |
178 | like ascii text), the compression code removes the gaps to have fewer | 178 | like ascii text), the compression code removes the gaps to have fewer |
@@ -368,7 +368,7 @@ static int get_next_block(bunzip_data *bd) | |||
368 | j = get_bits(bd, hufGroup->maxLen); | 368 | j = get_bits(bd, hufGroup->maxLen); |
369 | */ | 369 | */ |
370 | 370 | ||
371 | while (bd->inbufBitCount < hufGroup->maxLen) { | 371 | while ((int)(bd->inbufBitCount) < hufGroup->maxLen) { |
372 | if (bd->inbufPos == bd->inbufCount) { | 372 | if (bd->inbufPos == bd->inbufCount) { |
373 | j = get_bits(bd, hufGroup->maxLen); | 373 | j = get_bits(bd, hufGroup->maxLen); |
374 | goto got_huff_bits; | 374 | goto got_huff_bits; |
@@ -505,7 +505,7 @@ static int get_next_block(bunzip_data *bd) | |||
505 | it doesn't qualify as a run (hence writeRunCountdown=5). */ | 505 | it doesn't qualify as a run (hence writeRunCountdown=5). */ |
506 | 506 | ||
507 | if (dbufCount) { | 507 | if (dbufCount) { |
508 | if (origPtr >= dbufCount) return RETVAL_DATA_ERROR; | 508 | if ((int)origPtr >= dbufCount) return RETVAL_DATA_ERROR; |
509 | bd->writePos = dbuf[origPtr]; | 509 | bd->writePos = dbuf[origPtr]; |
510 | bd->writeCurrent = (unsigned char)(bd->writePos & 0xff); | 510 | bd->writeCurrent = (unsigned char)(bd->writePos & 0xff); |
511 | bd->writePos >>= 8; | 511 | bd->writePos >>= 8; |
diff --git a/archival/libunarchive/decompress_unlzma.c b/archival/libunarchive/decompress_unlzma.c index 5fb7eaee0..c32040075 100644 --- a/archival/libunarchive/decompress_unlzma.c +++ b/archival/libunarchive/decompress_unlzma.c | |||
@@ -329,7 +329,7 @@ unpack_lzma_stream(int src_fd, int dst_fd) | |||
329 | if (buffer_pos == header.dict_size) { | 329 | if (buffer_pos == header.dict_size) { |
330 | buffer_pos = 0; | 330 | buffer_pos = 0; |
331 | global_pos += header.dict_size; | 331 | global_pos += header.dict_size; |
332 | if (full_write(dst_fd, buffer, header.dict_size) != header.dict_size) | 332 | if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) |
333 | goto bad; | 333 | goto bad; |
334 | USE_DESKTOP(total_written += header.dict_size;) | 334 | USE_DESKTOP(total_written += header.dict_size;) |
335 | } | 335 | } |
@@ -480,7 +480,7 @@ unpack_lzma_stream(int src_fd, int dst_fd) | |||
480 | if (buffer_pos == header.dict_size) { | 480 | if (buffer_pos == header.dict_size) { |
481 | buffer_pos = 0; | 481 | buffer_pos = 0; |
482 | global_pos += header.dict_size; | 482 | global_pos += header.dict_size; |
483 | if (full_write(dst_fd, buffer, header.dict_size) != header.dict_size) | 483 | if (full_write(dst_fd, buffer, header.dict_size) != (ssize_t)header.dict_size) |
484 | goto bad; | 484 | goto bad; |
485 | USE_DESKTOP(total_written += header.dict_size;) | 485 | USE_DESKTOP(total_written += header.dict_size;) |
486 | } | 486 | } |
@@ -489,7 +489,7 @@ unpack_lzma_stream(int src_fd, int dst_fd) | |||
489 | } | 489 | } |
490 | } | 490 | } |
491 | 491 | ||
492 | if (full_write(dst_fd, buffer, buffer_pos) != buffer_pos) { | 492 | if (full_write(dst_fd, buffer, buffer_pos) != (ssize_t)buffer_pos) { |
493 | bad: | 493 | bad: |
494 | rc_free(rc); | 494 | rc_free(rc); |
495 | return -1; | 495 | return -1; |
diff --git a/archival/libunarchive/decompress_unzip.c b/archival/libunarchive/decompress_unzip.c index a764fbc98..9036fabf2 100644 --- a/archival/libunarchive/decompress_unzip.c +++ b/archival/libunarchive/decompress_unzip.c | |||
@@ -922,7 +922,7 @@ static int inflate_block(STATE_PARAM smallint *e) | |||
922 | /* Two callsites, both in inflate_get_next_window */ | 922 | /* Two callsites, both in inflate_get_next_window */ |
923 | static void calculate_gunzip_crc(STATE_PARAM_ONLY) | 923 | static void calculate_gunzip_crc(STATE_PARAM_ONLY) |
924 | { | 924 | { |
925 | int n; | 925 | unsigned n; |
926 | for (n = 0; n < gunzip_outbuf_count; n++) { | 926 | for (n = 0; n < gunzip_outbuf_count; n++) { |
927 | gunzip_crc = gunzip_crc_table[((int) gunzip_crc ^ (gunzip_window[n])) & 0xff] ^ (gunzip_crc >> 8); | 927 | gunzip_crc = gunzip_crc_table[((int) gunzip_crc ^ (gunzip_window[n])) & 0xff] ^ (gunzip_crc >> 8); |
928 | } | 928 | } |
@@ -1003,7 +1003,7 @@ inflate_unzip_internal(STATE_PARAM int in, int out) | |||
1003 | while (1) { | 1003 | while (1) { |
1004 | int r = inflate_get_next_window(PASS_STATE_ONLY); | 1004 | int r = inflate_get_next_window(PASS_STATE_ONLY); |
1005 | nwrote = full_write(out, gunzip_window, gunzip_outbuf_count); | 1005 | nwrote = full_write(out, gunzip_window, gunzip_outbuf_count); |
1006 | if (nwrote != gunzip_outbuf_count) { | 1006 | if (nwrote != (ssize_t)gunzip_outbuf_count) { |
1007 | bb_perror_msg("write"); | 1007 | bb_perror_msg("write"); |
1008 | n = -1; | 1008 | n = -1; |
1009 | goto ret; | 1009 | goto ret; |
@@ -1064,7 +1064,7 @@ static int top_up(STATE_PARAM unsigned n) | |||
1064 | { | 1064 | { |
1065 | int count = bytebuffer_size - bytebuffer_offset; | 1065 | int count = bytebuffer_size - bytebuffer_offset; |
1066 | 1066 | ||
1067 | if (count < n) { | 1067 | if (count < (int)n) { |
1068 | memmove(bytebuffer, &bytebuffer[bytebuffer_offset], count); | 1068 | memmove(bytebuffer, &bytebuffer[bytebuffer_offset], count); |
1069 | bytebuffer_offset = 0; | 1069 | bytebuffer_offset = 0; |
1070 | bytebuffer_size = full_read(gunzip_src_fd, &bytebuffer[count], bytebuffer_max - count); | 1070 | bytebuffer_size = full_read(gunzip_src_fd, &bytebuffer[count], bytebuffer_max - count); |