aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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));