Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-02-28 04:47:02 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-02-28 04:47:02 +0400
commit3a99fa5d7fa11a047bc873d0ef1825a8f389c88d (patch)
tree430a92ff214debc80c34caf72e17d68480ebd2e9 /source
parentd3b945799176ad5b4c6739060a90bde810620feb (diff)
Revert own changes to CLAMP and CLAMPIS, caused T38875
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/BLI_utildefines.h16
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), \