Skip to content

Commit bc24f6d

Browse files
committed
FIX: getting rid of "shifting a negative signed value is undefined" warnings using Clang
1 parent ab75f8f commit bc24f6d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/core/u-jpg.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -3740,10 +3740,10 @@ static const int extend_test[16] = /* entry n is 2**(n-1) */
37403740
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
37413741

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

37483748
#endif /* AVOID_TABLES */
37493749

@@ -10339,10 +10339,10 @@ static const int p_extend_test[16] = /* entry n is 2**(n-1) */
1033910339
0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000 };
1034010340

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

1034710347
#endif /* AVOID_TABLES */
1034810348

0 commit comments

Comments
 (0)