mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-28 10:50:07 +01:00
util: fix a ubsan complaint about undefined left-shift
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
708b3f0d8e
commit
a738ba1aed
1 changed files with 3 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue