[Bf-blender-cvs] [3a99fa5] master: Revert own changes to CLAMP and CLAMPIS, caused T38875

Campbell Barton noreply at git.blender.org
Fri Feb 28 01:48:43 CET 2014


Commit: 3a99fa5d7fa11a047bc873d0ef1825a8f389c88d
Author: Campbell Barton
Date:   Fri Feb 28 11:47:02 2014 +1100
https://developer.blender.org/rB3a99fa5d7fa11a047bc873d0ef1825a8f389c88d

Revert own changes to CLAMP and CLAMPIS, caused T38875

===================================================================

M	source/blender/blenlib/BLI_utildefines.h

===================================================================

diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index ef2c61c..9f6eabf 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), \




More information about the Bf-blender-cvs mailing list