[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58806] trunk/blender/source/blender: code cleanup: remove unused functions

Campbell Barton ideasman42 at gmail.com
Thu Aug 1 19:15:11 CEST 2013


Revision: 58806
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58806
Author:   campbellbarton
Date:     2013-08-01 17:15:11 +0000 (Thu, 01 Aug 2013)
Log Message:
-----------
code cleanup: remove unused functions
- IsectLLPt2Df
- isect_point_quad_uv_v2
- isect_point_face_uv_v2

These are obsoleted by resolve_tri_uv, resolve_quad_uv

also add attributes for unused function results for some math functions.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_math_geom.h
    trunk/blender/source/blender/blenlib/BLI_math_vector.h
    trunk/blender/source/blender/blenlib/intern/math_geom.c
    trunk/blender/source/blender/modifiers/intern/MOD_skin.c

Modified: trunk/blender/source/blender/blenlib/BLI_math_geom.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_geom.h	2013-08-01 17:14:20 UTC (rev 58805)
+++ trunk/blender/source/blender/blenlib/BLI_math_geom.h	2013-08-01 17:15:11 UTC (rev 58806)
@@ -147,10 +147,6 @@
 int isect_point_tri_v2_cw(const float pt[2], const float v1[2], const float v2[2], const float v3[2]);
 int isect_point_tri_v2_int(const int x1, const int y1, const int x2, const int y2, const int a, const int b);
 bool isect_point_tri_prism_v3(const float p[3], const float v1[3], const float v2[3], const float v3[3]);
-void isect_point_quad_uv_v2(const float v0[2], const float v1[2], const float v2[2], const float v3[2],
-                            const float pt[2], float r_uv[2]);
-void isect_point_face_uv_v2(const int isquad, const float v0[2], const float v1[2], const float v2[2],
-                            const float v3[2], const float pt[2], float r_uv[2]);
 
 /* axis-aligned bounding box */
 bool isect_aabb_aabb_v3(const float min1[3], const float max1[3], const float min2[3], const float max2[3]);
@@ -198,7 +194,7 @@
 void barycentric_weights_v2_quad(const float v1[2], const float v2[2], const float v3[2], const float v4[2],
                                  const float co[2], float w[4]);
 
-int barycentric_coords_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3]);
+bool barycentric_coords_v2(const float v1[2], const float v2[2], const float v3[2], const float co[2], float w[3]);
 int barycentric_inside_triangle_v2(const float w[3]);
 
 void resolve_tri_uv(float r_uv[2], const float st[2], const float st0[2], const float st1[2], const float st2[2]);
@@ -273,9 +269,9 @@
 
 float form_factor_quad(const float p[3], const float n[3],
                        const float q0[3], const float q1[3], const float q2[3], const float q3[3]);
-int form_factor_visible_quad(const float p[3], const float n[3],
-                             const float v0[3], const float v1[3], const float v2[3],
-                             float q0[3], float q1[3], float q2[3], float q3[3]);
+bool form_factor_visible_quad(const float p[3], const float n[3],
+                              const float v0[3], const float v1[3], const float v2[3],
+                              float q0[3], float q1[3], float q2[3], float q3[3]);
 float form_factor_hemi_poly(float p[3], float n[3],
                             float v1[3], float v2[3], float v3[3], float v4[3]);
 

Modified: trunk/blender/source/blender/blenlib/BLI_math_vector.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-08-01 17:14:20 UTC (rev 58805)
+++ trunk/blender/source/blender/blenlib/BLI_math_vector.h	2013-08-01 17:15:11 UTC (rev 58806)
@@ -47,6 +47,12 @@
 #  pragma GCC diagnostic ignored "-Wredundant-decls"
 #endif
 
+#ifdef __GNUC__
+#  define UNUSED_RESULT_ATTR __attribute__((warn_unused_result))
+#else
+#  define UNUSED_RESULT_ATTR
+#endif
+
 MINLINE void zero_v2(float r[2]);
 MINLINE void zero_v3(float r[3]);
 MINLINE void zero_v4(float r[4]);
@@ -115,10 +121,10 @@
 MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]);
 MINLINE void mul_v4_fl(float r[4], float f);
 MINLINE void mul_v4_v4fl(float r[3], const float a[3], float f);
-MINLINE float mul_project_m4_v3_zfac(float mat[4][4], const float co[3]);
-MINLINE float dot_m3_v3_row_x(float M[3][3], const float a[3]);
-MINLINE float dot_m3_v3_row_y(float M[3][3], const float a[3]);
-MINLINE float dot_m3_v3_row_z(float M[3][3], const float a[3]);
+MINLINE float mul_project_m4_v3_zfac(float mat[4][4], const float co[3])  UNUSED_RESULT_ATTR;
+MINLINE float dot_m3_v3_row_x(float M[3][3], const float a[3])  UNUSED_RESULT_ATTR;
+MINLINE float dot_m3_v3_row_y(float M[3][3], const float a[3])  UNUSED_RESULT_ATTR;
+MINLINE float dot_m3_v3_row_z(float M[3][3], const float a[3])  UNUSED_RESULT_ATTR;
 
 MINLINE void madd_v3_v3fl(float r[3], const float a[3], float f);
 MINLINE void madd_v3_v3v3(float r[3], const float a[3], const float b[3]);
@@ -137,10 +143,10 @@
 
 MINLINE void negate_v3_short(short r[3]);
 
-MINLINE float dot_v2v2(const float a[2], const float b[2]);
-MINLINE float dot_v3v3(const float a[3], const float b[3]);
+MINLINE float dot_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+MINLINE float dot_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
 
-MINLINE float cross_v2v2(const float a[2], const float b[2]);
+MINLINE float cross_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
 MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3]);
 
 MINLINE void add_newell_cross_v3_v3v3(float n[3], const float v_prev[3], const float v_curr[3]);
@@ -149,20 +155,20 @@
 
 /*********************************** Length **********************************/
 
-MINLINE float len_squared_v2(const float v[2]);
-MINLINE float len_squared_v3(const float v[3]);
-MINLINE float len_manhattan_v2(const float v[2]);
-MINLINE int   len_manhattan_v2_int(const int v[2]);
-MINLINE float len_manhattan_v3(const float v[3]);
-MINLINE float len_v2(const float a[2]);
-MINLINE float len_v2v2(const float a[2], const float b[2]);
-MINLINE float len_squared_v2v2(const float a[2], const float b[2]);
-MINLINE float len_squared_v3v3(const float a[3], const float b[3]);
-MINLINE float len_manhattan_v2v2(const float a[2], const float b[2]);
-MINLINE int   len_manhattan_v2v2_int(const int a[2], const int b[2]);
-MINLINE float len_manhattan_v3v3(const float a[3], const float b[3]);
-MINLINE float len_v3(const float a[3]);
-MINLINE float len_v3v3(const float a[3], const float b[3]);
+MINLINE float len_squared_v2(const float v[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_squared_v3(const float v[3])  UNUSED_RESULT_ATTR;
+MINLINE float len_manhattan_v2(const float v[2])  UNUSED_RESULT_ATTR;
+MINLINE int   len_manhattan_v2_int(const int v[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_manhattan_v3(const float v[3])  UNUSED_RESULT_ATTR;
+MINLINE float len_v2(const float a[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_squared_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_squared_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
+MINLINE float len_manhattan_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+MINLINE int   len_manhattan_v2v2_int(const int a[2], const int b[2])  UNUSED_RESULT_ATTR;
+MINLINE float len_manhattan_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
+MINLINE float len_v3(const float a[3])  UNUSED_RESULT_ATTR;
+MINLINE float len_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
 
 MINLINE float normalize_v2(float r[2]);
 MINLINE float normalize_v2_v2(float r[2], const float a[2]);
@@ -194,35 +200,35 @@
 
 /********************************* Comparison ********************************/
 
-MINLINE int is_zero_v3(const float a[3]);
-MINLINE int is_zero_v4(const float a[4]);
-MINLINE int is_one_v3(const float a[3]);
+MINLINE int is_zero_v3(const float a[3])  UNUSED_RESULT_ATTR;
+MINLINE int is_zero_v4(const float a[4])  UNUSED_RESULT_ATTR;
+MINLINE int is_one_v3(const float a[3])  UNUSED_RESULT_ATTR;
 
-MINLINE int equals_v2v2(const float v1[2], const float v2[2]);
-MINLINE int equals_v3v3(const float a[3], const float b[3]);
-MINLINE int compare_v2v2(const float a[2], const float b[2], const float limit);
-MINLINE int compare_v3v3(const float a[3], const float b[3], const float limit);
-MINLINE int compare_len_v3v3(const float a[3], const float b[3], const float limit);
+MINLINE int equals_v2v2(const float v1[2], const float v2[2])  UNUSED_RESULT_ATTR;
+MINLINE int equals_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
+MINLINE int compare_v2v2(const float a[2], const float b[2], const float limit)  UNUSED_RESULT_ATTR;
+MINLINE int compare_v3v3(const float a[3], const float b[3], const float limit)  UNUSED_RESULT_ATTR;
+MINLINE int compare_len_v3v3(const float a[3], const float b[3], const float limit)  UNUSED_RESULT_ATTR;
 
-MINLINE int compare_v4v4(const float a[4], const float b[4], const float limit);
-MINLINE int equals_v4v4(const float a[4], const float b[4]);
+MINLINE int compare_v4v4(const float a[4], const float b[4], const float limit)  UNUSED_RESULT_ATTR;
+MINLINE int equals_v4v4(const float a[4], const float b[4])  UNUSED_RESULT_ATTR;
 
-MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2]);
+MINLINE float line_point_side_v2(const float l1[2], const float l2[2], const float pt[2])  UNUSED_RESULT_ATTR;
 
 /********************************** Angles ***********************************/
 /* - angle with 2 arguments is angle between vector                          */
 /* - angle with 3 arguments is angle between 3 points at the middle point    */
 /* - angle_normalized_* is faster equivalent if vectors are normalized       */
 
-float angle_v2v2(const float a[2], const float b[2]);
-float angle_signed_v2v2(const float v1[2], const float v2[2]);
-float angle_v2v2v2(const float a[2], const float b[2], const float c[2]);
-float angle_normalized_v2v2(const float a[2], const float b[2]);
-float angle_v3v3(const float a[3], const float b[3]);
-float angle_v3v3v3(const float a[3], const float b[3], const float c[3]);
-float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3]);
-float angle_normalized_v3v3(const float v1[3], const float v2[3]);
-float angle_on_axis_v3v3v3_v3(const float v1[3], const float v2[3], const float v3[3], const float axis[3]);
+float angle_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+float angle_signed_v2v2(const float v1[2], const float v2[2])  UNUSED_RESULT_ATTR;
+float angle_v2v2v2(const float a[2], const float b[2], const float c[2])  UNUSED_RESULT_ATTR;
+float angle_normalized_v2v2(const float a[2], const float b[2])  UNUSED_RESULT_ATTR;
+float angle_v3v3(const float a[3], const float b[3])  UNUSED_RESULT_ATTR;
+float angle_v3v3v3(const float a[3], const float b[3], const float c[3])  UNUSED_RESULT_ATTR;
+float cos_v3v3v3(const float p1[3], const float p2[3], const float p3[3])  UNUSED_RESULT_ATTR;

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list