7 -#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((-1)<<(s)) + 1)))
8 +#define HUFF_EXTEND(x,s) ((x) + ((((x) - (1<<((s)-1))) >> 31) & (((unsigned)-1<<(s)) + 1)))
18 -#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((-1)<<(s)) + 1) : (x))
19 +#define HUFF_EXTEND(x,s) ((x) < (1<<((s)-1)) ? (x) + (((unsigned)-1<<(s)) + 1) : (x))
24 s += state.last_dc_val[ci];
25 state.last_dc_val[ci] = s;
26 /* Scale and output the coefficient (assumes jpeg_natural_order[0]=0) */
27 - (*block)[0] = (JCOEF) (s << Al);
28 + (*block)[0] = (JCOEF) ((unsigned)s << Al);
31 /* Completed MCU, so update state */
34 s = HUFF_EXTEND(r, s);
35 /* Scale and output coefficient in natural (dezigzagged) order */
36 - (*block)[jpeg_natural_order[k]] = (JCOEF) (s << Al);
37 + (*block)[jpeg_natural_order[k]] = (JCOEF) ((unsigned)s << Al);
39 if (r == 15) { /* ZRL */
40 k += 15; /* skip 15 zeroes in band */
42 phuff_entropy_ptr entropy = (phuff_entropy_ptr) cinfo->entropy;
44 int p1 = 1 << cinfo->Al; /* 1 in the bit position being coded */
45 - int m1 = (-1) << cinfo->Al; /* -1 in the bit position being coded */
46 + int m1 = (unsigned)-1 << cinfo->Al; /* -1 in the bit position being coded */