aboutsummaryrefslogtreecommitdiff
path: root/src/liblzma/simple/armthumb.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-12-31 22:19:18 +0200
commita45d1a5374ceb22e23255b0b595b9e641e9860af (patch)
treeac0a6e71d077fae66d9b2e7881cc05aa1130e4ed /src/liblzma/simple/armthumb.c
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/simple/armthumb.c')
-rw-r--r--src/liblzma/simple/armthumb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/liblzma/simple/armthumb.c b/src/liblzma/simple/armthumb.c
index eab4862d..a8da334a 100644
--- a/src/liblzma/simple/armthumb.c
+++ b/src/liblzma/simple/armthumb.c
@@ -23,10 +23,10 @@ armthumb_code(void *simple lzma_attribute((__unused__)),
for (i = 0; i + 4 <= size; i += 2) {
if ((buffer[i + 1] & 0xF8) == 0xF0
&& (buffer[i + 3] & 0xF8) == 0xF8) {
- uint32_t src = ((buffer[i + 1] & 0x7) << 19)
- | (buffer[i + 0] << 11)
- | ((buffer[i + 3] & 0x7) << 8)
- | (buffer[i + 2]);
+ uint32_t src = (((uint32_t)(buffer[i + 1]) & 7) << 19)
+ | ((uint32_t)(buffer[i + 0]) << 11)
+ | (((uint32_t)(buffer[i + 3]) & 7) << 8)
+ | (uint32_t)(buffer[i + 2]);
src <<= 1;