fixed 4 uses of un-inirialized vars + some compiler warnings.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 10 May 2011 23:48:09 +0000 (23:48 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 10 May 2011 23:48:09 +0000 (23:48 +0000)
13 files changed:
source/blender/blenkernel/intern/customdata.c
source/blender/blenkernel/intern/editderivedbmesh.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/bmesh/intern/bmesh_interp.c
source/blender/bmesh/intern/bmesh_mods.c
source/blender/bmesh/operators/connectops.c
source/blender/editors/armature/reeb.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/bmesh_select.c
source/blender/editors/mesh/loopcut.c
source/blender/editors/mesh/mesh_data.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/space_view3d/drawobject.c

index 95b5fd9ec019fde13b073038fbf412496dfabbe2..a84552fb7c576d88c47e3ec46903b21b101e6e10 100644 (file)
@@ -2215,6 +2215,9 @@ void CustomData_bmesh_merge(CustomData *source, CustomData *dest,
                        t = BM_LOOPS_OF_FACE; break;
                case BM_FACE:
                        t = BM_FACES_OF_MESH; break;
+               default: /* should never happen */
+                       BLI_assert(!"invalid type given");
+                       t = BM_VERTS_OF_MESH;
        }
 
        if (t != BM_LOOPS_OF_FACE) {
index e1598b8fad3fc630e5031c8dd1fea662d896565a..52c9cc4d3796c90c15f098774523fc9bd19d11a5 100644 (file)
@@ -236,7 +236,7 @@ static void BMEdit_RecalcTesselation_intern(BMEditMesh *tm)
        }
 
        tm->tottri = i;
-       tm->looptris = looptris;
+       tm->looptris = (BMLoop *(*)[3])looptris;
 }
 
 void BMEdit_RecalcTesselation(BMEditMesh *tm)
@@ -1534,7 +1534,8 @@ static void bmDM_getVertCos(DerivedMesh *dm, float (*cos_r)[3])
        BMVert *eve;
        BMIter iter;
        int i;
-       
+
+       i= 0;
        BM_ITER(eve, &iter, emdm->tc->bm, BM_VERTS_OF_MESH, NULL) {
                if (emdm->vertexCos) {
                        copy_v3_v3(cos_r[i], emdm->vertexCos[i]);
index a0d14c144414bd166615d266664bea0292aee0cf..6c6c0d53880a7dccd718be186a19d189bde077cb 100644 (file)
@@ -1165,8 +1165,8 @@ DMFaceIter *cgdm_newFaceIter(DerivedMesh *dm)
        MEdge medge;
        int i, totedge = cgdm_getNumEdges(dm);
 
-       fiter->cgdm = dm;
-       fiter->liter.cgdm = dm;
+       fiter->cgdm = (CCGDerivedMesh *)dm;
+       fiter->liter.cgdm = (CCGDerivedMesh *)dm;
        fiter->mface = fiter->mf = dm->dupTessFaceArray(dm);
        fiter->mf--;
 
@@ -3113,7 +3113,7 @@ struct DerivedMesh *subsurf_make_derived_from_derived(
                }
        }
        
-       return result;
+       return (DerivedMesh *)result;
 }
 
 void subsurf_calculate_limit_positions(Mesh *me, float (*positions_r)[3]) 
index 5e18ca1fec995310bb3efe407b85e0c9bafaf7dd..d0308c078e3d5d8f578c227d0af6e1eeb56e2cc1 100644 (file)
@@ -402,17 +402,24 @@ static int compute_mdisp_quad(BMLoop *l, double v1[3], double v2[3], double v3[3
 }
 
 /*funnily enough, I think this is identical to face_to_crn_interp, heh*/
-double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1, int a2)
+static double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1, int a2)
 {
-       double x, y, z, c, f1, f2;
+       double x, y, z, f1;
        
        x = aa[a1]*cc[a2]-cc[a1]*aa[a2];
        y = aa[a1]*dd[a2]+bb[a1]*cc[a2]-cc[a1]*bb[a2]-dd[a1]*aa[a2];
        z = bb[a1]*dd[a2]-dd[a1]*bb[a2];
        
        if (fabs(2*(x-y+z)) > DBL_EPSILON*10.0) {
+               double f2;
+
                f1 = (sqrt(y*y-4.0*x*z) - y + 2.0*z) / (2.0*(x-y+z));
                f2 = (-sqrt(y*y-4.0*x*z) - y + 2.0*z) / (2.0*(x-y+z));
+
+               f1= fabs(f1);
+               f2= fabs(f2);
+               f1 = MIN2(f1, f2);
+               CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
        } else {
                f1 = -z/(y - 2*z);
                CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
@@ -427,12 +434,8 @@ double quad_coord(double aa[3], double bb[3], double cc[3], double dd[3], int a1
                                        return cc[(i+1)%2] / fabs(dd[(i+1)%2] - cc[(i+1)%2]);
                        }
                }
-               return f1;
        }
-       
-       f1 = MIN2(fabs(f1), fabs(f2));
-       CLAMP(f1, 0.0, 1.0+DBL_EPSILON);
-       
+
        return f1;
 }
 
index 0ee9408dea801a9b011ec4e921f699bf73e9fe78..1ef6725350a4b485058bfd449178983853485b77 100644 (file)
@@ -80,7 +80,7 @@ int BM_Dissolve_Disk(BMesh *bm, BMVert *v) {
        BMFace *f, *f2;
        BMEdge *e, *keepedge=NULL, *baseedge=NULL;
        BMLoop *loop;
-       int done, len;
+       int done, len= 0;
 
        if(BM_Nonmanifold_Vert(bm, v)) {
                return 0;
@@ -89,7 +89,6 @@ int BM_Dissolve_Disk(BMesh *bm, BMVert *v) {
        if(v->e){
                /*v->e we keep, what else?*/
                e = v->e;
-               len = 0;
                do{
                        e = bmesh_disk_nextedge(e,v);
                        if(!(BM_Edge_Share_Faces(e, v->e))){
index 22e9d5494f0e6fa11002f9adbc8a443f7e118b7d..7e8f65ce7d578d6dbc89770a14485a2544475735 100644 (file)
@@ -68,7 +68,7 @@ void connectverts_exec(BMesh *bm, BMOperator *op)
                        loops[BLI_array_count(loops)-1] = loops[0];
                }
 
-               BM_LegalSplits(bm, f, loops, BLI_array_count(loops)/2);
+               BM_LegalSplits(bm, f, (BMLoop *(*)[2])loops, BLI_array_count(loops)/2);
                
                for (i=0; i<BLI_array_count(loops)/2; i++) {
                        if (loops[i*2]==NULL) continue;
index 62f9f1c044594fd5ea2e175ff5b0e0d65a40cbc8..0522b24ae91a5f6ee0fc99f4e642f006fa21eb57 100644 (file)
@@ -3384,6 +3384,7 @@ static int iteratorStopped(void *arg)
 
 ReebGraph *BIF_ReebGraphMultiFromEditMesh(bContext *C)
 {
+       (void)C;
        return NULL;
 #if 0
        Scene *scene = CTX_data_scene(C);
index 351ce0e4ccb4ffe876bde6f5adfcfea2c3001e4c..245f78c50546362e5b1884f6294bec347e6deb34 100644 (file)
@@ -408,7 +408,7 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
                        case TH_PIN:
                                cp= ts->pin; break;
                        case TH_PIN_OPAC:
-                               cp= &ts->pin_opac; break;
+                               cp= &ts->pin_opac; break; /*XXX BMESH_TODO*/
                                        
                        case TH_PREVIEW_BACK:
                                cp= ts->preview_back;
index c09b9def1602229e93d6dca09fd9beb1471ef35c..45853c2d750df21aa38266a0a26db65d7f51b548 100644 (file)
@@ -103,7 +103,8 @@ void EDBM_select_mirrored(Object *obedit, BMEditMesh *em)
                BMVert *eve, *v1;
                BMIter iter;
                int i;
-               
+
+               i= 0;
                BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
                        if (BM_TestHFlag(eve, BM_SELECT) && !BM_TestHFlag(eve, BM_HIDDEN)) {
                                v1= editbmesh_get_x_mirror_vert(obedit, em, eve, eve->co, i);
index 58d3ce71ad8eafb45913673983e60225f2ccc362..7376b35d86b8cd5e7bd355a10395e6c501140b56 100644 (file)
@@ -339,7 +339,7 @@ static void ringsel_finish(bContext *C, wmOperator *op)
 }
 
 /* called when modal loop selection is done... */
-static void ringsel_exit(bContext *C, wmOperator *op)
+static void ringsel_exit(bContext *UNUSED(C), wmOperator *op)
 {
        tringselOpData *lcd= op->customdata;
        
index 4bb2060ac1819fdb9df83ae776de93a9d85c37fb..7fb622e41be8cf58952dddde0bd415b3c8ee2a5d 100644 (file)
@@ -177,8 +177,13 @@ static void delete_customdata_layer(bContext *C, Object *ob, CustomDataLayer *la
        }
 }
 
-static void copy_editface_active_customdata(EditMesh *em, int type, int index)
+static void copy_editface_active_customdata(BMEditMesh *em, int type, int index)
 {
+#if 1 /*BMESH_TODO*/
+       (void)em;
+       (void)type;
+       (void)index;
+#else
        EditFace *efa;
        int n= CustomData_get_active_layer(&em->fdata, type);
 
@@ -186,6 +191,7 @@ static void copy_editface_active_customdata(EditMesh *em, int type, int index)
                void *data= CustomData_em_get_n(&em->fdata, efa->data, type, n);
                CustomData_em_set_n(&em->fdata, efa->data, type, index, data);
        }
+#endif
 }
 
 int ED_mesh_uv_texture_add(bContext *C, Mesh *me, const char *name, int active_set)
index 8415ecf9410d5da0c7040fc222e0e887e42e3a7f..418860a480525fc349f9ae6ea7b35907ef1343d7 100644 (file)
@@ -55,6 +55,8 @@ struct BMesh;
 struct BMEdge;
 struct BMFace;
 struct wmOperator;
+struct wmKeyMap;
+struct wmKeyConfig;
 
 /* ******************** bmeshutils.c */
 
index 12296bb10b0a7782f10942bc8b00300adb968464..f5b34b2c4fa263cbfc73ac96e6d46e49a1f9bf55 100644 (file)
@@ -2084,7 +2084,7 @@ static int draw_dm_edges_pins__setDrawOptions(void *userData, int index)
        BMIter feiter;
        BMFace *fe;
 
-       int fcount, fpcount = 0;
+       int fcount = 0, fpcount = 0;
        int pin = 0;
 
        /* If pinned faces are drawn then only draw pinned edges at the borders.