aboutsummaryrefslogtreecommitdiff
path: root/include/u.h
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2020-06-18 19:45:40 -0700
committerNicholas Noll <nbnoll@eml.cc>2020-06-18 19:45:40 -0700
commit425ef692da7e74112f88f0b368f3286dba84f846 (patch)
treed45729e90010e8d8c539031c3b72165f6884575d /include/u.h
parent0522b4bf4e125b7ceb67f7177db692aed3a0ebf9 (diff)
feat: working parser for rc shell language
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)))