quiet some warnings and fix build error with strict casting rules.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Mar 2012 12:51:17 +0000 (12:51 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Mar 2012 12:51:17 +0000 (12:51 +0000)
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/modifiers_bmesh.c
source/blender/bmesh/intern/bmesh_marking.c
source/blender/bmesh/operators/bmo_mesh_conv.c
source/blender/bmesh/operators/bmo_mirror.c
source/blender/modifiers/intern/MOD_build.c

index 2a3d718..e3fcd39 100644 (file)
@@ -1810,9 +1810,11 @@ void CustomData_copy_data(const CustomData *source, CustomData *dest,
                        dest_offset = dest_index * typeInfo->size;
                        
                        if (!src_data || !dest_data) {
-                               printf("%s: warning null data for %s type (%p --> %p), skipping\n",
-                                      __func__, layerType_getName(source->layers[src_i].type),
-                                      (void *)src_data, (void *)dest_data);
+                if (src_data != NULL && dest_data != NULL) {
+                    printf("%s: warning null data for %s type (%p --> %p), skipping\n",
+                           __func__, layerType_getName(source->layers[src_i].type),
+                           (void *)src_data, (void *)dest_data);
+                }
                                continue;
                        }
                        
index eca0c36..9cd21cf 100644 (file)
@@ -2597,7 +2597,7 @@ static void dag_id_flush_update(Scene *sce, ID *id)
                        MovieClip *clip = object_get_movieclip(sce, sce->camera, 1);
 
                        if(clip)
-                               dag_id_flush_update(sce, clip);
+                               dag_id_flush_update(sce, &clip->id);
                }
 
                /* update editors */
index da8af13..b8e4a7f 100644 (file)
@@ -45,7 +45,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
 {
        MVert *mv, *mvert;
        MEdge *me, *medge;
-       MPoly *mpoly, *mp;
+       MPoly /* *mpoly, */ /* UNUSED */ *mp;
        MLoop *mloop, *ml;
        BMVert *v, **vtable, **verts = NULL;
        BMEdge *e, **etable, **edges = NULL;
@@ -53,7 +53,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
        BMIter liter;
        BLI_array_declare(verts);
        BLI_array_declare(edges);
-       int i, j, k, totvert, totedge, totface;
+       int i, j, k, totvert, totedge /* , totface */ /* UNUSED */ ;
 
        /*merge custom data layout*/
        CustomData_bmesh_merge(&dm->vertData, &bm->vdata, CD_MASK_DERIVEDMESH, CD_CALLOC, bm, BM_VERT);
@@ -63,7 +63,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
 
        totvert = dm->getNumVerts(dm);
        totedge = dm->getNumEdges(dm);
-       totface = dm->getNumPolys(dm);
+       /* totface = dm->getNumPolys(dm); */ /* UNUSED */
 
        vtable = MEM_callocN(sizeof(void**) * totvert, "vert table in BMDM_Copy");
        etable = MEM_callocN(sizeof(void**) * totedge, "edge table in BMDM_Copy");
@@ -93,7 +93,7 @@ void DM_to_bmesh_ex(DerivedMesh *dm, BMesh *bm)
        MEM_freeN(medge);
 
        /*do faces*/
-       mpoly = mp = dm->getPolyArray(dm);
+       /* mpoly = mp = dm->getPolyArray(dm); */ /* UNUSED */
        mloop = dm->getLoopArray(dm);
        for (i = 0; i < dm->numPolyData; i++, mp++) {
                BMLoop *l;
index ab1b57a..7f22138 100644 (file)
@@ -312,7 +312,9 @@ void BM_edge_select_set(BMesh *bm, BMEdge *e, int select)
                                        }
                                }
 
-                               if (deselect) BM_vert_select_set(bm, verts[i], FALSE);
+                if (deselect) {
+                    BM_vert_select_set(bm, verts[i], FALSE);
+                }
                        }
                }
                else {
@@ -366,8 +368,7 @@ void BM_face_select_set(BMesh *bm, BMFace *f, int select)
                                        break;
                        }
 
-                       if (!f2)
-                       {
+                       if (!f2) {
                                BM_elem_select_set(bm, l->e, FALSE);
                        }
                }
index 63d8e3b..ac8f7fc 100644 (file)
@@ -151,7 +151,9 @@ void bmo_mesh_to_bmesh_exec(BMesh *bm, BMOperator *op)
                v->head.hflag = BM_vert_flag_from_mflag(mvert->flag);
 
                /* this is necessary for selection counts to work properl */
-               if (BM_elem_flag_test(v, BM_ELEM_SELECT)) BM_vert_select_set(bm, v, TRUE);
+        if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
+            BM_vert_select_set(bm, v, TRUE);
+        }
 
                normal_short_to_float_v3(v->no, mvert->no);
 
index 30704e1..c21e7a2 100644 (file)
@@ -47,12 +47,13 @@ void bmo_mirror_exec(BMesh *bm, BMOperator *op)
        float imtx[4][4];
        float scale[3] = {1.0f, 1.0f, 1.0f};
        float dist = BMO_slot_float_get(op, "mergedist");
-       int i, ototvert, ototedge, axis = BMO_slot_int_get(op, "axis");
+       int i, ototvert /*, ototedge */;
+    int axis = BMO_slot_int_get(op, "axis");
        int mirroru = BMO_slot_bool_get(op, "mirror_u");
        int mirrorv = BMO_slot_bool_get(op, "mirror_v");
 
        ototvert = bm->totvert;
-       ototedge = bm->totedge;
+       /* ototedge = bm->totedge; */ /* UNUSED */
        
        BMO_slot_mat4_get(op, "mat", mtx);
        invert_m4_m4(imtx, mtx);
index 2399f6e..b7f25f1 100644 (file)
@@ -88,7 +88,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
        int *vertMap, *edgeMap, *faceMap;
        float frac;
        MPoly *mpoly_dst;
-       MLoop *ml_dst, *ml_src, *mloop_dst;
+       MLoop *ml_dst, *ml_src /*, *mloop_dst */;
        GHashIterator *hashIter;
        /* maps vert indices in old mesh to indices in new mesh */
        GHash *vertHash = BLI_ghash_new(BLI_ghashutil_inthash,
@@ -261,7 +261,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
        }
 
        mpoly_dst = CDDM_get_polys(result);
-       mloop_dst = ml_dst = CDDM_get_loops(result);
+       /* mloop_dst = */ ml_dst = CDDM_get_loops(result);
        
        /* copy the faces across, remapping indices */
        k = 0;