From ad4c15b51d741d685ed13a5ec09f01aed08a8161 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 16 Oct 2023 14:01:47 -0500 Subject: clarify comparison precedence --- lily-test.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lily-test.h b/lily-test.h index 265c653..062631b 100644 --- a/lily-test.h +++ b/lily-test.h @@ -145,7 +145,7 @@ void lily_check(int x, const char *location, const char *fmt, ...); #define CHECK(x) LILY_CHECK(x) #define LILY_CHECK_CMP_(x, y, xstr, ystr, cmp, cmpstr, fmt) \ - lily_check(x cmp y, LILY_LOCATION, \ + lily_check((x) cmp (y), LILY_LOCATION, \ "CHECK failed: %s " cmpstr " %s\n %s = " fmt "\n %s = " fmt,\ xstr, ystr, xstr, x, ystr, y) #define LILY_CHECK_CMP(x, cmp, y, fmt) LILY_CHECK_CMP_(x, y, #x, #y, cmp, #cmp, fmt) @@ -178,7 +178,7 @@ void lily_require(int x, const char *location, const char *fmt, ...); #define REQUIRE(x) LILY_REQUIRE(x) #define LILY_REQUIRE_CMP_(x, y, xstr, ystr, cmp, cmpstr, fmt) \ - lily_require(x cmp y, LILY_LOCATION, \ + lily_require((x) cmp (y), LILY_LOCATION, \ "REQUIRE failed: %s " cmpstr " %s\n %s = " fmt "\n %s = " fmt,\ xstr, ystr, xstr, x, ystr, y) #define LILY_REQUIRE_CMP(x, cmp, y, fmt) LILY_REQUIRE_CMP_(x, y, #x, #y, cmp, #cmp, fmt) -- cgit v1.2.1