aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/lzma/lzma_common.h
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-12-31 22:19:18 +0200
commita45d1a5374ceb22e23255b0b595b9e641e9860af (patch)
treeac0a6e71d077fae66d9b2e7881cc05aa1130e4ed /src/liblzma/lzma/lzma_common.h
parenttuklib_integer: Silence warnings from -Wsign-conversion. (diff)
downloadxz-a45d1a5374ceb22e23255b0b595b9e641e9860af.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 'src/liblzma/lzma/lzma_common.h')
-rw-r--r--src/liblzma/lzma/lzma_common.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/liblzma/lzma/lzma_common.h b/src/liblzma/lzma/lzma_common.h
index 09efd387..9d040d95 100644
--- a/src/liblzma/lzma/lzma_common.h
+++ b/src/liblzma/lzma/lzma_common.h
@@ -122,7 +122,8 @@ typedef enum {
/// byte; and
/// - the highest literal_context_bits bits of the previous byte.
#define literal_subcoder(probs, lc, lp_mask, pos, prev_byte) \
- ((probs)[(((pos) & lp_mask) << lc) + ((prev_byte) >> (8 - lc))])
+ ((probs)[(((pos) & (lp_mask)) << (lc)) \
+ + ((uint32_t)(prev_byte) >> (8U - (lc)))])
static inline void