quiet some -Wshadow warnings
authorCampbell Barton <ideasman42@gmail.com>
Fri, 12 Oct 2012 14:35:10 +0000 (14:35 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 12 Oct 2012 14:35:10 +0000 (14:35 +0000)
36 files changed:
source/blender/blenkernel/BKE_sequencer.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/curve.c
source/blender/blenkernel/intern/depsgraph.c
source/blender/blenkernel/intern/implicit.c
source/blender/blenkernel/intern/mesh.c
source/blender/blenkernel/intern/mesh_validate.c
source/blender/blenkernel/intern/multires.c
source/blender/blenkernel/intern/object.c
source/blender/editors/armature/editarmature_retarget.c
source/blender/editors/interface/interface_ops.c
source/blender/editors/mask/mask_add.c
source/blender/editors/mask/mask_ops.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/object/object_shapekey.c
source/blender/editors/object/object_transform.c
source/blender/editors/object/object_vgroup.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_vertex.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_clip/tracking_select.c
source/blender/editors/space_nla/nla_draw.c
source/blender/editors/space_node/drawnode.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/space_node/node_templates.c
source/blender/editors/space_sequencer/sequencer_edit.c
source/blender/editors/space_view3d/drawmesh.c
source/blender/editors/space_view3d/view3d_buttons.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/editors/uvedit/uvedit_unwrap_ops.c

index 80431682d6f63d420133576ac92f32ce04273309..1667c11979026dd7febb7b5199e36173d924ec71 100644 (file)
@@ -68,27 +68,27 @@ void BKE_sequence_iterator_begin(struct Editing *ed, SeqIterator *iter, int use_
 void BKE_sequence_iterator_next(SeqIterator *iter);
 void BKE_sequence_iterator_end(SeqIterator *iter);
 
-#define SEQP_BEGIN(ed, _seq)                                                  \
+#define SEQP_BEGIN(_ed, _seq)                                                 \
        {                                                                         \
-               SeqIterator iter;                                                     \
-               for (BKE_sequence_iterator_begin(ed, &iter, 1);                       \
-                    iter.valid;                                                      \
-                    BKE_sequence_iterator_next(&iter))                               \
+               SeqIterator iter_macro;                                               \
+               for (BKE_sequence_iterator_begin(_ed, &iter_macro, 1);                \
+                    iter_macro.valid;                                                \
+                    BKE_sequence_iterator_next(&iter_macro))                         \
                {                                                                     \
-                       _seq = iter.seq;
+                       _seq = iter_macro.seq;
 
 #define SEQ_BEGIN(ed, _seq)                                                   \
        {                                                                         \
-               SeqIterator iter;                                                     \
-               for (BKE_sequence_iterator_begin(ed, &iter, 0);                       \
-                    iter.valid;                                                      \
-                    BKE_sequence_iterator_next(&iter))                               \
+               SeqIterator iter_macro;                                               \
+               for (BKE_sequence_iterator_begin(ed, &iter_macro, 0);                 \
+                    iter_macro.valid;                                                \
+                    BKE_sequence_iterator_next(&iter_macro))                         \
                {                                                                     \
-                       _seq = iter.seq;
+                       _seq = iter_macro.seq;
 
 #define SEQ_END                                                               \
                }                                                                     \
-               BKE_sequence_iterator_end(&iter);                                     \
+               BKE_sequence_iterator_end(&iter_macro);                               \
        }
 
 typedef struct SeqRenderData {
index ce39eea5ceb084c7873736d850d2692b2fe07369..f4efc30068c967fccdee2a0bc4d107dbf999bfab 100644 (file)
@@ -741,7 +741,7 @@ void BKE_brush_scale_unprojected_radius(float *unprojected_radius,
 }
 
 /* scale brush size to reflect a change in the brush's unprojected radius */
-void BKE_brush_scale_size(int *BKE_brush_size_get,
+void BKE_brush_scale_size(int *r_brush_size,
                           float new_unprojected_radius,
                           float old_unprojected_radius)
 {
@@ -749,7 +749,7 @@ void BKE_brush_scale_size(int *BKE_brush_size_get,
        /* avoid division by zero */
        if (old_unprojected_radius != 0)
                scale /= new_unprojected_radius;
-       (*BKE_brush_size_get) = (int)((float)(*BKE_brush_size_get) * scale);
+       (*r_brush_size) = (int)((float)(*r_brush_size) * scale);
 }
 
 /* Brush Painting */
index 0bda3b266b89d859a727cc48a309f63e867df57b..e09e2eeb4938cc7a19c932f783215454d3e39005 100644 (file)
@@ -2109,7 +2109,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
        BevPoint *bevp2, *bevp1, *bevp0; /* standard for all make_bevel_list_3D_* funcs */
        int nr;
 
-       float bevp0_tan[3], cross_tmp[3];
+       float bevp0_tan[3];
 
        bevel_list_calc_bisect(bl);
        if (bl->poly == -1) /* check its not cyclic */
@@ -2123,6 +2123,7 @@ static void make_bevel_list_3D_tangent(BevList *bl)
 
        nr = bl->nr;
        while (nr--) {
+               float cross_tmp[3];
                cross_v3_v3v3(cross_tmp, bevp1->tan, bevp1->dir);
                cross_v3_v3v3(bevp1->tan, cross_tmp, bevp1->dir);
                normalize_v3(bevp1->tan);
index 9b52fbae626f6fcb7dc7ab429bfb227973a4e81a..20b029371f1a7fdaa8c31813fecb86bc4fd2fa1c 100644 (file)
@@ -444,7 +444,6 @@ static void build_dag_object(DagForest *dag, DagNode *scenenode, Scene *scene, O
        if (ob->type == OB_ARMATURE) {
                if (ob->pose) {
                        bPoseChannel *pchan;
-                       bConstraint *con;
                        
                        for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
                                for (con = pchan->constraints.first; con; con = con->next) {
index 2b23e8450aefb8cbbc4ee88ea1d6bb4f75e30b79..235d7858e17f3dfe0dc10986e19ccb1a8ceb4e15 100644 (file)
@@ -857,23 +857,22 @@ DO_INLINE float fbderiv(float length, float L)
 
 DO_INLINE float fbstar(float length, float L, float kb, float cb)
 {
-       float tempfb = kb * fb(length, L);
-
-       float fbstar = cb * (length - L);
+       float tempfb_fl = kb * fb(length, L);
+       float fbstar_fl = cb * (length - L);
        
-       if (tempfb < fbstar)
-               return fbstar;
+       if (tempfb_fl < fbstar_fl)
+               return fbstar_fl;
        else
-               return tempfb;          
+               return tempfb_fl;
 }
 
 // function to calculae bending spring force (taken from Choi & Co)
 DO_INLINE float fbstar_jacobi(float length, float L, float kb, float cb)
 {
-       float tempfb = kb * fb(length, L);
-       float fbstar = cb * (length - L);
+       float tempfb_fl = kb * fb(length, L);
+       float fbstar_fl = cb * (length - L);
 
-       if (tempfb < fbstar) {
+       if (tempfb_fl < fbstar_fl) {
                return cb;
        }
        else {
index 1936cc0ea99410302cdcb23d8a4bd462ba1586d8..c244317ccb7a619ca327487ecc829380a6071c68 100644 (file)
@@ -2039,7 +2039,7 @@ static void bm_corners_to_loops_ex(ID *id, CustomData *fdata, CustomData *ldata,
                MDisps *ld = CustomData_get(ldata, loopstart, CD_MDISPS);
                MDisps *fd = CustomData_get(fdata, findex, CD_MDISPS);
                float (*disps)[3] = fd->disps;
-               int i, tot = mf->v4 ? 4 : 3;
+               int tot = mf->v4 ? 4 : 3;
                int side, corners;
 
                if (CustomData_external_test(fdata, CD_MDISPS)) {
index 79e3fc19d20ad0c6523fa1e230132d6dee1a4582..c4d663e17bdc9e373fc7551170188e22428468f3 100644 (file)
@@ -228,7 +228,6 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
        }
 
        for (i = 1; i < totvert; i++, mv++) {
-               int j;
                int fix_normal = TRUE;
 
                for (j = 0; j < 3; j++) {
@@ -717,7 +716,6 @@ int BKE_mesh_validate_arrays(Mesh *mesh,
                MDeformVert *dv;
                for (i = 0, dv = dverts; i < totvert; i++, dv++) {
                        MDeformWeight *dw;
-                       unsigned int j;
 
                        for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
                                /* note, greater then max defgroups is accounted for in our code, but not < 0 */
@@ -914,7 +912,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
 {
        CustomData edata;
        EdgeHashIterator *ehi;
-       MPoly *mp = mesh->mpoly;
+       MPoly *mp;
        MEdge *med, *med_orig;
        EdgeHash *eh = BLI_edgehash_new();
        int i, totedge, totpoly = mesh->totpoly;
@@ -932,7 +930,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
        }
 
        /* mesh loops (bmesh only) */
-       for (i = 0; i < totpoly; i++, mp++) {
+       for (mp = mesh->mpoly, i = 0; i < totpoly; mp++, i++) {
                MLoop *l = &mesh->mloop[mp->loopstart];
                int j, l_prev = (l + (mp->totloop - 1))->v;
                for (j = 0; j < mp->totloop; j++, l++) {
@@ -970,8 +968,7 @@ void BKE_mesh_calc_edges(Mesh *mesh, int update)
        if (mesh->totpoly) {
                /* second pass, iterate through all loops again and assign
                 * the newly created edges to them. */
-               MPoly *mp = mesh->mpoly;
-               for (i = 0; i < mesh->totpoly; i++, mp++) {
+               for (mp = mesh->mpoly, i = 0; i < mesh->totpoly; mp++, i++) {
                        MLoop *l = &mesh->mloop[mp->loopstart];
                        MLoop *l_prev = (l + (mp->totloop - 1));
                        int j;
index 591524e5156f9a1b2ed52aa9dc2d43bf66cf33ee..58348483c613f5dcb9514f8fcfb98e64668fa4d1 100644 (file)
@@ -1161,7 +1161,6 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm)
                int totlvl = ccgdm->multires.totlvl;
                
                if (lvl < totlvl) {
-                       Mesh *me = ob->data;
                        DerivedMesh *lowdm, *cddm, *highdm;
                        CCGElem **highGridData, **lowGridData, **subGridData, **gridData, *diffGrid;
                        CCGKey highGridKey, lowGridKey;
index 65ab97e0dad3536a9b99a888ad8123e3e1c18b5f..a0d2773770554f6f214f6f28062aa191093bb356 100644 (file)
@@ -689,8 +689,8 @@ void BKE_object_unlink(Object *ob)
 
                                        if (so->treestore) {
                                                TreeStoreElem *tselem = so->treestore->data;
-                                               int a;
-                                               for (a = 0; a < so->treestore->usedelem; a++, tselem++) {
+                                               int i;
+                                               for (i = 0; i < so->treestore->usedelem; i++, tselem++) {
                                                        if (tselem->id == (ID *)ob) tselem->id = NULL;
                                                }
                                        }
index fad06f0d020f5b8232a1693ecf3269d2c29fba74..196d03020e7ff2698eab0447f87b957e96661e8d 100644 (file)
@@ -1962,7 +1962,6 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
        ReebArcIterator arc_iter;
        BArcIterator *iter = (BArcIterator *)&arc_iter;
        RigEdge *edge;
-       EmbedBucket *bucket = NULL;
        ReebNode *node_start, *node_end;
        ReebArc *earc = iarc->link_mesh;
        float angle_weight = 1.0; // GET FROM CONTEXT
@@ -1996,8 +1995,6 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
 
        /* equal number of joints and potential position, just fill them in */
        if (nb_joints == earc->bcount) {
-               int i;
-               
                /* init with first values */
                for (i = 0; i < nb_joints; i++) {
                        best_positions[i] = i + 1;
@@ -2011,7 +2008,6 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
                MemoNode *result;
 #endif
                float **positions_cache = MEM_callocN(sizeof(float *) * (nb_positions + 2), "positions cache");
-               int i;
                
                positions_cache[0] = node_start->p;
                positions_cache[nb_positions + 1] = node_end->p;
@@ -2053,7 +2049,7 @@ static void retargetArctoArcAggresive(bContext *C, RigGraph *rigg, RigArc *iarc,
        {
                float *no = NULL;
                if (i < nb_joints) {
-                       bucket = IT_peek(iter, best_positions[i]);
+                       EmbedBucket *bucket = IT_peek(iter, best_positions[i]);
                        vec1 = bucket->p;
                        no = bucket->no;
                }
index e4e2598c4949200df91e5211862fc12fddb660db..ba2feebd2f854ff81c8f658cd0a7518539cd2d58 100644 (file)
@@ -857,8 +857,8 @@ static int editsource_exec(bContext *C, wmOperator *op)
                     !BLI_ghashIterator_isDone(&ghi);
                     BLI_ghashIterator_step(&ghi))
                {
-                       uiBut *but = BLI_ghashIterator_getKey(&ghi);
-                       if (but && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but)) {
+                       uiBut *but_key = BLI_ghashIterator_getKey(&ghi);
+                       if (but_key && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but_key)) {
                                but_store = BLI_ghashIterator_getValue(&ghi);
                                break;
                        }
index a254a6a9278a18f085ae3c1a8816eb4017adb636..c929436bc82a6a3cce76b36b5c33a0e006593986 100644 (file)
@@ -97,7 +97,7 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
                                                                                          &tot_diff_point);
 
                                if (diff_points) {
-                                       int i, tot_point;
+                                       int j, tot_point;
                                        unsigned int tot_feather_point;
                                        float *feather_points = NULL, *points;
 
@@ -114,26 +114,26 @@ static int find_nearest_diff_point(const bContext *C, Mask *mask, const float no
                                                tot_point = tot_diff_point;
                                        }
 
-                                       for (i = 0; i < tot_point - 1; i++) {
+                                       for (j = 0; j < tot_point - 1; j++) {
                                                float cur_dist, a[2], b[2];
 
-                                               a[0] = points[2 * i] * scalex;
-                                               a[1] = points[2 * i + 1] * scaley;
+                                               a[0] = points[2 * j] * scalex;
+                                               a[1] = points[2 * j + 1] * scaley;
 
-                                               b[0] = points[2 * i + 2] * scalex;
-                                               b[1] = points[2 * i + 3] * scaley;
+                                               b[0] = points[2 * j + 2] * scalex;
+                                               b[1] = points[2 * j + 3] * scaley;
 
                                                cur_dist = dist_to_line_segment_v2(co, a, b);
 
                                                if (cur_dist < dist) {
                                                        if (tangent)
-                                                               sub_v2_v2v2(tangent, &diff_points[2 * i + 2], &diff_points[2 * i]);
+                                                               sub_v2_v2v2(tangent, &diff_points[2 * j + 2], &diff_points[2 * j]);
 
                                                        point_masklay = masklay;
                                                        point_spline = spline;
                                                        point = use_deform ? &spline->points[(cur_point - spline->points_deform)] : cur_point;
                                                        dist = cur_dist;
-                                                       u = (float)i / tot_point;
+                                                       u = (float)j / tot_point;
 
                                                }
                                        }
index 88fbb91edfbaf4a095c0d5c8c960e3e0204461ad..bea6b153d205637fa90b3c8b9c14472f5c948f2c 100644 (file)
@@ -483,15 +483,15 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, wmEvent *event)
                customdata->uw = uw;
 
                if (uw) {
-                       float co[2];
+                       float co_uw[2];
                        float weight_scalar = BKE_mask_point_weight_scalar(spline, point, uw->u);
 
                        customdata->weight = uw->w;
                        customdata->weight_scalar = weight_scalar;
-                       BKE_mask_point_segment_co(spline, point, uw->u, co);
+                       BKE_mask_point_segment_co(spline, point, uw->u, co_uw);
                        BKE_mask_point_normal(spline, point, uw->u, customdata->no);
 
-                       madd_v2_v2v2fl(customdata->feather, co, customdata->no, uw->w * weight_scalar);
+                       madd_v2_v2v2fl(customdata->feather, co_uw, customdata->no, uw->w * weight_scalar);
                }
                else {
                        BezTriple *bezt = &point->bezt;
index ee12e97132593456d0323c8b5eab6084a001a860..2d46de024dd606db325077e04c328c0a56eb94b0 100644 (file)
@@ -3852,8 +3852,8 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
        char *pblock[3] = {NULL, NULL, NULL}, *pb;
        BMElemSort *sblock[3] = {NULL, NULL, NULL}, *sb;
        int *map[3] = {NULL, NULL, NULL}, *mp;
-       int totelem[3] = {0, 0, 0}, tot;
-       int affected[3] = {0, 0, 0}, aff;
+       int totelem[3] = {0, 0, 0};
+       int affected[3] = {0, 0, 0};
        int i, j;
 
        if (!(types && flag && action))
@@ -4228,8 +4228,8 @@ static void sort_bmelem_flag(Scene *scene, Object *ob,
                if (pb && sb && !map[j]) {
                        char *p_blk;
                        BMElemSort *s_blk;
-                       tot = totelem[j];
-                       aff = affected[j];
+                       int tot = totelem[j];
+                       int aff = affected[j];
 
                        qsort(sb, aff, sizeof(BMElemSort), bmelemsort_comp);
 
index cfd4945688bf626fdc0e2e79dd61e1da878a22ee..86a55a9b2784da8ade01c4d81d48809e8f952018 100644 (file)
@@ -162,15 +162,15 @@ static int object_shape_key_mirror(bContext *C, Object *ob)
        kb = BLI_findlink(&key->block, ob->shapenr - 1);
 
        if (kb) {
-               int i1, i2;
-               float *fp1, *fp2;
-               float tvec[3];
                char *tag_elem = MEM_callocN(sizeof(char) * kb->totelem, "shape_key_mirror");
 
 
                if (ob->type == OB_MESH) {
                        Mesh *me = ob->data;
                        MVert *mv;
+                       int i1, i2;
+                       float *fp1, *fp2;
+                       float tvec[3];
 
                        mesh_octree_table(ob, NULL, NULL, 's');
 
index 1b08235b75c1266438a32650d86193eb0573cd6f..e2a32a743bb8ff55f38398d24648c895a9eec2b6 100644 (file)
@@ -381,8 +381,8 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
 {
        Main *bmain = CTX_data_main(C);
        Scene *scene = CTX_data_scene(C);
-       float rsmat[3][3], tmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
-       int a, change = 1;
+       float rsmat[3][3], obmat[3][3], iobmat[3][3], mat[4][4], scale;
+       int change = 1;
        
        /* first check if we can execute */
        CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@@ -464,6 +464,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
                        copy_v3_v3(mat[3], ob->loc);
 
                        if (!(apply_scale && apply_rot)) {
+                               float tmat[3][3];
                                /* correct for scale and rotation that is still applied */
                                BKE_object_to_mat3(ob, obmat);
                                invert_m3_m3(iobmat, obmat);
@@ -476,6 +477,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
                if (ob->type == OB_MESH) {
                        Mesh *me = ob->data;
                        MVert *mvert;
+                       int a;
 
                        if (apply_scale)
                                multiresModifier_scale_disp(scene, ob);
@@ -518,6 +520,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
                        Nurb *nu;
                        BPoint *bp;
                        BezTriple *bezt;
+                       int a;
 
                        scale = mat3_to_scale(rsmat);
 
@@ -896,6 +899,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
 
                        /* offset other selected objects */
                        if (do_inverse_offset && (centermode != GEOMETRY_TO_ORIGIN)) {
+                               CollectionPointerLink *ctx_link_other;
+
                                /* was the object data modified
                                 * note: the functions above must set 'cent' */
                                copy_v3_v3(centn, cent);
@@ -910,8 +915,16 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
                                ignore_parent_tx(bmain, scene, ob);
                                
                                /* other users? */
-                               CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects)
+                               //CTX_DATA_BEGIN (C, Object *, ob_other, selected_editable_objects)
+                               //{
+
+                               /* use existing context looper */
+                               for (ctx_link_other = ctx_data_list.first;
+                                    ctx_link_other;
+                                    ctx_link_other = ctx_link_other->next)
                                {
+                                       Object *ob_other = ctx_link_other->ptr.data;
+
                                        if ((ob_other->flag & OB_DONE) == 0 &&
                                            ((ob->data && (ob->data == ob_other->data)) ||
                                             (ob->dup_group == ob_other->dup_group &&
@@ -931,7 +944,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
                                                ignore_parent_tx(bmain, scene, ob_other);
                                        }
                                }
-                               CTX_DATA_END;
+                               //CTX_DATA_END;
                        }
                }
        }
index a92cfa472aa6ce5374597c704abbb061ff305393..95be54814f0504bd82148eda4f10d2cadd8312ce 100644 (file)
@@ -918,7 +918,6 @@ void ED_vgroup_select_by_name(Object *ob, const char *name)
 static void vgroup_select_verts(Object *ob, int select)
 {
        const int def_nr = ob->actdef - 1;
-       MDeformVert *dv;
 
        if (!BLI_findlink(&ob->defbase, def_nr)) {
                return;
@@ -934,7 +933,7 @@ static void vgroup_select_verts(Object *ob, int select)
 
                        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                                if (!BM_elem_flag_test(eve, BM_ELEM_HIDDEN)) {
-                                       dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+                                       MDeformVert *dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
                                        if (defvert_find_index(dv, def_nr)) {
                                                BM_vert_select_set(em->bm, eve, select);
                                        }
@@ -971,6 +970,7 @@ static void vgroup_select_verts(Object *ob, int select)
                Lattice *lt = vgroup_edit_lattice(ob);
                
                if (lt->dvert) {
+                       MDeformVert *dv;
                        BPoint *bp;
                        int a, tot;
                        
@@ -2451,7 +2451,6 @@ static void vgroup_delete_all(Object *ob)
 /* only in editmode */
 static void vgroup_assign_verts(Object *ob, const float weight)
 {
-       MDeformVert *dv;
        const int def_nr = ob->actdef - 1;
 
        if (!BLI_findlink(&ob->defbase, def_nr))
@@ -2471,6 +2470,7 @@ static void vgroup_assign_verts(Object *ob, const float weight)
                        /* Go through the list of editverts and assign them */
                        BM_ITER_MESH (eve, &iter, em->bm, BM_VERTS_OF_MESH) {
                                if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
+                                       MDeformVert *dv;
                                        MDeformWeight *dw;
                                        dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT); /* can be NULL */
                                        dw = defvert_verify_index(dv, def_nr);
@@ -2505,6 +2505,7 @@ static void vgroup_assign_verts(Object *ob, const float weight)
        }
        else if (ob->type == OB_LATTICE) {
                Lattice *lt = vgroup_edit_lattice(ob);
+               MDeformVert *dv;
                BPoint *bp;
                int a, tot;
 
index 218ae628d3ff061db5cf29742116c2946fcabbca..bbce94b6215b64dcf05f451d4c198d22e866e110 100644 (file)
@@ -325,9 +325,9 @@ static int ptcache_add_new_exec(bContext *C, wmOperator *UNUSED(op))
        
        for (pid=pidlist.first; pid; pid=pid->next) {
                if (pid->cache == cache) {
-                       PointCache *cache = BKE_ptcache_add(pid->ptcaches);
-                       cache->step = pid->default_step;
-                       *(pid->cache_ptr) = cache;
+                       PointCache *cache_new = BKE_ptcache_add(pid->ptcaches);
+                       cache_new->step = pid->default_step;
+                       *(pid->cache_ptr) = cache_new;
                        break;
                }
        }
index e3d714b191742b4dc0afbb0c75031b1ac7b47a85..5e23a1444081a4e179a603a3fc73ccafc6464f09 100644 (file)
@@ -340,7 +340,6 @@ static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc,
 {
        Scene *scene = CTX_data_scene(C);
        Paint *paint = paint_get_active_from_context(C);
-       Brush *brush = paint_brush(paint);
        float window[2];
        int hit;
 
@@ -350,6 +349,7 @@ static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc,
        if (vc->obact->sculpt && vc->obact->sculpt->pbvh &&
            sculpt_stroke_get_location(C, location, window))
        {
+               Brush *brush = paint_brush(paint);
                *pixel_radius =
                    project_brush_radius(vc,
                                         BKE_brush_unprojected_radius_get(scene, brush),
index c6aaae6b87963f314ceab873fe861026a8e155b1..f60d34428b37fdd04f92a8827f9d7ed2dd3478ba 100644 (file)
@@ -2554,7 +2554,6 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
                        float (*outset_uv)[2] = ps->faceSeamUVs[face_index];
                        float insetCos[4][3]; /* inset face coords.  NOTE!!! ScreenSace for ortho, Worldspace in prespective view */
 
-                       float fac;
                        float *vCoSS[4]; /* vertex screenspace coords */
                        
                        float bucket_clip_edges[2][2]; /* store the screenspace coords of the face, clipped by the bucket's screen aligned rectangle */
@@ -2636,6 +2635,7 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
                                                                        
                                                                        /* test we're inside uvspace bucket and triangle bounds */
                                                                        if (isect_point_quad_v2(uv, seam_subsection[0], seam_subsection[1], seam_subsection[2], seam_subsection[3])) {
+                                                                               float fac;
                                                                                
                                                                                /* We need to find the closest point along the face edge,
                                                                                 * getting the screen_px_from_*** wont work because our actual location
@@ -2670,9 +2670,9 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 #if 1
                                                                                                /* get the UV on the line since we want to copy the pixels from there for bleeding */
                                                                                                float uv_close[2];
-                                                                                               float fac = closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
-                                                                                               if      (fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
-                                                                                               else if (fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
+                                                                                               float uv_fac = closest_to_line_v2(uv_close, uv, tf_uv_pxoffset[fidx1], tf_uv_pxoffset[fidx2]);
+                                                                                               if      (uv_fac < 0.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx1]);
+                                                                                               else if (uv_fac > 1.0f) copy_v2_v2(uv_close, tf_uv_pxoffset[fidx2]);
 
                                                                                                if (side) {
                                                                                                        barycentric_weights_v2(tf_uv_pxoffset[0], tf_uv_pxoffset[2], tf_uv_pxoffset[3], uv_close, w);
@@ -2683,16 +2683,16 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
 #else                                                                                  /* this is buggy with quads, don't use for now */
 
                                                                                                /* Cheat, we know where we are along the edge so work out the weights from that */
-                                                                                               fac = fac1 + (fac * (fac2 - fac1));
+                                                                                               uv_fac = fac1 + (uv_fac * (fac2 - fac1));
 
                                                                                                w[0] = w[1] = w[2] = 0.0;
                                                                                                if (side) {
-                                                                                                       w[fidx1 ? fidx1 - 1 : 0] = 1.0f - fac;
-                                                                                                       w[fidx2 ? fidx2 - 1 : 0] = fac;
+                                                                                                       w[fidx1 ? fidx1 - 1 : 0] = 1.0f - uv_fac;
+                                                                                                       w[fidx2 ? fidx2 - 1 : 0] = uv_fac;
                                                                                                }
                                                                                                else {
-                                                                                                       w[fidx1] = 1.0f - fac;
-                                                                                                       w[fidx2] = fac;
+                                                                                                       w[fidx1] = 1.0f - uv_fac;
+                                                                                                       w[fidx2] = uv_fac;
                                                                                                }
 #endif
                                                                                        }
index 6b3017b8638cf81586f9c5e7124aca96aa1166bb..bb931dd1ff2a4560cf9a60b1636f2dbaa4dabd45 100644 (file)
@@ -1535,7 +1535,6 @@ static void enforce_locks(MDeformVert *odv, MDeformVert *ndv,
                }
                else {
                        /* reset the weights */
-                       unsigned int i;
                        MDeformWeight *dw_old = odv->dw;
                        MDeformWeight *dw_new = ndv->dw;
 
@@ -2049,7 +2048,6 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNU
        Object *ob = CTX_data_active_object(C);
        struct WPaintData *wpd;
        Mesh *me;
-       bDeformGroup *dg;
 
        float mat[4][4], imat[4][4];
        
@@ -2098,12 +2096,14 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNU
                return FALSE;
        }
 
-       /* check if we are attempting to paint onto a locked vertex group,
-        * and other options disallow it from doing anything useful */
-       dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
-       if (dg->flag & DG_LOCK_WEIGHT) {
-               BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting");
-               return FALSE;
+       {
+               /* check if we are attempting to paint onto a locked vertex group,
+                * and other options disallow it from doing anything useful */
+               bDeformGroup *dg = BLI_findlink(&ob->defbase, (ob->actdef - 1));
+               if (dg->flag & DG_LOCK_WEIGHT) {
+                       BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting");
+                       return FALSE;
+               }
        }
 
        /* ALLOCATIONS! no return after this line */
index e03c2fbfd21faa856c49cb4ebca423cfcdb30825..092ec32e7240ae2dd7e41d4a73d5343ba1601a38 100644 (file)
@@ -3536,8 +3536,6 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
        StrokeCache *cache = ss->cache;
        Brush *brush = paint_brush(&sd->paint);
 
-       int dx, dy;
-
        /* RNA_float_get_array(ptr, "location", cache->traced_location); */
 
        if (cache->first_time ||
@@ -3606,8 +3604,8 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
        if (brush->flag & BRUSH_ANCHORED) {
                int hit = 0;
 
-               dx = cache->mouse[0] - cache->initial_mouse[0];
-               dy = cache->mouse[1] - cache->initial_mouse[1];
+               const float dx = cache->mouse[0] - cache->initial_mouse[0];
+               const float dy = cache->mouse[1] - cache->initial_mouse[1];
 
                sd->anchored_size = cache->pixel_radius = sqrt(dx * dx + dy * dy);
 
@@ -3617,8 +3615,8 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
                        float halfway[2];
                        float out[3];
 
-                       halfway[0] = (float)dx * 0.5f + cache->initial_mouse[0];
-                       halfway[1] = (float)dy * 0.5f + cache->initial_mouse[1];
+                       halfway[0] = dx * 0.5f + cache->initial_mouse[0];
+                       halfway[1] = dy * 0.5f + cache->initial_mouse[1];
 
                        if (sculpt_stroke_get_location(C, out, halfway)) {
                                copy_v3_v3(sd->anchored_location, out);
@@ -3665,8 +3663,8 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob,
        sculpt_update_brush_delta(sd, ob, brush);
 
        if (brush->sculpt_tool == SCULPT_TOOL_ROTATE) {
-               dx = cache->mouse[0] - cache->initial_mouse[0];
-               dy = cache->mouse[1] - cache->initial_mouse[1];
+               const float dx = cache->mouse[0] - cache->initial_mouse[0];
+               const float dy = cache->mouse[1] - cache->initial_mouse[1];
 
                cache->vertex_rotation = -atan2f(dx, dy) * cache->bstrength;
 
index c41d2521ee88dd78450ce604dabf8771027a213a..7e232a02536bbee0147d7fa3899d05f793f2742c 100644 (file)
@@ -900,7 +900,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
                }
                else {
                        /* get settings from active particle system instead */
-                       PointerRNA *ptr = get_pointer_type(path, &RNA_ParticleSystem);
+                       ptr = get_pointer_type(path, &RNA_ParticleSystem);
                        
                        if (ptr && ptr->data) {
                                ParticleSettings *part = ((ParticleSystem *)ptr->data)->part;
index 4f62d3fdc2f1ff7c0485f6cec232b22a1c11130d..7e3fabd1f664ae8278b66217c892f50e394aa869 100644 (file)
@@ -291,7 +291,6 @@ static int select_invoke(bContext *C, wmOperator *op, wmEvent *event)
                MovieTrackingTrack *track = tracking_marker_check_slide(C, event, NULL, NULL, NULL);
 
                if (track) {
-                       SpaceClip *sc = CTX_wm_space_clip(C);
                        MovieClip *clip = ED_space_clip_get_clip(sc);
 
                        clip->tracking.act_track = track;
index 92f014fd80403ebbe9106c2b49c952a82a80d698..5c8e7e99a8c2c70c33f6f58199515ae5c1f23a26 100644 (file)
@@ -849,8 +849,6 @@ static void draw_nla_channel_list_gl(bAnimContext *ac, ListBase *anim_data, View
                                
                                /* draw NLA-action line 'status-icons' - only when there's an action */
                                if ((ale->type == ANIMTYPE_NLAACTION) && (ale->data)) {
-                                       AnimData *adt = ale->adt;
-                                       
                                        offset += 16;
                                        
                                        /* now draw some indicator icons  */
index 470f82195a4b41c84a45c97a63c6c40e3a337db3..67508f2087a18d4baa375e6ebd8590fac875736a 100644 (file)
@@ -3098,7 +3098,6 @@ void draw_nodespace_back_pix(const bContext *C, ARegion *ar, SpaceNode *snode)
                void *lock;
                ImBuf *ibuf = BKE_image_acquire_ibuf(ima, NULL, &lock);
                if (ibuf) {
-                       SpaceNode *snode = CTX_wm_space_node(C);
                        float x, y; 
                        unsigned char *display_buffer;
                        void *cache_handle;
index 64a8d96a74f70e8484b6105aa4e0f1fd8a98543b..f0afc647ed54bde2d787f07564e6110acd439043 100644 (file)
@@ -1935,7 +1935,7 @@ static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
        bNodeTree *ntree = snode->edittree;
        bNode *gnode = node_tree_get_editgroup(snode->nodetree);
        float gnode_x = 0.0f, gnode_y = 0.0f;
-       bNode *node, *new_node;
+       bNode *node;
        bNodeLink *link, *newlink;
 
        ED_preview_kill_jobs(C);
@@ -1950,6 +1950,7 @@ static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
        
        for (node = ntree->nodes.first; node; node = node->next) {
                if (node->flag & SELECT) {
+                       bNode *new_node;
                        new_node = nodeCopyNode(NULL, node);
                        BKE_node_clipboard_add_node(new_node);
                }
index 3d93a6c14a1656a5821c3e8711037b75bda1368d..42480c0c2d9aa72a12882d7f46a2ccfb87015913 100644 (file)
@@ -147,7 +147,7 @@ static void node_socket_remove(Main *bmain, bNodeTree *ntree, bNode *node_to, bN
 static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_to, bNodeSocket *sock_to, bNodeTemplate *ntemp, int sock_num)
 {
        bNode *node_from;
-       bNodeSocket *sock_from;
+       bNodeSocket *sock_from_tmp;
        bNode *node_prev = NULL;
 
        /* unlink existing node */
@@ -183,8 +183,8 @@ static void node_socket_add_replace(Main *bmain, bNodeTree *ntree, bNode *node_t
        nodeSetActive(ntree, node_from);
 
        /* add link */
-       sock_from = BLI_findlink(&node_from->outputs, sock_num);
-       nodeAddLink(ntree, node_from, sock_from, node_to, sock_to);
+       sock_from_tmp = BLI_findlink(&node_from->outputs, sock_num);
+       nodeAddLink(ntree, node_from, sock_from_tmp, node_to, sock_to);
 
        /* copy input sockets from previous node */
        if (node_prev && node_from != node_prev) {
index 95d827f9392826e6319f5065f9fe21f1fef5efe7..c22ab90906a2e6d712b7364efbfbb5122eefd14f 100644 (file)
@@ -2620,7 +2620,6 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
 {
        Scene *scene = CTX_data_scene(C);
        Editing *ed = BKE_sequencer_editing_get(scene, FALSE);
-       Sequence *seq;
 
        ListBase nseqbase = {NULL, NULL};
 
@@ -2656,8 +2655,11 @@ static int sequencer_copy_exec(bContext *C, wmOperator *op)
        seqbase_clipboard_frame = scene->r.cfra;
 
        /* Need to remove anything that references the current scene */
-       for (seq = seqbase_clipboard.first; seq; seq = seq->next) {
-               seq_copy_del_sound(scene, seq);
+       {
+               Sequence *seq;
+               for (seq = seqbase_clipboard.first; seq; seq = seq->next) {
+                       seq_copy_del_sound(scene, seq);
+               }
        }
 
        return OPERATOR_FINISHED;
index e4c21a9c2c83c9989e2750585f6dfce9eb191365..cded7bbbdfcb89344d59a19098a44b002fa41218 100644 (file)
@@ -533,8 +533,7 @@ static void update_tface_color_layer(DerivedMesh *dm)
                        }
                        else {
                                float col[3];
-                               Material *ma = give_current_material(Gtexdraw.ob, mface[i].mat_nr + 1);
-                               
+
                                if (ma) {
                                        if (Gtexdraw.color_profile) linearrgb_to_srgb_v3_v3(col, &ma->r);
                                        else copy_v3_v3(col, &ma->r);
index 1f7bae0b23eed679de06edc2101cbab6dd254acb..0a55df192ea6d5437e86c2344acc94ff06cee9e9 100644 (file)
@@ -158,7 +158,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
        TransformProperties *tfp;
        float median[NBR_TRANSFORM_PROPERTIES], ve_median[NBR_TRANSFORM_PROPERTIES];
        int tot, totedgedata, totcurvedata, totlattdata, totskinradius, totcurvebweight;
-       int meshdata = FALSE, i;
+       int meshdata = FALSE;
        char defstr[320];
        PointerRNA data_ptr;
 
@@ -470,6 +470,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
 
        }
        else { /* apply */
+               int i;
+
                memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median));
 
                if (v3d->flag & V3D_GLOBAL_STATS) {
@@ -485,10 +487,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
                        Mesh *me = ob->data;
                        BMEditMesh *em = me->edit_btmesh;
                        BMesh *bm = em->bm;
-                       BMVert *eve;
                        BMIter iter;
 
                        if (len_v3(&median[LOC_X]) > 0.000001f) {
+                               BMVert *eve;
 
                                BM_ITER_MESH (eve, &iter, bm, BM_VERTS_OF_MESH) {
                                        if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
index dc3cfa41e370c8905de64664fb31ba55f38121b9..a111799a27cfdfd446ca9d985338bfcf6a556702 100644 (file)
@@ -2014,12 +2014,10 @@ static int do_object_pose_box_select(bContext *C, ViewContext *vc, rcti *rect, i
                        }
                        
                        if (bone_selected) {
-                               Object *ob = base->object;
-                               
-                               if (ob && (ob->type == OB_ARMATURE)) {
-                                       bArmature *arm = ob->data;
+                               if (base->object && (base->object->type == OB_ARMATURE)) {
+                                       bArmature *arm = base->object->data;
                                        
-                                       WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, ob);
+                                       WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, base->object);
                                        
                                        if (arm && (arm->flag & ARM_HAS_VIZ_DEPS)) {
                                                /* mask modifier ('armature' mode), etc. */
index 39b0ab4b3a654db431b5629808698a6082dfb426..1ce9953418119d1e55e8d4f0e6da7903b4b43df1 100644 (file)
@@ -4860,10 +4860,9 @@ static int createSlideVerts(TransInfo *t)
 {
        BMEditMesh *em = BMEdit_FromObject(t->obedit);
        BMesh *bm = em->bm;
-       BMIter iter, iter2;
+       BMIter iter;
        BMEdge *e, *e1;
        BMVert *v, *v2, *first;
-       BMLoop *l, *l1, *l2;
        TransDataSlideVert *sv_array;
        BMBVHTree *btree = BMBVH_NewBVH(em, BMBVH_RESPECT_HIDDEN, NULL, NULL);
        SmallHash table;
@@ -4903,6 +4902,7 @@ static int createSlideVerts(TransInfo *t)
        /*ensure valid selection*/
        BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
                if (BM_elem_flag_test(v, BM_ELEM_SELECT)) {
+                       BMIter iter2;
                        numsel = 0;
                        BM_ITER_ELEM (e, &iter2, v, BM_EDGES_OF_VERT) {
                                if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
@@ -4955,6 +4955,8 @@ static int createSlideVerts(TransInfo *t)
 
        j = 0;
        while (1) {
+               BMLoop *l, *l1, *l2;
+
                v = NULL;
                BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
                        if (BM_elem_flag_test(v, BM_ELEM_TAG))
@@ -5088,7 +5090,7 @@ static int createSlideVerts(TransInfo *t)
                if (BM_elem_flag_test(e, BM_ELEM_SELECT)) {
                        BMIter iter2;
                        BMEdge *e2;
-                       float vec1[3], mval[2] = {t->mval[0], t->mval[1]}, d;
+                       float vec1[3], d;
 
                        /* search cross edges for visible edge to the mouse cursor,
                         * then use the shared vertex to calculate screen vector*/
index 0e25739c34a8b741fc9571c32714dd469208377b..845d5b73f0c086b51584706e29a293b175c5a3d1 100644 (file)
@@ -631,7 +631,6 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                                        /* if there's an edge available, use that for the tangent */
                                        if (em->bm->totedgesel >= 1) {
                                                BMEdge *eed = NULL;
-                                               BMIter iter;
                                                
                                                BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) {
                                                        if (BM_elem_flag_test(eed, BM_ELEM_SELECT)) {
@@ -746,14 +745,14 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
                        MetaBall *mb = obedit->data;
                        
                        if (mb->lastelem) {
-                               float mat[4][4];
+                               float qmat[3][3];
 
                                /* Rotation of MetaElem is stored in quat */
-                               quat_to_mat4(mat, mb->lastelem->quat);
+                               quat_to_mat3(qmat, mb->lastelem->quat);
 
-                               copy_v3_v3(normal, mat[2]);
+                               copy_v3_v3(normal, qmat[2]);
 
-                               negate_v3_v3(plane, mat[1]);
+                               negate_v3_v3(plane, qmat[1]);
                                
                                result = ORIENTATION_FACE;
                        }
index 6e655faf35f14ae7b5db88b201fc6f9df9084335..e3d52fcaa9b263286eefb3e5e86bcf8c41204496 100644 (file)
@@ -170,7 +170,6 @@ void ED_object_assign_active_image(Main *bmain, Object *ob, int mat_nr, Image *i
 void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *ima, Image *previma)
 {
        BMEditMesh *em;
-       BMFace *efa;
        BMIter iter;
        MTexPoly *tf;
        int update = 0;
@@ -198,6 +197,8 @@ void ED_uvedit_assign_image(Main *bmain, Scene *scene, Object *obedit, Image *im
                        ED_object_assign_active_image(bmain, obedit, efa->mat_nr + 1, ima);
        }
        else {
+               BMFace *efa;
+
                /* old shading system, assign image to selected faces */
 #ifdef USE_SWITCH_ASPECT
                float prev_aspect[2], fprev_aspect;
@@ -1310,9 +1311,7 @@ static void weld_align_uv(bContext *C, int tool)
        Object *obedit;
        Image *ima;
        BMEditMesh *em;
-       BMIter iter, liter;
        MTexPoly *tf;
-       MLoopUV *luv;
        float cent[2], min[2], max[2];
        
        scene = CTX_data_scene(C);
@@ -1324,6 +1323,7 @@ static void weld_align_uv(bContext *C, int tool)
        INIT_MINMAX2(min, max);
 
        if (tool == 'a') {
+               BMIter iter, liter;
                BMFace *efa;
                BMLoop *l;
 
@@ -1335,7 +1335,7 @@ static void weld_align_uv(bContext *C, int tool)
 
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                if (uvedit_uv_select_test(em, scene, l)) {
-                                       luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+                                       MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        DO_MINMAX2(luv->uv, min, max);
                                }
                        }
@@ -1347,6 +1347,7 @@ static void weld_align_uv(bContext *C, int tool)
        uvedit_center(scene, ima, obedit, cent, 0);
 
        if (tool == 'x' || tool == 'w') {
+               BMIter iter, liter;
                BMFace *efa;
                BMLoop *l;
 
@@ -1357,7 +1358,7 @@ static void weld_align_uv(bContext *C, int tool)
 
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                if (uvedit_uv_select_test(em, scene, l)) {
-                                       luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+                                       MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        luv->uv[0] = cent[0];
                                }
 
@@ -1366,6 +1367,7 @@ static void weld_align_uv(bContext *C, int tool)
        }
 
        if (tool == 'y' || tool == 'w') {
+               BMIter iter, liter;
                BMFace *efa;
                BMLoop *l;
 
@@ -1376,7 +1378,7 @@ static void weld_align_uv(bContext *C, int tool)
 
                        BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) {
                                if (uvedit_uv_select_test(em, scene, l)) {
-                                       luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
+                                       MLoopUV *luv = CustomData_bmesh_get(&em->bm->ldata, l->head.data, CD_MLOOPUV);
                                        luv->uv[1] = cent[1];
                                }
 
index 7c06fbd2a9dc234f5e0d63a0adfde08c8a399d26..26f8641743ea6c1d8fb3e03efda4d41240ac1e9e 100644 (file)
@@ -223,7 +223,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                BMLoop *ls[3];
                float *co[4];
                float *uv[4];
-               int i, lsel;
+               int lsel;
 
                if ((BM_elem_flag_test(efa, BM_ELEM_HIDDEN)) || (sel && BM_elem_flag_test(efa, BM_ELEM_SELECT) == 0))
                        continue;
@@ -245,6 +245,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
                // tf = CustomData_bmesh_get(&em->bm->pdata, efa->head.data, CD_MTEXPOLY);  // UNUSED
 
                if (efa->len == 3 || efa->len == 4) {
+                       int i;
                        /* for quads let parametrize split, it can make better decisions
                         * about which split is best for unwrapping than scanfill */
                        i = 0;
@@ -291,6 +292,7 @@ static ParamHandle *construct_param_handle(Scene *scene, BMEditMesh *em,
 
                        BLI_scanfill_calc_ex(&sf_ctx, TRUE, efa->no);
                        for (sf_tri = sf_ctx.fillfacebase.first; sf_tri; sf_tri = sf_tri->next) {
+                               int i;
                                ls[0] = sf_tri->v1->tmp.p;
                                ls[1] = sf_tri->v2->tmp.p;
                                ls[2] = sf_tri->v3->tmp.p;