aboutsummaryrefslogtreecommitdiffstats
path: root/cheesemap.c
diff options
context:
space:
mode:
authorFabrice <fabrice@schaub-dev.xyz>2026-03-24 08:30:26 +0100
committerFabrice <fabrice@schaub-dev.xyz>2026-03-24 08:30:26 +0100
commitdb8d25f96f137c2ba170ea3caa9c2ad6a3dce40e (patch)
treee5681104e074b859e2271e928e12da9734be40c5 /cheesemap.c
parent2d18af6411fddd3b13238cf5636cc37ae416980f (diff)
fix macros
Diffstat (limited to 'cheesemap.c')
-rw-r--r--cheesemap.c4
1 files 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));