[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35647] branches/bmesh/blender/source/ blender: minor warning cleanup & use BLI_math functions a little differently.

Campbell Barton ideasman42 at gmail.com
Sun Mar 20 14:54:03 CET 2011


Revision: 35647
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35647
Author:   campbellbarton
Date:     2011-03-20 13:54:03 +0000 (Sun, 20 Mar 2011)
Log Message:
-----------
minor warning cleanup & use BLI_math functions a little differently.

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c
    branches/bmesh/blender/source/blender/editors/include/UI_interface.h

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c	2011-03-20 13:35:35 UTC (rev 35646)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c	2011-03-20 13:54:03 UTC (rev 35647)
@@ -91,9 +91,9 @@
 {
 
 	double u[3],  v[3], w[3];/*, *w, v1[3], v2[3];*/
-	double n[3] = {0.0, 0.0, 0.0}, l, v1[3], v2[3];
-	double l2;
-	int i, s=0;
+	double n[3] = {0.0, 0.0, 0.0}, l /*, v1[3], v2[3] */;
+	/* double l2; */
+	int i /*, s=0 */;
 
 	/*this fixes some weird numerical error*/
 	verts[0][0] += 0.0001f;
@@ -243,8 +243,7 @@
 		DO_MINMAX(l->v->co, min, max);
 	}
 
-	add_v3_v3v3(center, min, max);
-	mul_v3_fl(center, 0.5f);
+	mid_v3_v3v3(center, min, max);
 	
 	return 0;
 }
@@ -317,12 +316,12 @@
   the list that bridges a concave region of the face or intersects
   any of the faces's edges.
 */
+#if 0 /* needs BLI math double versions of these functions */
 static void shrink_edged(double *v1, double *v2, double fac)
 {
 	double mid[3];
 
-	add_v3_v3v3(mid, v1, v2);
-	mul_v3_fl(mid, 0.5);
+	mid_v3_v3v3(mid, v1, v2);
 
 	sub_v3_v3v3(v1, v1, mid);
 	sub_v3_v3v3(v2, v2, mid);
@@ -333,13 +332,13 @@
 	add_v3_v3v3(v1, v1, mid);
 	add_v3_v3v3(v2, v2, mid);
 }
+#endif
 
 static void shrink_edgef(float *v1, float *v2, float fac)
 {
 	float mid[3];
 
-	add_v3_v3v3(mid, v1, v2);
-	mul_v3_fl(mid, 0.5);
+	mid_v3_v3v3(mid, v1, v2);
 
 	sub_v3_v3v3(v1, v1, mid);
 	sub_v3_v3v3(v2, v2, mid);
@@ -367,10 +366,7 @@
 	double angle;
 	int i;
 
-	cross_v3_v3v3(axis, up, normal);
-	axis[0] *= -1;
-	axis[1] *= -1;
-	axis[2] *= -1;
+	cross_v3_v3v3(axis, normal, up);
 
 	angle = saacos(normal[0]*up[0]+normal[1]*up[1] + normal[2]*up[2]);
 
@@ -524,7 +520,7 @@
    note, there could be more winding cases then there needs to be. */
 int linecrossesf(float *v1, float *v2, float *v3, float *v4)
 {
-	int w1, w2, w3, w4, w5, ret;
+	int w1, w2, w3, w4, w5 /*, ret*/;
 	
 /*	   int test1_a, test1_a, test2_a, test2_a;
 
@@ -591,7 +587,7 @@
 }
 
 int goodline(float (*projectverts)[3], BMFace *f, int v1i,
-	     int v2i, int v3i, int nvert) {
+		 int v2i, int v3i, int UNUSED(nvert)) {
 	BMLoop *l = bm_firstfaceloop(f);
 	double v1[3], v2[3], v3[3], pv1[3], pv2[3];
 	int i;
@@ -630,13 +626,13 @@
  *
 */
 
-static BMLoop *find_ear(BMesh *bm, BMFace *f, float (*verts)[3], 
+static BMLoop *find_ear(BMesh *UNUSED(bm), BMFace *f, float (*verts)[3],
 			int nvert)
 {
 	BMVert *v1, *v2, *v3;
 	BMLoop *bestear = NULL, *l;
-	float angle, bestangle = 180.0f;
-	int isear, i=0;
+	/*float angle, bestangle = 180.0f;*/
+	int isear /*, i=0*/;
 	
 	l = bm_firstfaceloop(f);
 	do {
@@ -786,7 +782,7 @@
 {
 	BMIter iter;
 	BMLoop *l;
-	float v1[3], v2[3], v3[3], v4[3], no[3], mid[3], *p1, *p2, *p3, *p4;
+	float v1[3], v2[3], v3[3]/*, v4[3]*/, no[3], mid[3], *p1, *p2, *p3, *p4;
 	float out[3] = {-234324.0f, -234324.0f, 0.0f};
 	float projectverts[100][3];
 	float edgevertsstack[200][3];
@@ -845,8 +841,7 @@
 		VECCOPY(v2, edgeverts[i*2]);
 		VECCOPY(v3, edgeverts[i*2+1]);
 
-		add_v3_v3v3(mid, v2, v3);
-		mul_v3_fl(mid, 0.5f);
+		mid_v3_v3v3(mid, v2, v3);
 		
 		clen = 0;
 		for (j=0; j<f->len; j++) {

Modified: branches/bmesh/blender/source/blender/editors/include/UI_interface.h
===================================================================
--- branches/bmesh/blender/source/blender/editors/include/UI_interface.h	2011-03-20 13:35:35 UTC (rev 35646)
+++ branches/bmesh/blender/source/blender/editors/include/UI_interface.h	2011-03-20 13:54:03 UTC (rev 35647)
@@ -153,7 +153,6 @@
 #define UI_BUT_IMMEDIATE	(1<<27)
 #define UI_BUT_NO_TOOLTIP	(1<<28)
 #define UI_BUT_NO_UTF8		(1<<29)
-#define UI_BUT_NO_UTF8		(1<<28)
 
 #define UI_BUT_VEC_SIZE_LOCK (1<<30) /* used to flag if color hsv-circle should keep luminance */
 #define UI_BUT_COLOR_CUBIC	(1<<31) /* cubic saturation for the color wheel */




More information about the Bf-blender-cvs mailing list