aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_decoder.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2019-06-23 21:38:56 +0300
committerLasse Collin <lasse.collin@tukaani.org>2019-06-23 21:38:56 +0300
commitdfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf (patch)
treea7f2f8d656bb83f7c6d31e292505d90ba1c980d1 /src/liblzma/lzma/lzma_decoder.c
parenttuklib_integer: Silence warnings from -Wsign-conversion. (diff)
downloadxz-dfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf.tar.xz
liblzma: Fix warnings from -Wsign-conversion.
Also, more parentheses were added to the literal_subcoder macro in lzma_comon.h (better style but no functional change in the current usage).
Diffstat (limited to '')
-rw-r--r--src/liblzma/lzma/lzma_decoder.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/liblzma/lzma/lzma_decoder.c b/src/liblzma/lzma/lzma_decoder.c
index d0f29b76..9af500f0 100644
--- a/src/liblzma/lzma/lzma_decoder.c
+++ b/src/liblzma/lzma/lzma_decoder.c
@@ -398,7 +398,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// ("match byte") to "len" to minimize the
// number of variables we need to store
// between decoder calls.
- len = dict_get(&dict, rep0) << 1;
+ len = (uint32_t)(dict_get(&dict, rep0)) << 1;
// The usage of "offset" allows omitting some
// branches, which should give tiny speed
@@ -569,7 +569,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
#ifdef HAVE_SMALL
do {
rc_bit(probs[symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_DIST_MODEL);
} while (++offset < limit);
#else
@@ -577,25 +577,25 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
case 5:
assert(offset == 0);
rc_bit(probs[symbol], ,
- rep0 += 1,
+ rep0 += 1U,
SEQ_DIST_MODEL);
++offset;
--limit;
case 4:
rc_bit(probs[symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_DIST_MODEL);
++offset;
--limit;
case 3:
rc_bit(probs[symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_DIST_MODEL);
++offset;
--limit;
case 2:
rc_bit(probs[symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_DIST_MODEL);
++offset;
--limit;
@@ -607,7 +607,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
// the unneeded updating of
// "symbol".
rc_bit_last(probs[symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_DIST_MODEL);
}
#endif
@@ -635,7 +635,7 @@ lzma_decode(void *coder_ptr, lzma_dict *restrict dictptr,
do {
rc_bit(coder->pos_align[
symbol], ,
- rep0 += 1 << offset,
+ rep0 += 1U << offset,
SEQ_ALIGN);
} while (++offset < ALIGN_BITS);
#else