summaryrefslogtreecommitdiff
path: root/archival
diff options
context:
space:
mode:
authorDenys Vlasenko2018-01-30 23:53:38 +0100
committerDenys Vlasenko2018-01-30 23:53:38 +0100
commitd7500f856d856716fd228935bb5e84c897c9daa8 (patch)
tree369986dbe662d673855dac5f2ac1bf0e61666f78 /archival
parent6ba6a6f28e456c0148abece678eab1c1194632f2 (diff)
downloadbusybox-d7500f856d856716fd228935bb5e84c897c9daa8.zip
busybox-d7500f856d856716fd228935bb5e84c897c9daa8.tar.gz
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>
Diffstat (limited to 'archival')
-rw-r--r--archival/gzip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index 4a3fe97..f253a21 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -363,7 +363,7 @@ struct globals {
/* Number of bits used within bi_buf. (bi_buf might be implemented on
* more than 16 bits on some systems.)
*/
- int bi_valid;
+ unsigned bi_valid;
#ifdef DEBUG
ulg bits_sent; /* bit length of the compressed data */
@@ -520,10 +520,10 @@ static unsigned file_read(void *buf, unsigned size)
* Send a value on a given number of bits.
* IN assertion: length <= 16 and value fits in length bits.
*/
-static void send_bits(int value, int length)
+static void send_bits(unsigned value, unsigned length)
{
unsigned new_buf;
- int remain;
+ unsigned remain;
#ifdef DEBUG
Tracev((stderr, " l %2d v %4x ", length, value));
@@ -548,7 +548,7 @@ static void send_bits(int value, int length)
} else { /* 16 */
put_16bit(new_buf);
}
- new_buf = (unsigned) value >> remain;
+ new_buf = value >> remain;
length -= BUF_SIZE;
}
G1.bi_buf = new_buf;