diff options
-rw-r--r-- | common/util.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/common/util.h b/common/util.h index 4ca1c42929..392ced1ffe 100644 --- a/common/util.h +++ b/common/util.h @@ -41,10 +41,10 @@ #undef MAX #endif -template<typename T> inline T ABS (T x) { return (x>=0) ? x : -x; } -template<typename T> inline T MIN (T a, T b) { return (a<b) ? a : b; } -template<typename T> inline T MAX (T a, T b) { return (a>b) ? a : b; } -template<typename T> inline T CLIP (T v, T amin, T amax) +template<typename T> inline T ABS(T x) { return (x >= 0) ? x : -x; } +template<typename T> inline T MIN(T a, T b) { return (a < b) ? a : b; } +template<typename T> inline T MAX(T a, T b) { return (a > b) ? a : b; } +template<typename T> inline T CLIP(T v, T amin, T amax) { if (v < amin) return amin; else if (v > amax) return amax; else return v; } /** |