ref: 38d17b995db2828e331851a200418f569ecb5529
parent: 2a7d46b4a6533e403103a7d75eb3c7d6ff6f569c
author: rrt <rrt>
date: Sun Feb 4 18:46:05 EST 2007
Add range_limit macro here from vox.c.
--- a/src/st_i.h
+++ b/src/st_i.h
@@ -47,6 +47,8 @@
#endif
#define max(a, b) ((a) >= (b) ? (a) : (b))
+#define range_limit(x, lower, upper) (min(max(x, lower), upper))
+
/* Array-length operator */
#define array_length(a) (sizeof(a)/sizeof(a[0]))