From dfac2c9a1d7d4a2b8a5d7c9c6d567dee48318bcf Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Sun, 23 Jun 2019 21:38:56 +0300 Subject: 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). --- src/liblzma/lzma/lzma_common.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/liblzma/lzma/lzma_common.h') 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 -- cgit v1.2.3