[Bf-blender-cvs] [a6e8137] master: Convenience macro for print_ funcs, saves passing id each time

Campbell Barton noreply at git.blender.org
Sun Mar 30 06:04:55 CEST 2014


Commit: a6e8137983d74ebff785ee134f635e1a08f58237
Author: Campbell Barton
Date:   Sun Mar 30 13:03:30 2014 +1100
https://developer.blender.org/rBa6e8137983d74ebff785ee134f635e1a08f58237

Convenience macro for print_ funcs, saves passing id each time

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

M	source/blender/blenlib/BLI_math_matrix.h
M	source/blender/blenlib/BLI_math_rotation.h
M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/blenlib/BLI_rect.h

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

diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index e59c557..e3d9e40 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -215,6 +215,9 @@ bool is_zero_m4(float mat[4][4]);
 void print_m3(const char *str, float M[3][3]);
 void print_m4(const char *str, float M[3][4]);
 
+#define print_m3_id(M) print_m3(STRINGIFY(M), M)
+#define print_m4_id(M) print_m4(STRINGIFY(M), M)
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenlib/BLI_math_rotation.h b/source/blender/blenlib/BLI_math_rotation.h
index 477b328..eb45798 100644
--- a/source/blender/blenlib/BLI_math_rotation.h
+++ b/source/blender/blenlib/BLI_math_rotation.h
@@ -97,6 +97,8 @@ void mat3_to_quat_is_ok(float q[4], float mat[3][3]);
 /* other */
 void print_qt(const char *str, const float q[4]);
 
+#define print_qt_id(q) print_qt(STRINGIFY(q), q)
+
 /******************************** Axis Angle *********************************/
 
 /* conversion */
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index 9b73ca5..e6e46a4 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -266,6 +266,11 @@ void print_v3(const char *str, const float a[3]);
 void print_v4(const char *str, const float a[4]);
 void print_vn(const char *str, const float v[], const int n);
 
+#define print_v2_id(v) print_v2(STRINGIFY(v), v)
+#define print_v3_id(v) print_v3(STRINGIFY(v), v)
+#define print_v4_id(v) print_v4(STRINGIFY(v), v)
+#define print_vn_id(v, n) print_vn(STRINGIFY(v), v, n)
+
 MINLINE void normal_short_to_float_v3(float r[3], const short n[3]);
 MINLINE void normal_float_to_short_v3(short r[3], const float n[3]);
 
diff --git a/source/blender/blenlib/BLI_rect.h b/source/blender/blenlib/BLI_rect.h
index b86a5bc..a132ac4 100644
--- a/source/blender/blenlib/BLI_rect.h
+++ b/source/blender/blenlib/BLI_rect.h
@@ -92,6 +92,9 @@ void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
 void print_rctf(const char *str, const struct rctf *rect);
 void print_rcti(const char *str, const struct rcti *rect);
 
+#define print_rctf_id(rect) print_rctf(STRINGIFY(rect), rect)
+#define print_rcti_id(rect) print_rcti(STRINGIFY(rect), rect)
+
 BLI_INLINE float BLI_rcti_cent_x_fl(const struct rcti *rct) { return (float)(rct->xmin + rct->xmax) / 2.0f; }
 BLI_INLINE float BLI_rcti_cent_y_fl(const struct rcti *rct) { return (float)(rct->ymin + rct->ymax) / 2.0f; }
 BLI_INLINE int   BLI_rcti_cent_x(const struct rcti *rct) { return (rct->xmin + rct->xmax) / 2; }




More information about the Bf-blender-cvs mailing list