Skip to content

Commit

Permalink
Merge pull request #785 from guillep/warning-shift-negative-value
Browse files Browse the repository at this point in the history
Fix shift-negative-value warning and reenable warning
  • Loading branch information
guillep authored May 2, 2024
2 parents 21218ee + 73f8b13 commit ac1ea33
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ add_compile_options(
-Wno-compare-distinct-pointer-types
-Wno-conditional-type-mismatch
-Wno-unused-local-typedef
-Wno-shift-negative-value
-Wno-unknown-warning-option
)

Expand Down
10 changes: 5 additions & 5 deletions extracted/plugins/JPEGReadWriter2Plugin/src/common/jdhuff.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ jpeg_huff_decode (bitread_working_state * state,

#ifdef AVOID_TABLES

#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + ((((unsigned int)(-1))<<(s)) + 1) : (x))

#else

Expand All @@ -451,10 +451,10 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };

static const int extend_offset[16] = /* entry n is (-1 << n) + 1 */
{ 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1,
((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1,
((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1,
((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 };
{ 0, (((unsigned int)(-1))<<1) + 1, (((unsigned int)(-1))<<2) + 1, (((unsigned int)(-1))<<3) + 1, (((unsigned int)(-1))<<4) + 1,
(((unsigned int)(-1))<<5) + 1, (((unsigned int)(-1))<<6) + 1, (((unsigned int)(-1))<<7) + 1, (((unsigned int)(-1))<<8) + 1,
(((unsigned int)(-1))<<9) + 1, (((unsigned int)(-1))<<10) + 1, (((unsigned int)(-1))<<11) + 1, (((unsigned int)(-1))<<12) + 1,
(((unsigned int)(-1))<<13) + 1, (((unsigned int)(-1))<<14) + 1, (((unsigned int)(-1))<<15) + 1 };

#endif /* AVOID_TABLES */

Expand Down

0 comments on commit ac1ea33

Please sign in to comment.