From 4c4d5f33ee05f668e43b761b61327adc15ea268b Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 14 Jul 2025 14:10:22 +1000 Subject: [PATCH] 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: --- src/util-bits.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/util-bits.h b/src/util-bits.h index c0c39ce8..28b9ddcc 100644 --- a/src/util-bits.h +++ b/src/util-bits.h @@ -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) {