minor warning/fixes
authorCampbell Barton <ideasman42@gmail.com>
Fri, 20 Jan 2012 15:22:20 +0000 (15:22 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 20 Jan 2012 15:22:20 +0000 (15:22 +0000)
source/blender/blenkernel/intern/modifiers_bmesh.c
source/blender/blenkernel/intern/multires.c
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/intern/bmesh_polygon.c
source/blender/bmesh/operators/primitiveops.c
source/blender/editors/mesh/editbmesh_bvh.c

index 2f011c66a9f5f06a34018be4d710d5dbe77e3de2..cf6d7b87fe356a45aeafc83aed3501ca198b80b9 100644 (file)
@@ -118,7 +118,6 @@ BMEditMesh *CDDM_To_BMesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing)
        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 @@ BMEditMesh *CDDM_To_BMesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing)
        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);
index 5c13c2c52fe5fd6bbc030b201b3a902aa30d476d..ba32e1ddac00b3f3258218f8937f9995713e4dec 100644 (file)
@@ -918,7 +918,7 @@ static void multiresModifier_update(DerivedMesh *dm)
 
 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 @@ cleanup:
                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)
index 3488472c0109d61a1e985ca4edc6b8c6e63fec0f..2000394202383fc0a8bd018f8f47546421aad3b2 100644 (file)
@@ -472,7 +472,7 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
        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 @@ BMesh *BM_Copy_Mesh(BMesh *bmold)
        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");
index 663a1ae81f25ebf21add5f1fa7c4c8bf40d932e8..4d2dd58c23c327ac130587edffdbeaa28a984770 100644 (file)
@@ -225,7 +225,8 @@ float BM_Compute_Face_Area(BMesh *bm, BMFace *f)
        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__);
index d177d430add5ef5a7cbf1d2314306bb246155584..d78e0e1c18a22340234abd0065fbf27d172f5a5b 100644 (file)
@@ -279,7 +279,7 @@ void bmesh_create_grid_exec(BMesh *bm, BMOperator *op)
 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 @@ void bmesh_create_uvsphere_exec(BMesh *bm, BMOperator *op)
                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);
                }
index d5fab72c24c73fb79119533539c5792a75c43507..e7eef548d3ca81157b59a6978072c76210d78e4f 100644 (file)
@@ -358,7 +358,8 @@ typedef struct walklist {
        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 @@ static short winding(float *v1, float *v2, float *v3)
        }
        return 1;
 }
+#endif
 
 #if 0 //BMESH_TODO: not implemented yet
 int BMBVH_VertVisible(BMBVHTree *tree, BMEdge *e, RegionView3D *r3d)