From f3b3d20f45e2f64c01e9c967cf33a86a79ea2932 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 23 Jul 2022 19:00:18 +0100 Subject: [PATCH] ICB: Fix Left Shift of Negative Value GCC Compiler Warning in NanoJPEG This is emitted by GCC when -Wshift-negative-value is passed. ICB has been tested and the jpeg backgrounds still decode as expected with this change. --- engines/icb/jpeg_decode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/icb/jpeg_decode.cpp b/engines/icb/jpeg_decode.cpp index 18b3e5f1056..50a18270f64 100644 --- a/engines/icb/jpeg_decode.cpp +++ b/engines/icb/jpeg_decode.cpp @@ -421,7 +421,7 @@ static int njGetVLC(nj_vlc_code_t *vlc, byte *code) { return 0; value = njGetBits(bits); if (value < (1 << (bits - 1))) - value += ((-1) << bits) + 1; + value += (0xffffffff << bits) + 1; return value; }