aboutsummaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
Diffstat (limited to 'archival')
-rw-r--r--archival/libunarchive/archive_xread_all_eof.c2
-rw-r--r--archival/libunarchive/decompress_bunzip2.c8
-rw-r--r--archival/libunarchive/decompress_unlzma.c6
-rw-r--r--archival/libunarchive/decompress_unzip.c6
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 */
923static void calculate_gunzip_crc(STATE_PARAM_ONLY) 923static 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);