Fixing mixed code and declaration.
authorMartin Poirier <theeth@yahoo.com>
Sat, 10 Oct 2009 03:29:03 +0000 (03:29 +0000)
committerMartin Poirier <theeth@yahoo.com>
Sat, 10 Oct 2009 03:29:03 +0000 (03:29 +0000)
PEOPLE, PLEASE CHECK YOUR WARNINGS BEFORE COMMIT

source/blender/blenkernel/intern/mesh.c

index 391aa0ec32f9e49dc94b5d542de213df87ca4b5a..ce30075c424a9df2775b597ec89b14a7e3854874 100644 (file)
@@ -996,6 +996,10 @@ void mesh_to_curve(Scene *scene, Object *ob)
        EdgeHash *eh = BLI_edgehash_new();
        EdgeHash *eh_edge = BLI_edgehash_new();
 
+       ListBase edges = {NULL, NULL};
+       EdgeLink *edl;
+
+
        mf= mface;
        for (i = 0; i < totface; i++, mf++) {
                if (!BLI_edgehash_haskey(eh, mf->v1, mf->v2))
@@ -1014,9 +1018,6 @@ void mesh_to_curve(Scene *scene, Object *ob)
                }
        }
 
-       ListBase edges = {NULL, NULL};
-       EdgeLink *edl;
-
        med= medge;
        for(i=0; i<totedge; i++, med++) {
                if (!BLI_edgehash_haskey(eh, med->v1, med->v2)) {
@@ -1042,20 +1043,24 @@ void mesh_to_curve(Scene *scene, Object *ob)
                        MEdge *med_current= ((EdgeLink *)edges.last)->edge;
                        int startVert= med_current->v1;
                        int endVert= med_current->v2;
+                       int ok= TRUE;
+
+                       Nurb *nu;
+                       BPoint *bp;
+                       VertLink *vl;
 
                        appendPolyLineVert(&polyline, startVert);       totpoly++;
                        appendPolyLineVert(&polyline, endVert);         totpoly++;
                        BLI_freelinkN(&edges, edges.last);                      totedges--;
 
-                       int ok= TRUE;
 
                        while(ok) {
                                ok = FALSE;
                                i= totedges;
                                while(i) {
+                                       MEdge *ed= edl->edge;
                                        i-=1;
                                        edl= BLI_findlink(&edges, i);
-                                       MEdge *ed= edl->edge;
 
                                        if(ed->v1==endVert) {
                                                endVert = ed->v2;
@@ -1092,8 +1097,6 @@ void mesh_to_curve(Scene *scene, Object *ob)
                        }
 
                        /* --- nurbs --- */
-                       Nurb *nu;
-                       BPoint *bp;
 
                        /* create new 'nurb' within the curve */
                        nu = (Nurb *)MEM_callocN(sizeof(Nurb), "MeshNurb");
@@ -1107,7 +1110,7 @@ void mesh_to_curve(Scene *scene, Object *ob)
                        nu->bp= (BPoint *)MEM_callocN(sizeof(BPoint)*totpoly, "bpoints");
 
                        /* add points */
-                       VertLink *vl= polyline.first;
+                       vl= polyline.first;
                        for (i=0, bp=nu->bp; i < totpoly; i++, bp++, vl=vl->next) {
                                VecCopyf(bp->vec, mverts[vl->index].co);
                                bp->f1= SELECT;