From fca202566fb0d73aca46d8f68c8e8dd33d421c09 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 10 Jan 2018 14:58:09 +0100 Subject: Subsurf: Remove increment of unused variable --- source/blender/blenkernel/intern/subsurf_ccg.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c') diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index ecb0f76fd62..ef2a2db4bf9 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1484,7 +1484,6 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) int totface; int gridSize = ccgSubSurf_getGridSize(ss); int edgeSize = ccgSubSurf_getEdgeSize(ss); - int i = 0; MLoop *mv; /* DMFlagMat *faceFlags = ccgdm->faceFlags; */ /* UNUSED */ @@ -1497,7 +1496,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) ehash = BLI_edgehash_new_ex(__func__, ccgdm->dm.numEdgeData); medge = ccgdm->dm.getEdgeArray((DerivedMesh *)ccgdm); - for (i = 0; i < ccgdm->dm.numEdgeData; i++) { + for (int i = 0; i < ccgdm->dm.numEdgeData; i++) { BLI_edgehash_insert(ehash, medge[i].v1, medge[i].v2, SET_INT_IN_POINTER(i)); } @@ -1532,19 +1531,19 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) mv->v = v1; mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v1, v2)); - mv++; i++; + mv++; mv->v = v2; mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v2, v3)); - mv++; i++; + mv++; mv->v = v3; mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v3, v4)); - mv++; i++; + mv++; mv->v = v4; mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v4, v1)); - mv++; i++; + mv++; } } } -- cgit v1.2.3 From 76bdd40bfdc7a212c70c2032edaa6faef1423c9f Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 10 Jan 2018 14:58:49 +0100 Subject: Subsurf: Loop array should not be called mv mv is a mesh vertex, not loop. --- source/blender/blenkernel/intern/subsurf_ccg.c | 28 +++++++++++++------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source/blender/blenkernel/intern/subsurf_ccg.c') diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index ef2a2db4bf9..d2f325fb3c4 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1484,7 +1484,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) int totface; int gridSize = ccgSubSurf_getGridSize(ss); int edgeSize = ccgSubSurf_getEdgeSize(ss); - MLoop *mv; + MLoop *ml; /* DMFlagMat *faceFlags = ccgdm->faceFlags; */ /* UNUSED */ if (!ccgdm->ehash) { @@ -1507,7 +1507,7 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) BLI_rw_mutex_lock(&ccgdm->loops_cache_rwlock, THREAD_LOCK_READ); totface = ccgSubSurf_getNumFaces(ss); - mv = mloop; + ml = mloop; for (index = 0; index < totface; index++) { CCGFace *f = ccgdm->faceMap[index].face; int x, y, S, numVerts = ccgSubSurf_getFaceNumVerts(f); @@ -1529,21 +1529,21 @@ static void ccgDM_copyFinalLoopArray(DerivedMesh *dm, MLoop *mloop) v4 = getFaceIndex(ss, f, S, x + 1, y + 0, edgeSize, gridSize); - mv->v = v1; - mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v1, v2)); - mv++; + ml->v = v1; + ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v1, v2)); + ml++; - mv->v = v2; - mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v2, v3)); - mv++; + ml->v = v2; + ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v2, v3)); + ml++; - mv->v = v3; - mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v3, v4)); - mv++; + ml->v = v3; + ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v3, v4)); + ml++; - mv->v = v4; - mv->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v4, v1)); - mv++; + ml->v = v4; + ml->e = GET_UINT_FROM_POINTER(BLI_edgehash_lookup(ccgdm->ehash, v4, v1)); + ml++; } } } -- cgit v1.2.3