diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2019-06-23 21:38:56 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2019-12-31 22:19:18 +0200 |
commit | a45d1a5374ceb22e23255b0b595b9e641e9860af (patch) | |
tree | ac0a6e71d077fae66d9b2e7881cc05aa1130e4ed /src/liblzma/simple/powerpc.c | |
parent | tuklib_integer: Silence warnings from -Wsign-conversion. (diff) | |
download | xz-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/powerpc.c')
-rw-r--r-- | src/liblzma/simple/powerpc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/liblzma/simple/powerpc.c b/src/liblzma/simple/powerpc.c index 54dfbf10..0b60e9b3 100644 --- a/src/liblzma/simple/powerpc.c +++ b/src/liblzma/simple/powerpc.c @@ -25,10 +25,11 @@ powerpc_code(void *simple lzma_attribute((__unused__)), if ((buffer[i] >> 2) == 0x12 && ((buffer[i + 3] & 3) == 1)) { - const uint32_t src = ((buffer[i + 0] & 3) << 24) - | (buffer[i + 1] << 16) - | (buffer[i + 2] << 8) - | (buffer[i + 3] & (~3)); + const uint32_t src + = (((uint32_t)(buffer[i + 0]) & 3) << 24) + | ((uint32_t)(buffer[i + 1]) << 16) + | ((uint32_t)(buffer[i + 2]) << 8) + | ((uint32_t)(buffer[i + 3]) & ~UINT32_C(3)); uint32_t dest; if (is_encoder) |