1 #ifndef _RE2C_TEST_RANGE_TEST_IMPL_
2 #define _RE2C_TEST_RANGE_TEST_IMPL_
10 static inline bool bit_set (uint32_t n, uint32_t bit)
12 return n & (1u << bit);
15 template <u
int8_t BITS>
22 for (uint32_t i = 0; i < BITS; ++i)
24 for (; i < BITS && !
bit_set (n, i); ++i);
25 if (i == BITS && !
bit_set (n, BITS - 1))
29 const uint32_t lb = i;
30 for (; i < BITS &&
bit_set (n, i); ++i);
31 re2c::Range::append (p, lb, i);
36 template <u
int8_t BITS>
39 return range<BITS> (n1 | n2);
42 template <u
int8_t BITS>
45 return range<BITS> (n1 & ~n2);
50 #endif // _RE2C_TEST_RANGE_TEST_IMPL_
re2c::Range * add(uint32_t n1, uint32_t n2)
static bool bit_set(uint32_t n, uint32_t bit)
re2c::Range * range(uint32_t n)
re2c::Range * sub(uint32_t n1, uint32_t n2)
#define RE2C_STATIC_ASSERT(e)