Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Stop using 1ULL as the base value to be shifted in LZS GET_BITS()
Keeping this as an int is fine; it'll never be shifted by more than 9. And
the promotion of (src[0] << (bits - bits_left)) from int to unsigned long
long makes Coverity unhappy because of the sign-extension.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Feb 28, 2015
1 parent 21918c3 commit 5775e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lzs.c
Expand Up @@ -42,7 +42,7 @@ do { \
if (bits >= 8 || bits >= bits_left) { \
/* We need *all* the bits that are left in the current \
* byte. Take them and bump the input pointer. */ \
data = (src[0] << (bits - bits_left)) & ((1ULL << bits) - 1); \
data = (src[0] << (bits - bits_left)) & ((1 << bits) - 1); \
src++; \
srclen--; \
bits_left += 8 - bits; \
Expand Down

0 comments on commit 5775e02

Please sign in to comment.