diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-02-28 04:47:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-02-28 04:47:02 +0400 |
commit | 3a99fa5d7fa11a047bc873d0ef1825a8f389c88d (patch) | |
tree | 430a92ff214debc80c34caf72e17d68480ebd2e9 /source/blender/blenlib/BLI_utildefines.h | |
parent | d3b945799176ad5b4c6739060a90bde810620feb (diff) |
Revert own changes to CLAMP and CLAMPIS, caused T38875
Diffstat (limited to 'source/blender/blenlib/BLI_utildefines.h')
-rw-r--r-- | source/blender/blenlib/BLI_utildefines.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index ef2c61cc45a..9f6eabf3a66 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -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), \ |