Revert own changes to CLAMP and CLAMPIS, caused T38875

This commit is contained in:
Campbell Barton
2014-02-28 11:47:02 +11:00
parent d3b9457991
commit 3a99fa5d7f

View File

@@ -256,27 +256,19 @@
/* some misc stuff.... */
/* avoid multiple access & type conversions for supported compilers */
/* avoid multiple access for supported compilers */
#if defined(__GNUC__) || defined(__clang__)
#define ABS(a) ({ \
typeof(a) a_ = (a); \
((a_) < 0 ? (-(a_)) : (a_)); })
#define CLAMPIS(a, b, c) ({ \
typeof(a) a_ = (a), b_ = (b), c_ = (c); \
((a_) < (b_) ? (b_) : (a_) > (c_) ? (c_) : (a_)); })
#define CLAMP(a, b, c) { \
typeof(a) b_ = (b), c_ = (c); \
if ((a) < (b_)) (a) = (b_); \
else if ((a) > (c_)) (a) = (c_); \
} (void)0
#else
#define ABS(a) ((a) < 0 ? (-(a)) : (a))
#endif
#define CLAMPIS(a, b, c) ((a) < (b) ? (b) : (a) > (c) ? (c) : (a))
#define CLAMP(a, b, c) { \
@@ -284,8 +276,6 @@
else if ((a) > (c)) (a) = (c); \
} (void)0
#endif
#define IS_EQ(a, b) ( \
CHECK_TYPE_INLINE(a, double), CHECK_TYPE_INLINE(b, double), \