The existing code specified just 'char' for a variable expected to be
signed, but the signedness of a 'char' is implementation-defined. (In
fact, on ARM it is unsigned.)
unsigned i;
unsigned len_in_run;
unsigned additional_bits;
- char delta;
+ signed char delta;
u8 pretree_sym;
ZERO_ARRAY(pretree_freqs);
* */
while (cur_run_len >= 4) {
additional_bits = (cur_run_len > 4);
- delta = -(char)len_in_run;
+ delta = -(signed char)len_in_run;
if (delta < 0)
delta += 17;
pretree_freqs[19]++;
* as a difference from the length of that codeword in the
* previous tree. */
while (cur_run_len--) {
- delta = -(char)len_in_run;
+ delta = -(signed char)len_in_run;
if (delta < 0)
delta += 17;
unsigned num_zeroes;
unsigned code;
unsigned num_same;
- char value;
+ signed char value;
ret = read_huffsym_using_pretree(istream, pretree_decode_table,
pretree_lens, &tree_code);
&code);
if (ret != 0)
return ret;
- value = (char)*lens - (char)code;
+ value = (signed char)*lens - (signed char)code;
if (value < 0)
value += 17;
while (num_same--) {
}
break;
default: /* Difference from old length. */
- value = (char)*lens - (char)tree_code;
+ value = (signed char)*lens - (signed char)tree_code;
if (value < 0)
value += 17;
*lens = value;