From 5775e029be30c19e44f09bd40865d58394a3f75d Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Sat, 28 Feb 2015 16:01:26 +0000 Subject: [PATCH] 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 --- lzs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lzs.c b/lzs.c index 9600de21..fc0be556 100644 --- a/lzs.c +++ b/lzs.c @@ -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; \