diff --git a/src/bitarray.h b/src/bitarray.h index e9a2175a2..960cbace7 100644 --- a/src/bitarray.h +++ b/src/bitarray.h @@ -39,17 +39,17 @@ static inline size_t number_of_blocks(size_t N) { return NR_BLOCKS_LOOKUP[N]; } -static inline size_t remainder(size_t N) { +static inline size_t remainder_lookup(size_t N) { DIGRAPHS_ASSERT(N < LOOKUP_SIZE); return REMAINDER_LOOKUP[N]; } -static inline size_t quotient(size_t N) { +static inline size_t quotient_lookup(size_t N) { DIGRAPHS_ASSERT(N < LOOKUP_SIZE); return QUOTIENT_LOOKUP[N]; } -static inline Block mask(size_t N) { +static inline Block mask_lookup(size_t N) { DIGRAPHS_ASSERT(N < NUMBER_BITS_PER_BLOCK); return MASK_LOOKUP[N]; } @@ -93,9 +93,11 @@ set_bit_array(BitArray* const bit_array, uint16_t const pos, bool const val) { DIGRAPHS_ASSERT(bit_array != NULL); DIGRAPHS_ASSERT(pos < bit_array->nr_bits); if (val) { - bit_array->blocks[quotient(pos)] |= mask(remainder(pos)); + bit_array->blocks[quotient_lookup(pos)] |= + mask_lookup(remainder_lookup(pos)); } else { - bit_array->blocks[quotient(pos)] &= ~mask(remainder(pos)); + bit_array->blocks[quotient_lookup(pos)] &= + ~mask_lookup(remainder_lookup(pos)); } } @@ -105,7 +107,8 @@ static inline bool get_bit_array(BitArray const* const bit_array, uint16_t const pos) { DIGRAPHS_ASSERT(bit_array != NULL); DIGRAPHS_ASSERT(pos < bit_array->nr_bits); - return bit_array->blocks[quotient(pos)] & mask(remainder(pos)); + return bit_array->blocks[quotient_lookup(pos)] + & mask_lookup(remainder_lookup(pos)); } //! Intersect the BitArray's pointed to by \p bit_array1 and \p bit_array2. The