aboutsummaryrefslogtreecommitdiff
path: root/include/u.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/u.h')
-rw-r--r--include/u.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/u.h b/include/u.h
index 617e41b..3cf3c7b 100644
--- a/include/u.h
+++ b/include/u.h
@@ -59,5 +59,6 @@ typedef int error;
#define arrlen(Array) (sizeof(Array) / sizeof((Array)[0]))
#define arrend(Array) ((Array) + arrlen(Array))
-#define MAX(x, y) ((x) >= (y) ? (x) : (y))
-#define MIN(x, y) ((x) < (y) ? (x) : (y))
+#define MAX(x, y) (((x) > (y)) ? (x) : (y))
+#define MIN(x, y) (((x) < (y)) ? (x) : (y))
+#define CLAMP(x, lo, hi) (((x) < (lo)) ? (lo) : (((x) > (hi)) ? (hi) : (x)))