From db8d25f96f137c2ba170ea3caa9c2ad6a3dce40e Mon Sep 17 00:00:00 2001 From: Fabrice Date: Tue, 24 Mar 2026 08:30:26 +0100 Subject: fix macros --- cheesemap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheesemap.c b/cheesemap.c index ddc57e3..2b5d003 100644 --- a/cheesemap.c +++ b/cheesemap.c @@ -62,8 +62,8 @@ CM_ATTR(hot) static inline uintptr_t cm_bitmask_clz(bitmask_t mask) { #endif } -#define cm_max(x, y) x > y ? x : y -#define cm_ispow2(x) (((x) & ((x) - 1)) == 0) +#define cm_max(x, y) ((x) > (y) ? (x) : (y)) +#define cm_ispow2(x) ((x) != 0 && (((x) & ((x) - 1)) == 0)) static inline uintptr_t cm_align_up(uintptr_t value, uintptr_t alignment) { cm_assert(cm_ispow2(alignment)); -- cgit v1.2.3