[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43564] branches/bmesh/blender/source/ blender: minor warning/fixes

Campbell Barton ideasman42 at gmail.com
Fri Jan 20 16:22:21 CET 2012


Revision: 43564
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43564
Author:   campbellbarton
Date:     2012-01-20 15:22:20 +0000 (Fri, 20 Jan 2012)
Log Message:
-----------
minor warning/fixes

Modified Paths:
--------------
    branches/bmesh/blender/source/blender/blenkernel/intern/modifiers_bmesh.c
    branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c
    branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c
    branches/bmesh/blender/source/blender/bmesh/operators/primitiveops.c
    branches/bmesh/blender/source/blender/editors/mesh/editbmesh_bvh.c

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/modifiers_bmesh.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/modifiers_bmesh.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/modifiers_bmesh.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -118,7 +118,6 @@
 	BMIter liter;
 	BLI_array_declare(verts);
 	BLI_array_declare(edges);
-	int numTex, numCol;
 	int i, j, k, totvert, totedge, totface;
 	
 	if (em) bm = em->bm;
@@ -132,10 +131,6 @@
 	CustomData_bmesh_merge(&dm->loopData, &bm->ldata, CD_MASK_DERIVEDMESH, CD_CALLOC, bm, BM_LOOP);
 	CustomData_bmesh_merge(&dm->polyData, &bm->pdata, CD_MASK_DERIVEDMESH, CD_CALLOC, bm, BM_FACE);
 
-	/*needed later*/
-	numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
-	numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
-
 	totvert = dm->getNumVerts(dm);
 	totedge = dm->getNumEdges(dm);
 	totface = dm->getNumPolys(dm);

Modified: branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
===================================================================
--- branches/bmesh/blender/source/blender/blenkernel/intern/multires.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/blenkernel/intern/multires.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -918,7 +918,7 @@
 
 void multires_set_space(DerivedMesh *dm, Object *ob, int from, int to)
 {
-	DerivedMesh *ccgdm, *subsurf=NULL;
+	DerivedMesh *ccgdm = NULL, *subsurf = NULL;
 	DMGridData **gridData, **subGridData=NULL;
 	MPoly *mpoly = CustomData_get_layer(&dm->polyData, CD_MPOLY);
 	MDisps *mdisps;
@@ -1031,9 +1031,11 @@
 		subsurf->needsFree = 1;
 		subsurf->release(subsurf);
 	}
-	
-	ccgdm->needsFree = 1;
-	ccgdm->release(ccgdm);
+
+	if (ccgdm) {
+		ccgdm->needsFree = 1;
+		ccgdm->release(ccgdm);
+	}
 }
 
 void multires_stitch_grids(Object *ob)

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_construct.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -472,7 +472,7 @@
 	BMFace *f, *f2, **ftable = NULL;
 	BMEditSelection *ese;
 	BMIter iter, liter;
-	int allocsize[4] = {512,512,2048,512}, numTex, numCol;
+	int allocsize[4] = {512,512,2048,512};
 	int i, j;
 
 	/*allocate a bmesh*/
@@ -488,10 +488,6 @@
 	CustomData_bmesh_init_pool(&bm->ldata, allocsize[2]);
 	CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]);
 
-	/*needed later*/
-	numTex = CustomData_number_of_layers(&bm->pdata, CD_MTEXPOLY);
-	numCol = CustomData_number_of_layers(&bm->ldata, CD_MLOOPCOL);
-
 	vtable= MEM_mallocN(sizeof(BMVert *) * bmold->totvert, "BM_Copy_Mesh vtable");
 	etable= MEM_mallocN(sizeof(BMEdge *) * bmold->totedge, "BM_Copy_Mesh etable");
 	ftable= MEM_mallocN(sizeof(BMFace *) * bmold->totface, "BM_Copy_Mesh ftable");

Modified: branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/bmesh/intern/bmesh_polygon.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -225,7 +225,8 @@
 	BMLoop *l;
 	BMIter iter;
 	float (*verts)[3];
-	float area, center[3];
+	float center[3];
+	float area = 0.0f;
 	int i;
 
 	BLI_array_fixedstack_declare(verts, BM_NGON_STACK_SIZE, f->len, __func__);

Modified: branches/bmesh/blender/source/blender/bmesh/operators/primitiveops.c
===================================================================
--- branches/bmesh/blender/source/blender/bmesh/operators/primitiveops.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/bmesh/operators/primitiveops.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -279,7 +279,7 @@
 void bmesh_create_uvsphere_exec(BMesh *bm, BMOperator *op)
 {
 	BMOperator bmop, prevop;
-	BMVert *eve, *preveve, *v1;
+	BMVert *eve, *preveve;
 	BMEdge *e;
 	BMIter iter;
 	float vec[3], mat[4][4], cmat[3][3], phi, q[4];
@@ -302,8 +302,7 @@
 		eve= BM_Make_Vert(bm, vec, NULL);
 		BMO_SetFlag(bm, eve, VERT_MARK);
 
-		if(a==0) v1= eve;
-		else {
+		if(a != 0) {
 			e = BM_Make_Edge(bm, preveve, eve, NULL, 0);
 			BMO_SetFlag(bm, e, EDGE_ORIG);
 		}

Modified: branches/bmesh/blender/source/blender/editors/mesh/editbmesh_bvh.c
===================================================================
--- branches/bmesh/blender/source/blender/editors/mesh/editbmesh_bvh.c	2012-01-20 15:18:57 UTC (rev 43563)
+++ branches/bmesh/blender/source/blender/editors/mesh/editbmesh_bvh.c	2012-01-20 15:22:20 UTC (rev 43564)
@@ -358,7 +358,8 @@
 	BMEdge *cure;
 } walklist;
 
-
+/* UNUSED */
+#if 0
 static short winding(float *v1, float *v2, float *v3)
 /* is v3 to the right of v1-v2 ? With exception: v3==v1 || v3==v2 */
 {
@@ -374,6 +375,7 @@
 	}
 	return 1;
 }
+#endif
 
 #if 0 //BMESH_TODO: not implemented yet
 int BMBVH_VertVisible(BMBVHTree *tree, BMEdge *e, RegionView3D *r3d)



More information about the Bf-blender-cvs mailing list