code cleanup: shadowing
This commit is contained in:
@@ -1116,12 +1116,12 @@ static void calc_weightpaint_vert_color(
|
||||
}
|
||||
}
|
||||
|
||||
static DMWeightColorInfo dm_wcinfo;
|
||||
static DMWeightColorInfo G_dm_wcinfo;
|
||||
|
||||
void vDM_ColorBand_store(const ColorBand *coba, const char alert_color[4])
|
||||
{
|
||||
dm_wcinfo.coba = coba;
|
||||
dm_wcinfo.alert_color = alert_color;
|
||||
G_dm_wcinfo.coba = coba;
|
||||
G_dm_wcinfo.alert_color = alert_color;
|
||||
}
|
||||
|
||||
/* return an array of vertex weight colors, caller must free.
|
||||
@@ -1219,10 +1219,10 @@ void DM_update_weight_mcol(Object *ob, DerivedMesh *dm, int const draw_flag,
|
||||
if (indices)
|
||||
MEM_freeN(w);
|
||||
}
|
||||
|
||||
/* No weights given, take them from active vgroup(s). */
|
||||
else
|
||||
wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, &dm_wcinfo);
|
||||
else {
|
||||
/* No weights given, take them from active vgroup(s). */
|
||||
wtcol_v = calc_weightpaint_vert_array(ob, dm, draw_flag, &G_dm_wcinfo);
|
||||
}
|
||||
|
||||
/* now add to loops, so the data can be passed through the modifier stack */
|
||||
/* If no CD_PREVIEW_MLOOPCOL existed yet, we have to add a new one! */
|
||||
|
||||
@@ -1588,13 +1588,13 @@ static void appendPolyLineVert(ListBase *lb, unsigned int index)
|
||||
|
||||
void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int edge_users_test)
|
||||
{
|
||||
MVert *mverts = dm->getVertArray(dm);
|
||||
MVert *mvert = dm->getVertArray(dm);
|
||||
MEdge *med, *medge = dm->getEdgeArray(dm);
|
||||
MPoly *mp, *mpoly = dm->getPolyArray(dm);
|
||||
MLoop *mloop = dm->getLoopArray(dm);
|
||||
|
||||
int totedge = dm->getNumEdges(dm);
|
||||
int totpoly = dm->getNumPolys(dm);
|
||||
int dm_totedge = dm->getNumEdges(dm);
|
||||
int dm_totpoly = dm->getNumPolys(dm);
|
||||
int totedges = 0;
|
||||
int i;
|
||||
|
||||
@@ -1604,8 +1604,8 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
|
||||
ListBase edges = {NULL, NULL};
|
||||
|
||||
/* get boundary edges */
|
||||
edge_users = MEM_callocN(sizeof(int) * totedge, __func__);
|
||||
for (i = 0, mp = mpoly; i < totpoly; i++, mp++) {
|
||||
edge_users = MEM_callocN(sizeof(int) * dm_totedge, __func__);
|
||||
for (i = 0, mp = mpoly; i < dm_totpoly; i++, mp++) {
|
||||
MLoop *ml = &mloop[mp->loopstart];
|
||||
int j;
|
||||
for (j = 0; j < mp->totloop; j++, ml++) {
|
||||
@@ -1615,7 +1615,7 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
|
||||
|
||||
/* create edges from all faces (so as to find edges not in any faces) */
|
||||
med = medge;
|
||||
for (i = 0; i < totedge; i++, med++) {
|
||||
for (i = 0; i < dm_totedge; i++, med++) {
|
||||
if (edge_users[i] == edge_users_test) {
|
||||
EdgeLink *edl = MEM_callocN(sizeof(EdgeLink), "EdgeLink");
|
||||
edl->edge = med;
|
||||
@@ -1705,7 +1705,7 @@ void BKE_mesh_to_curve_nurblist(DerivedMesh *dm, ListBase *nurblist, const int e
|
||||
/* add points */
|
||||
vl = polyline.first;
|
||||
for (i = 0, bp = nu->bp; i < totpoly; i++, bp++, vl = (VertLink *)vl->next) {
|
||||
copy_v3_v3(bp->vec, mverts[vl->index].co);
|
||||
copy_v3_v3(bp->vec, mvert[vl->index].co);
|
||||
bp->f1 = SELECT;
|
||||
bp->radius = bp->weight = 1.0;
|
||||
}
|
||||
|
||||
@@ -3103,7 +3103,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
int numTex, numCol;
|
||||
int hasPCol, hasOrigSpace;
|
||||
int gridInternalEdges;
|
||||
float *w = NULL;
|
||||
WeightTable wtable = {0};
|
||||
/* MCol *mcol; */ /* UNUSED */
|
||||
MEdge *medge = NULL;
|
||||
@@ -3291,7 +3290,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
|
||||
int numFinalEdges = numVerts * (gridSideEdges + gridInternalEdges);
|
||||
int origIndex = GET_INT_FROM_POINTER(ccgSubSurf_getFaceFaceHandle(f));
|
||||
int g2_wid = gridCuts + 2;
|
||||
float *w2;
|
||||
float *w, *w2;
|
||||
int s, x, y;
|
||||
|
||||
w = get_ss_weights(&wtable, gridCuts, numVerts);
|
||||
|
||||
@@ -160,19 +160,19 @@ static int clamp_index(const int x, const int len)
|
||||
* isn't there should be... */
|
||||
#define ARRAY_SWAP(elemtype, arr1, arr2) \
|
||||
{ \
|
||||
int i; \
|
||||
int i_; \
|
||||
elemtype *arr_tmp = NULL; \
|
||||
BLI_array_declare(arr_tmp); \
|
||||
for (i = 0; i < BLI_array_count(arr1); i++) { \
|
||||
BLI_array_append(arr_tmp, arr1[i]); \
|
||||
for (i_ = 0; i_ < BLI_array_count(arr1); i_++) { \
|
||||
BLI_array_append(arr_tmp, arr1[i_]); \
|
||||
} \
|
||||
BLI_array_empty(arr1); \
|
||||
for (i = 0; i < BLI_array_count(arr2); i++) { \
|
||||
BLI_array_append(arr1, arr2[i]); \
|
||||
for (i_ = 0; i_ < BLI_array_count(arr2); i_++) { \
|
||||
BLI_array_append(arr1, arr2[i_]); \
|
||||
} \
|
||||
BLI_array_empty(arr2); \
|
||||
for (i = 0; i < BLI_array_count(arr_tmp); i++) { \
|
||||
BLI_array_append(arr2, arr_tmp[i]); \
|
||||
for (i_ = 0; i_ < BLI_array_count(arr_tmp); i_++) { \
|
||||
BLI_array_append(arr2, arr_tmp[i_]); \
|
||||
} \
|
||||
BLI_array_free(arr_tmp); \
|
||||
} (void)0
|
||||
|
||||
@@ -810,9 +810,9 @@ static EPath *edge_find_shortest_path(BMesh *bm, BMOperator *op, BMEdge *edge, E
|
||||
}
|
||||
|
||||
if (use_restrict) {
|
||||
int *group = (int *)BMO_slot_map_data_get(slot_restrict, e);
|
||||
if (group) {
|
||||
if (!(*group & path->group)) {
|
||||
int *group_flag = (int *)BMO_slot_map_data_get(slot_restrict, e);
|
||||
if (group_flag) {
|
||||
if (!(*group_flag & path->group)) {
|
||||
v2 = NULL;
|
||||
continue;
|
||||
}
|
||||
@@ -925,15 +925,12 @@ void bmo_edgenet_fill_exec(BMesh *bm, BMOperator *op)
|
||||
BMO_elem_flag_enable(bm, f, ELE_ORIG);
|
||||
}
|
||||
|
||||
i = 0;
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) {
|
||||
BM_elem_index_set(e, i); /* set_inline */
|
||||
|
||||
if (!BMO_elem_flag_test(bm, e, EDGE_MARK)) {
|
||||
edata[i].tag = 2;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
bm->elem_index_dirty &= ~BM_EDGE;
|
||||
|
||||
|
||||
@@ -181,7 +181,6 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool
|
||||
unsigned vert_seek_b_tot = 0;
|
||||
#endif
|
||||
|
||||
BMVert *v;
|
||||
BMIter iter;
|
||||
|
||||
const unsigned int offset = 0;
|
||||
@@ -192,12 +191,14 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool
|
||||
/* if tag_only is set, we assume the caller knows what verts to tag
|
||||
* needed for the operator */
|
||||
if (tag_only == false) {
|
||||
BMVert *v;
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
BM_elem_flag_enable(v, BM_ELEM_TAG);
|
||||
}
|
||||
}
|
||||
|
||||
for (iter_step = 0; iter_step < iterations; iter_step++) {
|
||||
BMVert *v;
|
||||
bool iter_done;
|
||||
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
@@ -223,7 +224,6 @@ void BM_mesh_decimate_unsubdivide_ex(BMesh *bm, const int iterations, const bool
|
||||
unsigned int i;
|
||||
#endif
|
||||
BMVert *v_first = NULL;
|
||||
BMVert *v;
|
||||
|
||||
/* we could avoid iterating from the start each time */
|
||||
BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) {
|
||||
|
||||
@@ -48,7 +48,6 @@ static void bm_edgesplit_validate_seams(BMesh *bm)
|
||||
BMEdge *e;
|
||||
|
||||
unsigned char *vtouch;
|
||||
unsigned char *vt;
|
||||
|
||||
BM_mesh_elem_index_ensure(bm, BM_VERT);
|
||||
|
||||
@@ -65,6 +64,7 @@ static void bm_edgesplit_validate_seams(BMesh *bm)
|
||||
BM_elem_flag_disable(e, BM_ELEM_TAG);
|
||||
}
|
||||
else if (BM_edge_is_boundary(e)) {
|
||||
unsigned char *vt;
|
||||
vt = &vtouch[BM_elem_index_get(e->v1)]; if (*vt < 2) (*vt)++;
|
||||
vt = &vtouch[BM_elem_index_get(e->v2)]; if (*vt < 2) (*vt)++;
|
||||
|
||||
|
||||
@@ -394,8 +394,6 @@ static void texture_changed(Main *bmain, Tex *tex)
|
||||
|
||||
if (dm && totmaterial && material) {
|
||||
for (a = 0; a < *totmaterial; a++) {
|
||||
Material *ma;
|
||||
|
||||
if (ob->matbits && ob->matbits[a])
|
||||
ma = ob->mat[a];
|
||||
else
|
||||
|
||||
@@ -458,7 +458,6 @@ static void ruler_info_draw_pixel(const struct bContext *C, ARegion *ar, void *a
|
||||
float quat[4];
|
||||
float axis[3];
|
||||
float angle;
|
||||
int j;
|
||||
const float px_scale = (ED_view3d_pixel_size(rv3d, ruler_item->co[1]) *
|
||||
min_fff(arc_size,
|
||||
len_v2v2(co_ss[0], co_ss[1]) / 2.0f,
|
||||
|
||||
Reference in New Issue
Block a user