Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-09-09 16:43:09 +0300
committerJacques Lucke <jacques@blender.org>2020-09-09 16:43:27 +0300
commitddf4f2896878e3fd4a0f79d712a5e7b900b0cf7e (patch)
tree34d7b7b95eac92c2ab9bc596b1dd113fd2334381 /source/blender/blenkernel/intern/CCGSubSurf_inline.h
parent842f52d418aaccae45c8e400eb0a8bddef0dbb51 (diff)
Cleanup: reduce variable scope
Diffstat (limited to 'source/blender/blenkernel/intern/CCGSubSurf_inline.h')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_inline.h24
1 files changed, 8 insertions, 16 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_inline.h b/source/blender/blenkernel/intern/CCGSubSurf_inline.h
index 91a7129b433..4681602c071 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_inline.h
+++ b/source/blender/blenkernel/intern/CCGSubSurf_inline.h
@@ -142,8 +142,7 @@ BLI_INLINE float *ccg_face_getIFNo(
BLI_INLINE int ccg_face_getVertIndex(CCGFace *f, CCGVert *v)
{
- int i;
- for (i = 0; i < f->numVerts; i++) {
+ for (int i = 0; i < f->numVerts; i++) {
if (FACE_getVerts(f)[i] == v) {
return i;
}
@@ -153,8 +152,7 @@ BLI_INLINE int ccg_face_getVertIndex(CCGFace *f, CCGVert *v)
BLI_INLINE int ccg_face_getEdgeIndex(CCGFace *f, CCGEdge *e)
{
- int i;
- for (i = 0; i < f->numVerts; i++) {
+ for (int i = 0; i < f->numVerts; i++) {
if (FACE_getEdges(f)[i] == e) {
return i;
}
@@ -215,8 +213,7 @@ BLI_INLINE void Normalize(float no[3])
BLI_INLINE bool VertDataEqual(const float a[], const float b[], const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
if (a[i] != b[i]) {
return false;
}
@@ -231,32 +228,28 @@ BLI_INLINE void VertDataZero(float v[], const CCGSubSurf *ss)
BLI_INLINE void VertDataCopy(float dst[], const float src[], const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
dst[i] = src[i];
}
}
BLI_INLINE void VertDataAdd(float a[], const float b[], const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
a[i] += b[i];
}
}
BLI_INLINE void VertDataSub(float a[], const float b[], const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
a[i] -= b[i];
}
}
BLI_INLINE void VertDataMulN(float v[], float f, const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
v[i] *= f;
}
}
@@ -268,8 +261,7 @@ BLI_INLINE void VertDataAvg4(float v[],
const float d[],
const CCGSubSurf *ss)
{
- int i;
- for (i = 0; i < ss->meshIFC.numLayers; i++) {
+ for (int i = 0; i < ss->meshIFC.numLayers; i++) {
v[i] = (a[i] + b[i] + c[i] + d[i]) * 0.25f;
}
}