From 49bb1b57f82a7ef2de5ed9a7d39caafb6c8328c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 5 Oct 2020 12:27:20 +0200 Subject: Assert that low value is lower than the high value in CLAMP --- Macros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Macros.h') 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 -- cgit v1.2.3