Assert that low value is lower than the high value in CLAMP

This commit is contained in:
Christian Göttsche 2020-10-05 12:27:20 +02:00 committed by cgzones
parent ff455b0004
commit 49bb1b57f8
1 changed files with 1 additions and 1 deletions

View File

@ -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