Commit a738ba1a authored by Peter Hutterer's avatar Peter Hutterer
Browse files

util: fix a ubsan complaint about undefined left-shift



Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent 708b3f0d
Pipeline #2532 failed with stages
in 81 minutes and 36 seconds
......@@ -207,19 +207,19 @@ msleep(unsigned int ms)
static inline bool
long_bit_is_set(const unsigned long *array, int bit)
{
return !!(array[bit / LONG_BITS] & (1LL << (bit % LONG_BITS)));
return !!(array[bit / LONG_BITS] & (1ULL << (bit % LONG_BITS)));
}
static inline void
long_set_bit(unsigned long *array, int bit)
{
array[bit / LONG_BITS] |= (1LL << (bit % LONG_BITS));
array[bit / LONG_BITS] |= (1ULL << (bit % LONG_BITS));
}
static inline void
long_clear_bit(unsigned long *array, int bit)
{
array[bit / LONG_BITS] &= ~(1LL << (bit % LONG_BITS));
array[bit / LONG_BITS] &= ~(1ULL << (bit % LONG_BITS));
}
static inline void
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment