diff options
author | sanine <sanine.not@pm.me> | 2023-10-16 14:01:47 -0500 |
---|---|---|
committer | sanine <sanine.not@pm.me> | 2023-10-16 14:01:47 -0500 |
commit | ad4c15b51d741d685ed13a5ec09f01aed08a8161 (patch) | |
tree | 88838e33d0e11d52938f404dfbfb5c5695851afd | |
parent | bd818ccf195d78b3a586449cf24c4f825b10ca8e (diff) |
clarify comparison precedence
-rw-r--r-- | lily-test.h | 4 |
1 files 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) |