util: change the bit to shift to ULL

libevdev/libevdev-util.h:45:45: runtime error: left shift of 1 by 63 places cannot be represented in type 'long long'

Fixes: #32
Part-of: <https://gitlab.freedesktop.org/libevdev/libevdev/-/merge_requests/127>
This commit is contained in:
Peter Hutterer 2025-08-13 21:21:52 +10:00
parent d093b4752a
commit a30a461e82

View file

@ -42,19 +42,19 @@ startswith(const char *str, size_t len, const char *prefix, size_t plen)
static inline int static inline int
bit_is_set(const unsigned long *array, int bit) 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 static inline void
set_bit(unsigned long *array, int bit) 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 static inline void
clear_bit(unsigned long *array, int bit) 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 static inline void