[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39697] branches/bmesh/blender/source/ blender: Cleaned up unused variables

Howard Trickey howard.trickey at gmail.com
Sun Aug 28 01:42:12 CEST 2011


OK, I'll put back the removed ones in comments. I did comment out or ifdef
out
some of them, for the reasons you said, but should have just done that for
all
of them.

Someone complained in IRC that the one in connectops.c was causing msvc
to fail compiling - seemed a little fishy to me since there are other ones
too,
but i couldn't check, so went on this removing spree.

On Sat, Aug 27, 2011 at 7:17 PM, Campbell Barton <ideasman42 at gmail.com>wrote:

> I think its best not to remove unused variables on code which is being
> rewritten or isnt fully working.
> Since the reason they are not used in some cases is because the
> features are not properly working yet .
>
> Rather then removing, I add comments like this...
> /* int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0; */ /* UNUSED */
>
> If you need access to the variables again to figure out a line like
> the one above takes time if you dont know the code well.
>
> rna_mesh.c for example would be best left as is (or commented), since
> BMesh currently has no RNA access this is the vars may well be used
> when the code is added back.
>
> Getting rid of compiler warnings is generally good, I just worry this
> commit looses valuable info we'll need when adding back functionality.
>
>
> On Fri, Aug 26, 2011 at 2:47 AM, Howard Trickey
> <howard.trickey at gmail.com> wrote:
> > Revision: 39697
> >
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39697
> > Author:   howardt
> > Date:     2011-08-25 16:47:47 +0000 (Thu, 25 Aug 2011)
> > Log Message:
> > -----------
> > Cleaned up unused variables
> >
> > Modified Paths:
> > --------------
> >
>  branches/bmesh/blender/source/blender/blenkernel/intern/editderivedbmesh.c
> >    branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
> >    branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
> >    branches/bmesh/blender/source/blender/bmesh/operators/connectops.c
> >    branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
> >    branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
> >    branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c
> >    branches/bmesh/blender/source/blender/modifiers/intern/MOD_solidify.c
> >
> > Modified:
> branches/bmesh/blender/source/blender/blenkernel/intern/editderivedbmesh.c
> > ===================================================================
> > ---
> branches/bmesh/blender/source/blender/blenkernel/intern/editderivedbmesh.c
>  2011-08-25 16:42:42 UTC (rev 39696)
> > +++
> branches/bmesh/blender/source/blender/blenkernel/intern/editderivedbmesh.c
>  2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -1301,7 +1301,6 @@
> >
> >  static void bmDM_copyLoopArray(DerivedMesh *dm, MLoop *loop_r)
> >  {
> > -       EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
> >        BMesh *bm = ((EditDerivedBMesh *)dm)->tc->bm;
> >        BMIter iter, liter;
> >        BMVert *v;
> > @@ -1332,7 +1331,6 @@
> >
> >  static void bmDM_copyPolyArray(DerivedMesh *dm, MPoly *poly_r)
> >  {
> > -       EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
> >        BMesh *bm = ((EditDerivedBMesh *)dm)->tc->bm;
> >        BMIter iter;
> >        BMFace *f;
> >
> > Modified:
> branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
>  2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/blenkernel/intern/multires.c
>  2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -972,7 +972,6 @@
> >
> >                for(S = 0; S < numVerts; ++S, ++gIndex, ++k) {
> >                        MDisps *mdisp = &mdisps[mpoly[i].loopstart+S];
> > -                       DMGridData *grid = gridData[gIndex];
> >                        DMGridData *subgrid = subGridData[gIndex];
> >                        float (*dispgrid)[3] = NULL;
> >
> >
> > Modified:
> branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
>       2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/blenkernel/intern/subsurf_ccg.c
>       2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -499,7 +499,6 @@
> >        BLI_array_declare(fVerts);
> >        MVert *mvert = dm->getVertArray(dm);
> >        MEdge *medge = dm->getEdgeArray(dm);
> > -       MFace *mface = dm->getTessFaceArray(dm);
> >        MVert *mv;
> >        MEdge *me;
> >        MLoop *mloop = dm->getLoopArray(dm), *ml;
> > @@ -1113,7 +1112,6 @@
> >        int edgeSize = ccgSubSurf_getEdgeSize(ss);
> >        int i = 0;
> >        MLoop *mv;
> > -       char *faceFlags = cgdm->faceFlags;
> >
> >        if (!cgdm->ehash) {
> >                MEdge *medge;
> > @@ -1131,8 +1129,6 @@
> >        for(index = 0; index < totface; index++) {
> >                CCGFace *f = cgdm->faceMap[index].face;
> >                int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f);
> > -               int flag = (faceFlags)? faceFlags[index*2]: ME_SMOOTH;
> > -               int mat_nr = (faceFlags)? faceFlags[index*2+1]: 0;
> >
> >                for(S = 0; S < numVerts; S++) {
> >                        for(y = 0; y < gridSize - 1; y++) {
> > @@ -1178,7 +1174,6 @@
> >        int index;
> >        int totface;
> >        int gridSize = ccgSubSurf_getGridSize(ss);
> > -       int edgeSize = ccgSubSurf_getEdgeSize(ss);
> >        int i = 0, k = 0;
> >        char *faceFlags = cgdm->faceFlags;
> >
> >
> > Modified:
> branches/bmesh/blender/source/blender/bmesh/operators/connectops.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/bmesh/operators/connectops.c
>  2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/bmesh/operators/connectops.c
>  2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -142,8 +142,7 @@
> >        BMO_ITER(e, &siter, bm, op, "edges", BM_EDGE) {
> >                if (!BMO_TestFlag(bm, e, EDGE_DONE)) {
> >                        BMVert *v, *ov;
> > -                       BMEdge *e2, *e3, *oe = e;
> > -                       int i;
> > +                       BMEdge *e2, *e3;
> >
> >                        if (c > 2) {
> >                                printf("eek! more than two edge
> loops!\n");
> >
> > Modified: branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
>  2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/editors/mesh/knifetool.c
>  2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -1155,8 +1155,6 @@
> >                        *fptr = f;
> >
> >                if (cure && p) {
> > -                       float d;
> > -
> >                        if (!kcd->ignore_edge_snapping || !(cure->e)) {
> >                                if (kcd->snap_midpoints) {
> >                                        interp_v3_v3v3(p, cure->v1->co,
> cure->v2->co, 0.5f);
> >
> > Modified:
> branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
> 2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/editors/sculpt_paint/sculpt.c
> 2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -279,16 +279,15 @@
> >  static int sculpt_get_redraw_rect(ARegion *ar, RegionView3D *rv3d,
> >                                Object *ob, rcti *rect)
> >  {
> > -       StrokeCache *cache = ob->sculpt->cache;
> >        PBVH *pbvh= ob->sculpt->pbvh;
> >        float bb_min[3], bb_max[3], pmat[4][4];
> >        int i, j, k;
> >
> >  /*     if (G.rt == 1) {
> > -               rect->xmin = cache->prect.xmin;
> > -               rect->xmax = cache->prect.xmax;
> > -               rect->ymin = cache->prect.ymin;
> > -               rect->ymax = cache->prect.ymax;
> > +               rect->xmin = ob->sculpt->cache->prect.xmin;
> > +               rect->xmax = ob->sculpt->cache->prect.xmax;
> > +               rect->ymin = ob->sculpt->cache->prect.ymin;
> > +               rect->ymax = ob->sculpt->cache->prect.ymax;
> >
> >                return rect->xmin < rect->xmax && rect->ymin <
> rect->ymax;;
> >        }
> > @@ -2240,8 +2239,6 @@
> >  {
> >        SculptSession *ss = ob->sculpt;
> >        Brush *brush = paint_brush(&sd->paint);
> > -       rctf mr;
> > -       float xrad, yrad;
> >
> >        float bstrength = ss->cache->bstrength;
> >        const float radius = ss->cache->radius;
> >
> > Modified:
> branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c
>  2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/makesrna/intern/rna_mesh.c
>  2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -606,7 +606,6 @@
> >  static void rna_MeshTextureFaceLayer_name_set(PointerRNA *ptr, const
> char *value)
> >  {
> >        Mesh *me= (Mesh*)ptr->id.data;
> > -       CustomData *fdata= rna_mesh_pdata(me);
> >        CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
> >        BLI_strncpy(cdl->name, value, sizeof(cdl->name));
> >        CustomData_set_layer_unique_name(&me->pdata, cdl -
> rna_mesh_pdata(me)->layers);
> > @@ -643,9 +642,9 @@
> >  static void rna_Mesh_active_vertex_color_set(PointerRNA *ptr, PointerRNA
> value)
> >  {
> >        Mesh *me= (Mesh*)ptr->data;
> > -       CustomData *ldata= rna_mesh_ldata(me), *fdata;
> > +       CustomData *ldata= rna_mesh_ldata(me);
> >        CustomDataLayer *cdl;
> > -       int a, b, c;
> > +       int a, b;
> >
> >        b = 0;
> >        for(cdl=ldata->layers, a=0; a<ldata->totlayer; cdl++, a++) {
> > @@ -723,7 +722,6 @@
> >  static void rna_MeshColorLayer_name_set(PointerRNA *ptr, const char
> *value)
> >  {
> >        Mesh *me= (Mesh*)ptr->id.data;
> > -       CustomData *fdata= rna_mesh_pdata(me);
> >        CustomDataLayer *cdl= (CustomDataLayer*)ptr->data;
> >        BLI_strncpy(cdl->name, value, sizeof(cdl->name));
> >        CustomData_set_layer_unique_name(&me->ldata, cdl -
> rna_mesh_ldata(me)->layers);
> > @@ -1257,7 +1255,9 @@
> >                {TF_ALPHA, "ALPHA", 0, "Alpha", "Render polygon
> transparent, depending on alpha channel of the texture"},
> >                {TF_CLIP, "CLIPALPHA", 0, "Clip Alpha", "Use the images
> alpha values clipped with no blending (binary alpha)"},
> >                {0, NULL, 0, NULL, NULL}};
> > +#if 0  /* BMESH_TODO: needed later when do another todo */
> >        int uv_dim[]= {4, 2};
> > +#endif
> >
> >        srna= RNA_def_struct(brna, "MeshTextureFaceLayer", NULL);
> >        RNA_def_struct_ui_text(srna, "Mesh Texture Face Layer", "Layer of
> texture faces in a Mesh datablock");
> >
> > Modified:
> branches/bmesh/blender/source/blender/modifiers/intern/MOD_solidify.c
> > ===================================================================
> > --- branches/bmesh/blender/source/blender/modifiers/intern/MOD_solidify.c
>       2011-08-25 16:42:42 UTC (rev 39696)
> > +++ branches/bmesh/blender/source/blender/modifiers/intern/MOD_solidify.c
>       2011-08-25 16:47:47 UTC (rev 39697)
> > @@ -199,7 +199,7 @@
> >                                                int UNUSED(isFinalCalc))
> >  {
> >        int i;
> > -       DerivedMesh *result, *copy, *odm = dm;
> > +       DerivedMesh *result, *odm = dm;
> >        const SolidifyModifierData *smd = (SolidifyModifierData*) md;
> >
> >        MVert *mv, *mvert, *orig_mvert;
> > @@ -215,7 +215,6 @@
> >        /* only use material offsets if we have 2 or more materials  */
> >        const short mat_nr_max= ob->totcol > 1 ? ob->totcol - 1 : 0;
> >        const short mat_ofs= mat_nr_max ? smd->mat_ofs : 0;
> > -       const short mat_ofs_rim= mat_nr_max ? smd->mat_ofs_rim : 0;
> >
> >        /* use for edges */
> >        int *new_vert_arr= NULL;
> >
> > _______________________________________________
> > Bf-blender-cvs mailing list
> > Bf-blender-cvs at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-blender-cvs
> >
>
>
>
> --
> - Campbell
>


More information about the Bf-committers mailing list