diff options
-rw-r--r-- | src/crcXXgen.c.tpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/crcXXgen.c.tpl b/src/crcXXgen.c.tpl index 80bf1e2a..2a4bf213 100644 --- a/src/crcXXgen.c.tpl +++ b/src/crcXXgen.c.tpl @@ -53,13 +53,13 @@ osmo_crcXXgen_compute_bits(const struct osmo_crcXXgen_code *code, for (i=0; i<len; i++) { uintXX_t bit = in[i] & 1; crc ^= (bit << n); - if (crc & (1 << n)) { + if (crc & ((uintXX_t)1 << n)) { crc <<= 1; crc ^= poly; } else { crc <<= 1; } - crc &= (1ULL << code->bits) - 1; + crc &= ((uintXX_t)1 << code->bits) - 1; } crc ^= code->remainder; |