util: add bitmask_size() to return the size of a bitmask

This way we can theoretically change the bitmask to use a longer type in
the future.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1271>
This commit is contained in:
Peter Hutterer 2025-07-14 14:10:22 +10:00
parent 8336721dc0
commit 4c4d5f33ee

View file

@ -106,6 +106,12 @@ typedef struct {
uint32_t mask;
} bitmask_t;
static inline size_t
bitmask_size(void)
{
return 32;
}
static inline uint32_t
bitmask_as_u32(bitmask_t mask)
{