morphisms: fix bitshift in lenpfx to msb-cont
This commit is contained in:
parent
6f0a0f5927
commit
ea2504ff07
1 changed files with 3 additions and 3 deletions
|
@ -29,13 +29,13 @@ morph_array_as_lenpfx_to_continuation_bit (T:Type)
|
|||
```
|
||||
for( uint64_t i = 0; i < src->len; ++i ) {
|
||||
const size_t n_bits = 8*sizeof(T);
|
||||
if( src->items[i] & (1<<(n_bits-1)) ) {
|
||||
fprintf(stderr, "error: value to high for MsbContinuation\n");
|
||||
if( src->items[i] & ((uint64_t)1<<(n_bits-1)) ) {
|
||||
fprintf(stderr, "error: value has MSB set, while being used in MsbContinuation sequence!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
dst[i] = src->items[i];
|
||||
if( i+1 < src->len )
|
||||
dst[i] |= (1<<(n_bits-1));
|
||||
dst[i] |= ((uint64_t)1<<(n_bits-1));
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue