[Bf-blender-cvs] [504370c] master: Code cleanup: Fix silly duplication of typecheck and swap macro
Sergey Sharybin
noreply at git.blender.org
Fri Oct 10 17:13:29 CEST 2014
Commit: 504370cafb1aaa36284688867fcaf7b29eb76848
Author: Sergey Sharybin
Date: Fri Oct 10 21:12:08 2014 +0600
Branches: master
https://developer.blender.org/rB504370cafb1aaa36284688867fcaf7b29eb76848
Code cleanup: Fix silly duplication of typecheck and swap macro
===================================================================
M source/blender/blenlib/BLI_math_base.h
===================================================================
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h
index 494bc40..07de074 100644
--- a/source/blender/blenlib/BLI_math_base.h
+++ b/source/blender/blenlib/BLI_math_base.h
@@ -146,32 +146,6 @@ static const int NAN_INT = 0x7FC00000;
# endif
#endif
-/* Causes warning:
- * incompatible types when assigning to type 'Foo' from type 'Bar'
- * ... the compiler optimizes away the temp var */
-#ifndef CHECK_TYPE
-#ifdef __GNUC__
-#define CHECK_TYPE(var, type) { \
- typeof(var) *__tmp; \
- __tmp = (type *)NULL; \
- (void)__tmp; \
-} (void)0
-#else
-#define CHECK_TYPE(var, type)
-#endif
-#endif
-
-#ifndef SWAP
-# define SWAP(type, a, b) { \
- type sw_ap; \
- CHECK_TYPE(a, type); \
- CHECK_TYPE(b, type); \
- sw_ap = (a); \
- (a) = (b); \
- (b) = sw_ap; \
-} (void)0
-#endif
-
#if BLI_MATH_DO_INLINE
#include "intern/math_base_inline.c"
#endif
More information about the Bf-blender-cvs
mailing list