fix parse_special_byte function
This commit is contained in:
parent
7239582251
commit
aa1ed8a06e
2
creole.c
2
creole.c
|
@ -210,7 +210,7 @@ static int parse_special_byte(unsigned char c, struct word *w)
|
|||
if (i >= SPECIAL_CONTINUE_BYTE_NUM)
|
||||
return 0;
|
||||
|
||||
w->high_bits = (w->high_bits << i) | ((c >> (5 - i)) & mask[i]);
|
||||
w->high_bits = (w->high_bits << (i + 1)) | ((c >> (5 - i)) & mask[i]);
|
||||
w->word = c & wordmask[i];
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -209,7 +209,7 @@ void encode_decode_byte_seq(creole_word max, unsigned encode_to, unsigned high_b
|
|||
static void test_encode_decode(void) {
|
||||
unsigned high_bits = 0;
|
||||
int encode_len;
|
||||
creole_word maxima[6] = {0x7F, 0xFFF, 0x1FFFF, 0x3FFFFF, 0x7FFFFFF, 0xFFFFFFFF};
|
||||
const creole_word maxima[6] = {0x7F, 0xFFF, 0x1FFFF, 0x3FFFFF, 0x7FFFFFF, 0xFFFFFFFF};
|
||||
|
||||
encode_decode_byte_seq(0x7F, 1, 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue