[Bf-blender-cvs] [a90e49e] master: Tweaks to macros

Campbell Barton noreply at git.blender.org
Mon Aug 4 03:43:48 CEST 2014


Commit: a90e49e40a44f606c08dfc460f4e0243702c1bdf
Author: Campbell Barton
Date:   Mon Aug 4 11:43:10 2014 +1000
Branches: master
https://developer.blender.org/rBa90e49e40a44f606c08dfc460f4e0243702c1bdf

Tweaks to macros

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

M	source/blender/blenkernel/BKE_idprop.h
M	source/blender/blenlib/BLI_utildefines.h
M	source/blender/editors/include/BIF_gl.h
M	source/blender/makesrna/intern/rna_internal.h

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

diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index 0f3f4ef..0230eaf 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -124,16 +124,16 @@ void IDP_UnlinkProperty(struct IDProperty *prop);
 #define IDP_Array(prop)                   ((prop)->data.pointer)
 /* C11 const correctness for casts */
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
-#  define IDP_Float(prop)  _Generic(prop, \
+#  define IDP_Float(prop)  _Generic((prop), \
 	IDProperty *:             (*(float *)&(prop)->data.val), \
 	const IDProperty *: (*(const float *)&(prop)->data.val))
-#  define IDP_Double(prop)  _Generic(prop, \
+#  define IDP_Double(prop)  _Generic((prop), \
 	IDProperty *:             (*(double *)&(prop)->data.val), \
 	const IDProperty *: (*(const double *)&(prop)->data.val))
-#  define IDP_String(prop)  _Generic(prop, \
+#  define IDP_String(prop)  _Generic((prop), \
 	IDProperty *:             ((char *) (prop)->data.pointer), \
 	const IDProperty *: ((const char *) (prop)->data.pointer))
-#  define IDP_IDPArray(prop)  _Generic(prop, \
+#  define IDP_IDPArray(prop)  _Generic((prop), \
 	IDProperty *:             ((IDProperty *) (prop)->data.pointer), \
 	const IDProperty *: ((const IDProperty *) (prop)->data.pointer))
 #else
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 1f34156..6a9eb64 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -49,7 +49,7 @@
 	_17_, _18_, _19_, _20_, _21_, _22_, _23_, _24_, _25_, _26_, _27_, _28_, _29_, _30_, _31_, _32_, \
 	count, ...) count
 #define _VA_NARGS_EXPAND(args) _VA_NARGS_RETURN_COUNT args
-#define _VA_NARGS_COUNT_MAX16(...) _VA_NARGS_EXPAND((__VA_ARGS__, \
+#define _VA_NARGS_COUNT_MAX32(...) _VA_NARGS_EXPAND((__VA_ARGS__, \
 	32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, \
 	15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
 #define _VA_NARGS_OVERLOAD_MACRO2(name, count) name##count
@@ -57,7 +57,7 @@
 #define _VA_NARGS_OVERLOAD_MACRO(name,  count) _VA_NARGS_OVERLOAD_MACRO1(name, count)
 /* --- expose for re-use --- */
 #define VA_NARGS_CALL_OVERLOAD(name, ...) \
-	_VA_NARGS_GLUE(_VA_NARGS_OVERLOAD_MACRO(name, _VA_NARGS_COUNT_MAX16(__VA_ARGS__)), (__VA_ARGS__))
+	_VA_NARGS_GLUE(_VA_NARGS_OVERLOAD_MACRO(name, _VA_NARGS_COUNT_MAX32(__VA_ARGS__)), (__VA_ARGS__))
 
 /* useful for finding bad use of min/max */
 #if 0
@@ -156,7 +156,7 @@
  * ... the compiler optimizes away the temp var */
 #ifdef __GNUC__
 #define CHECK_TYPE(var, type)  {  \
-	typeof(var) *__tmp;         \
+	typeof(var) *__tmp;           \
 	__tmp = (type *)NULL;         \
 	(void)__tmp;                  \
 } (void)0
diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h
index 4258bbc..9fa6039 100644
--- a/source/blender/editors/include/BIF_gl.h
+++ b/source/blender/editors/include/BIF_gl.h
@@ -61,14 +61,14 @@ void cpack(unsigned int x);
 
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
 #  define glMultMatrixf(x)  \
-	glMultMatrixf(_Generic(x, \
+	glMultMatrixf(_Generic((x), \
 	        float *:      (float *)(x), \
 	        float (*)[4]: (float *)(x), \
 	        const float *:      (float *)(x), \
 	        const float (*)[4]: (float *)(x)) \
 )
 #  define glLoadMatrixf(x)  \
-	glLoadMatrixf(_Generic(x, \
+	glLoadMatrixf(_Generic((x), \
 	        float *:      (float *)(x), \
 	        float (*)[4]: (float *)(x)) \
 )
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h
index 8ec6999..83b7a81 100644
--- a/source/blender/makesrna/intern/rna_internal.h
+++ b/source/blender/makesrna/intern/rna_internal.h
@@ -417,7 +417,7 @@ void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
 #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
 #  define USE_RNA_RANGE_CHECK
 #  define TYPEOF_MAX(x) \
-	_Generic(x, \
+	_Generic((x), \
 		bool: 1, \
 		char: CHAR_MAX, signed char: SCHAR_MAX, unsigned char: UCHAR_MAX, \
 		signed short: SHRT_MAX, unsigned short: USHRT_MAX, \
@@ -425,7 +425,7 @@ void rna_RenderPass_rect_set(PointerRNA *ptr, const float *values);
 		float: FLT_MAX, double: DBL_MAX)
 
 #  define TYPEOF_MIN(x) \
-	_Generic(x, \
+	_Generic((x), \
 		bool: 0, \
 		char: CHAR_MIN, signed char: SCHAR_MIN, unsigned char: 0, \
 		signed short: SHRT_MIN, unsigned short: 0, \




More information about the Bf-blender-cvs mailing list