summaryrefslogtreecommitdiffstats
path: root/Macros.h
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2020-10-05 12:27:20 +0200
committercgzones <cgzones@googlemail.com>2020-10-05 12:47:56 +0200
commit49bb1b57f82a7ef2de5ed9a7d39caafb6c8328c9 (patch)
tree3b2e52068515f80bc7ac893c6e89a0686d13cd87 /Macros.h
parentff455b0004080a260a63f12ca8bf7c148eab6ee7 (diff)
Assert that low value is lower than the high value in CLAMP
Diffstat (limited to 'Macros.h')
-rw-r--r--Macros.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/Macros.h b/Macros.h
index de674eda..33e727d8 100644
--- a/Macros.h
+++ b/Macros.h
@@ -10,7 +10,7 @@
#endif
#ifndef CLAMP
-#define CLAMP(x, low, high) (((x) > (high)) ? (high) : MAXIMUM(x, low))
+#define CLAMP(x, low, high) (assert(low < high), ((x) > (high)) ? (high) : MAXIMUM(x, low))
#endif
#ifndef ARRAYSIZE

© 2014-2024 Faster IT GmbH | imprint | privacy policy