aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2018-01-30 23:53:38 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2018-01-30 23:53:38 +0100
commitd7500f856d856716fd228935bb5e84c897c9daa8 (patch)
tree369986dbe662d673855dac5f2ac1bf0e61666f78
parent6ba6a6f28e456c0148abece678eab1c1194632f2 (diff)
downloadbusybox-w32-d7500f856d856716fd228935bb5e84c897c9daa8.tar.gz
busybox-w32-d7500f856d856716fd228935bb5e84c897c9daa8.tar.bz2
busybox-w32-d7500f856d856716fd228935bb5e84c897c9daa8.zip
gzip: use "unsigned" type for bit fields and bit counts
This does not change any logic, those values should always be positive. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--archival/gzip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index 4a3fe976a..f253a217a 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -363,7 +363,7 @@ struct globals {
363/* Number of bits used within bi_buf. (bi_buf might be implemented on 363/* Number of bits used within bi_buf. (bi_buf might be implemented on
364 * more than 16 bits on some systems.) 364 * more than 16 bits on some systems.)
365 */ 365 */
366 int bi_valid; 366 unsigned bi_valid;
367 367
368#ifdef DEBUG 368#ifdef DEBUG
369 ulg bits_sent; /* bit length of the compressed data */ 369 ulg bits_sent; /* bit length of the compressed data */
@@ -520,10 +520,10 @@ static unsigned file_read(void *buf, unsigned size)
520 * Send a value on a given number of bits. 520 * Send a value on a given number of bits.
521 * IN assertion: length <= 16 and value fits in length bits. 521 * IN assertion: length <= 16 and value fits in length bits.
522 */ 522 */
523static void send_bits(int value, int length) 523static void send_bits(unsigned value, unsigned length)
524{ 524{
525 unsigned new_buf; 525 unsigned new_buf;
526 int remain; 526 unsigned remain;
527 527
528#ifdef DEBUG 528#ifdef DEBUG
529 Tracev((stderr, " l %2d v %4x ", length, value)); 529 Tracev((stderr, " l %2d v %4x ", length, value));
@@ -548,7 +548,7 @@ static void send_bits(int value, int length)
548 } else { /* 16 */ 548 } else { /* 16 */
549 put_16bit(new_buf); 549 put_16bit(new_buf);
550 } 550 }
551 new_buf = (unsigned) value >> remain; 551 new_buf = value >> remain;
552 length -= BUF_SIZE; 552 length -= BUF_SIZE;
553 } 553 }
554 G1.bi_buf = new_buf; 554 G1.bi_buf = new_buf;