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:
authorCampbell Barton <ideasman42@gmail.com>2019-09-07 17:12:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-09-07 17:23:25 +0300
commit0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch)
tree0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/blenkernel/intern
parentab823176d31dc155645de733f1cd4fbd6ad74592 (diff)
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement (already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c4
-rw-r--r--source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c14
-rw-r--r--source/blender/blenkernel/intern/brush.c8
-rw-r--r--source/blender/blenkernel/intern/collision.c2
-rw-r--r--source/blender/blenkernel/intern/curve.c10
-rw-r--r--source/blender/blenkernel/intern/customdata.c148
-rw-r--r--source/blender/blenkernel/intern/icons.c10
-rw-r--r--source/blender/blenkernel/intern/multires.c98
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c2
-rw-r--r--source/blender/blenkernel/intern/node.c12
-rw-r--r--source/blender/blenkernel/intern/ocean.c58
-rw-r--r--source/blender/blenkernel/intern/paint.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c10
-rw-r--r--source/blender/blenkernel/intern/particle_child.c2
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c12
-rw-r--r--source/blender/blenkernel/intern/particle_system.c2
-rw-r--r--source/blender/blenkernel/intern/pbvh.c72
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c24
-rw-r--r--source/blender/blenkernel/intern/studiolight.c10
-rw-r--r--source/blender/blenkernel/intern/subdiv_converter_mesh.c2
-rw-r--r--source/blender/blenkernel/intern/subdiv_eval.c2
-rw-r--r--source/blender/blenkernel/intern/subdiv_mesh.c6
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c12
-rw-r--r--source/blender/blenkernel/intern/tracking.c6
-rw-r--r--source/blender/blenkernel/intern/tracking_auto.c20
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c14
-rw-r--r--source/blender/blenkernel/intern/tracking_util.c6
28 files changed, 286 insertions, 286 deletions
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
index 973d5415567..699075f6cff 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv.c
@@ -697,7 +697,7 @@ static void opensubdiv_evaluateNGonFaceGrids(CCGSubSurf *ss,
int x, S0 = 0, S1 = 0;
bool flip;
- for (x = 0; x < face->numVerts; ++x) {
+ for (x = 0; x < face->numVerts; x++) {
if (all_verts[x] == edge->v0) {
S0 = x;
}
@@ -806,7 +806,7 @@ void ccgSubSurf_prepareTopologyRefiner(CCGSubSurf *ss, DerivedMesh *dm)
const MPoly *mpoly = dm->getPolyArray(dm);
int poly;
ss->numGrids = 0;
- for (poly = 0; poly < num_polys; ++poly) {
+ for (poly = 0; poly < num_polys; poly++) {
ss->numGrids += mpoly[poly].totloop;
}
}
diff --git a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
index eb04d13d4a0..e77b65eca25 100644
--- a/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
+++ b/source/blender/blenkernel/intern/CCGSubSurf_opensubdiv_converter.c
@@ -172,7 +172,7 @@ static int conv_dm_get_num_edge_faces(const OpenSubdiv_Converter *converter, int
for (loop = 0; loop < mpoly->totloop; loop++) {
const MLoop *mloop = &storage->mloop[mpoly->loopstart + loop];
if (mloop->e == edge) {
- ++num;
+ num++;
break;
}
}
@@ -226,7 +226,7 @@ static int conv_dm_get_num_vert_edges(const OpenSubdiv_Converter *converter, int
for (edge = 0; edge < dm->getNumEdges(dm); edge++) {
const MEdge *medge = &user_data->medge[edge];
if (medge->v1 == vert || medge->v2 == vert) {
- ++num;
+ num++;
}
}
return num;
@@ -268,7 +268,7 @@ static int conv_dm_get_num_vert_faces(const OpenSubdiv_Converter *converter, int
for (loop = 0; loop < mpoly->totloop; loop++) {
const MLoop *mloop = &storage->mloop[mpoly->loopstart + loop];
if (mloop->v == vert) {
- ++num;
+ num++;
break;
}
}
@@ -357,23 +357,23 @@ static void conv_dm_precalc_uv_layer(const OpenSubdiv_Converter *converter, int
* The idea here is that we need to pass individual islands to OpenSubdiv.
*/
storage->num_uvs = 0;
- for (int island = 0; island < storage->island_store.islands_num; ++island) {
+ for (int island = 0; island < storage->island_store.islands_num; island++) {
MeshElemMap *island_poly_map = storage->island_store.islands[island];
- for (int poly = 0; poly < island_poly_map->count; ++poly) {
+ for (int poly = 0; poly < island_poly_map->count; poly++) {
int poly_index = island_poly_map->indices[poly];
/* Within the same UV island we should share UV points across
* loops. Otherwise each poly will be subdivided individually
* which we don't really want.
*/
const MPoly *mpoly = &storage->mpoly[poly_index];
- for (int loop = 0; loop < mpoly->totloop; ++loop) {
+ for (int loop = 0; loop < mpoly->totloop; loop++) {
const MLoopUV *luv = &mloopuv[mpoly->loopstart + loop];
bool found = false;
/* TODO(sergey): Quite bad loop, which gives us O(N^2)
* complexity here. But how can we do it smarter, hopefully
* without requiring lots of additional memory.
*/
- for (int i = 0; i < storage->num_uvs; ++i) {
+ for (int i = 0; i < storage->num_uvs; i++) {
if (equals_v2v2(luv->uv, &storage->uvs[2 * i])) {
storage->face_uvs[mpoly->loopstart + loop] = i;
found = true;
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index 83e4a582ff1..126dff393ba 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -1504,8 +1504,8 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
im->x = im->y = side;
- for (i = 0; i < side; ++i) {
- for (j = 0; j < side; ++j) {
+ for (i = 0; i < side; i++) {
+ for (j = 0; j < side; j++) {
float magn = sqrtf(pow2f(i - half) + pow2f(j - half));
im->rect_float[i * side + j] = BKE_brush_curve_strength_clamped(br, magn, half);
}
@@ -1513,8 +1513,8 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
/* Modulate curve with texture */
if (texcache) {
- for (i = 0; i < side; ++i) {
- for (j = 0; j < side; ++j) {
+ for (i = 0; i < side; i++) {
+ for (j = 0; j < side; j++) {
const int col = texcache[i * side + j];
im->rect_float[i * side + j] *= (((char *)&col)[0] + ((char *)&col)[1] +
((char *)&col)[2]) /
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 69afda9997a..2c3b933af69 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -1742,7 +1742,7 @@ void cloth_free_contacts(ColliderContacts *collider_contacts, int totcolliders)
{
if (collider_contacts) {
int i;
- for (i = 0; i < totcolliders; ++i) {
+ for (i = 0; i < totcolliders; i++) {
ColliderContacts *ct = collider_contacts + i;
if (ct->collisions) {
MEM_freeN(ct->collisions);
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 3112e1b5ed1..861663fdd6b 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -697,7 +697,7 @@ float BKE_nurb_calc_length(const Nurb *nu, int resolution)
a = nu->pntsu - 1;
bp = nu->bp;
if (nu->flagu & CU_NURB_CYCLIC) {
- ++a;
+ a++;
prevbp = nu->bp + (nu->pntsu - 1);
}
else {
@@ -708,7 +708,7 @@ float BKE_nurb_calc_length(const Nurb *nu, int resolution)
while (a--) {
length += len_v3v3(prevbp->vec, bp->vec);
prevbp = bp;
- ++bp;
+ bp++;
}
}
else if (nu->type == CU_BEZIER) {
@@ -716,12 +716,12 @@ float BKE_nurb_calc_length(const Nurb *nu, int resolution)
a = nu->pntsu - 1;
bezt = nu->bezt;
if (nu->flagu & CU_NURB_CYCLIC) {
- ++a;
+ a++;
prevbezt = nu->bezt + (nu->pntsu - 1);
}
else {
prevbezt = bezt;
- ++bezt;
+ bezt++;
}
while (a--) {
@@ -748,7 +748,7 @@ float BKE_nurb_calc_length(const Nurb *nu, int resolution)
}
}
prevbezt = bezt;
- ++bezt;
+ bezt++;
}
MEM_freeN(points);
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index 59dbfc293dd..8ac0f71cd7e 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -173,7 +173,7 @@ static void layerCopy_mdeformvert(const void *source, void *dest, int count)
memcpy(dest, source, count * size);
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
MDeformVert *dvert = POINTER_OFFSET(dest, i * size);
if (dvert->totweight) {
@@ -193,7 +193,7 @@ static void layerFree_mdeformvert(void *data, int count, int size)
{
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
MDeformVert *dvert = POINTER_OFFSET(data, i * size);
if (dvert->dw) {
@@ -209,7 +209,7 @@ static void layerCopy_bmesh_elem_py_ptr(const void *UNUSED(source), void *dest,
{
int i, size = sizeof(void *);
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
void **ptr = POINTER_OFFSET(dest, i * size);
*ptr = NULL;
}
@@ -226,7 +226,7 @@ static void layerFree_bmesh_elem_py_ptr(void *data, int count, int size)
{
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
void **ptr = POINTER_OFFSET(data, i * size);
if (*ptr) {
bpy_bm_generic_invalidate(*ptr);
@@ -258,11 +258,11 @@ static void layerInterp_mdeformvert(const void **sources,
/* build a list of unique def_nrs for dest */
totweight = 0;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
const MDeformVert *source = sources[i];
float interp_weight = weights ? weights[i] : 1.0f;
- for (j = 0; j < source->totweight; ++j) {
+ for (j = 0; j < source->totweight; j++) {
MDeformWeight *dw = &source->dw[j];
float weight = dw->weight * interp_weight;
@@ -407,7 +407,7 @@ static void layerCopy_tface(const void *source, void *dest, int count)
MTFace *dest_tf = (MTFace *)dest;
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
dest_tf[i] = source_tf[i];
}
}
@@ -425,13 +425,13 @@ static void layerInterp_tface(
}
sub_weight = sub_weights;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
const MTFace *src = sources[i];
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
if (sub_weights) {
- for (k = 0; k < 4; ++k, ++sub_weight) {
+ for (k = 0; k < 4; k++, sub_weight++) {
madd_v2_v2fl(uv[j], src->uv[k], (*sub_weight) * weight);
}
}
@@ -452,7 +452,7 @@ static void layerSwap_tface(void *data, const int *corner_indices)
float uv[4][2];
int j;
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
const int source_index = corner_indices[j];
copy_v2_v2(uv[j], tf->uv[source_index]);
}
@@ -514,7 +514,7 @@ static void layerCopy_origspace_face(const void *source, void *dest, int count)
OrigSpaceFace *dest_tf = (OrigSpaceFace *)dest;
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
dest_tf[i] = source_tf[i];
}
}
@@ -532,13 +532,13 @@ static void layerInterp_origspace_face(
}
sub_weight = sub_weights;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
const OrigSpaceFace *src = sources[i];
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
if (sub_weights) {
- for (k = 0; k < 4; ++k, ++sub_weight) {
+ for (k = 0; k < 4; k++, sub_weight++) {
madd_v2_v2fl(uv[j], src->uv[k], (*sub_weight) * weight);
}
}
@@ -558,7 +558,7 @@ static void layerSwap_origspace_face(void *data, const int *corner_indices)
float uv[4][2];
int j;
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
copy_v2_v2(uv[j], osf->uv[corner_indices[j]]);
}
memcpy(osf->uv, uv, sizeof(osf->uv));
@@ -613,7 +613,7 @@ static void layerCopy_mdisps(const void *source, void *dest, int count)
const MDisps *s = source;
MDisps *d = dest;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (s[i].disps) {
d[i].disps = MEM_dupallocN(s[i].disps);
d[i].hidden = MEM_dupallocN(s[i].hidden);
@@ -634,7 +634,7 @@ static void layerFree_mdisps(void *data, int count, int UNUSED(size))
int i;
MDisps *d = data;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (d[i].disps) {
MEM_freeN(d[i].disps);
}
@@ -653,7 +653,7 @@ static int layerRead_mdisps(CDataFile *cdf, void *data, int count)
MDisps *d = data;
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (!d[i].disps) {
d[i].disps = MEM_calloc_arrayN(d[i].totdisp, 3 * sizeof(float), "mdisps read");
}
@@ -672,7 +672,7 @@ static int layerWrite_mdisps(CDataFile *cdf, const void *data, int count)
const MDisps *d = data;
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (!cdf_write_data(cdf, d[i].totdisp * 3 * sizeof(float), d[i].disps)) {
CLOG_ERROR(&LOG, "failed to write multires displacement %d/%d %d", i, count, d[i].totdisp);
return 0;
@@ -688,7 +688,7 @@ static size_t layerFilesize_mdisps(CDataFile *UNUSED(cdf), const void *data, int
size_t size = 0;
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
size += d[i].totdisp * 3 * sizeof(float);
}
@@ -701,7 +701,7 @@ static void layerCopy_grid_paint_mask(const void *source, void *dest, int count)
const GridPaintMask *s = source;
GridPaintMask *d = dest;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (s[i].data) {
d[i].data = MEM_dupallocN(s[i].data);
d[i].level = s[i].level;
@@ -718,7 +718,7 @@ static void layerFree_grid_paint_mask(void *data, int count, int UNUSED(size))
int i;
GridPaintMask *gpm = data;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
if (gpm[i].data) {
MEM_freeN(gpm[i].data);
}
@@ -887,7 +887,7 @@ static void layerInterp_mloopcol(
} col = {0};
const float *sub_weight = sub_weights;
- for (int i = 0; i < count; ++i) {
+ for (int i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
const MLoopCol *src = sources[i];
if (sub_weights) {
@@ -1128,13 +1128,13 @@ static void layerInterp_mcol(
}
sub_weight = sub_weights;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
float weight = weights ? weights[i] : 1;
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
if (sub_weights) {
const MCol *src = sources[i];
- for (k = 0; k < 4; ++k, ++sub_weight, ++src) {
+ for (k = 0; k < 4; k++, sub_weight++, src++) {
const float w = (*sub_weight) * weight;
col[j].a += src->a * w;
col[j].r += src->r * w;
@@ -1153,7 +1153,7 @@ static void layerInterp_mcol(
}
/* Delay writing to the destination in case dest is in sources. */
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
/* Subdivide smooth or fractal can cause problems without clamping
* although weights should also not cause this situation */
@@ -1170,7 +1170,7 @@ static void layerSwap_mcol(void *data, const int *corner_indices)
MCol col[4];
int j;
- for (j = 0; j < 4; ++j) {
+ for (j = 0; j < 4; j++) {
col[j] = mcol[corner_indices[j]];
}
@@ -1210,12 +1210,12 @@ static void layerInterp_bweight(const void **sources,
f = 0.0f;
if (weights) {
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
f += *in[i] * weights[i];
}
}
else {
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
f += *in[i];
}
}
@@ -1241,12 +1241,12 @@ static void layerInterp_shapekey(const void **sources,
zero_v3(co);
if (weights) {
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
madd_v3_v3fl(co, in[i], weights[i]);
}
}
else {
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
add_v3_v3(co, in[i]);
}
}
@@ -1862,7 +1862,7 @@ bool CustomData_merge(const struct CustomData *source,
int number = 0, maxnumber = -1;
bool changed = false;
- for (i = 0; i < source->totlayer; ++i) {
+ for (i = 0; i < source->totlayer; i++) {
layer = &source->layers[i];
/*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/
@@ -1934,7 +1934,7 @@ bool CustomData_merge(const struct CustomData *source,
void CustomData_realloc(CustomData *data, int totelem)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
CustomDataLayer *layer = &data->layers[i];
const LayerTypeInfo *typeInfo;
if (layer->flag & CD_FLAG_NOFREE) {
@@ -1995,7 +1995,7 @@ void CustomData_free(CustomData *data, int totelem)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
customData_free_layer__internal(&data->layers[i], totelem);
}
@@ -2011,7 +2011,7 @@ void CustomData_free_typemask(struct CustomData *data, int totelem, CustomDataMa
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
CustomDataLayer *layer = &data->layers[i];
if (!(mask & CD_TYPE_AS_MASK(layer->type))) {
continue;
@@ -2032,7 +2032,7 @@ static void customData_update_offsets(CustomData *data)
const LayerTypeInfo *typeInfo;
int i, offset = 0;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
typeInfo = layerType_getInfo(data->layers[i].type);
data->layers[i].offset = offset;
@@ -2048,7 +2048,7 @@ static int CustomData_get_layer_index__notypemap(const CustomData *data, int typ
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
return i;
}
@@ -2082,7 +2082,7 @@ int CustomData_get_named_layer_index(const CustomData *data, int type, const cha
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
if (STREQ(data->layers[i].name, name)) {
return i;
@@ -2164,7 +2164,7 @@ void CustomData_set_layer_active(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active = n;
}
@@ -2175,7 +2175,7 @@ void CustomData_set_layer_render(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_rnd = n;
}
@@ -2186,7 +2186,7 @@ void CustomData_set_layer_clone(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_clone = n;
}
@@ -2197,7 +2197,7 @@ void CustomData_set_layer_stencil(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_mask = n;
}
@@ -2210,7 +2210,7 @@ void CustomData_set_layer_active_index(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active = n - i;
}
@@ -2221,7 +2221,7 @@ void CustomData_set_layer_render_index(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_rnd = n - i;
}
@@ -2232,7 +2232,7 @@ void CustomData_set_layer_clone_index(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_clone = n - i;
}
@@ -2243,7 +2243,7 @@ void CustomData_set_layer_stencil_index(CustomData *data, int type, int n)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].active_mask = n - i;
}
@@ -2254,7 +2254,7 @@ void CustomData_set_layer_flag(struct CustomData *data, int type, int flag)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].flag |= flag;
}
@@ -2265,7 +2265,7 @@ void CustomData_clear_layer_flag(struct CustomData *data, int type, int flag)
{
const int nflag = ~flag;
- for (int i = 0; i < data->totlayer; ++i) {
+ for (int i = 0; i < data->totlayer; i++) {
if (data->layers[i].type == type) {
data->layers[i].flag &= nflag;
}
@@ -2355,7 +2355,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
data->totlayer++;
/* keep layers ordered by type */
- for (; index > 0 && data->layers[index - 1].type > type; --index) {
+ for (; index > 0 && data->layers[index - 1].type > type; index--) {
data->layers[index] = data->layers[index - 1];
}
@@ -2447,7 +2447,7 @@ bool CustomData_free_layer(CustomData *data, int type, int totelem, int index)
customData_free_layer__internal(&data->layers[index], totelem);
- for (i = index + 1; i < data->totlayer; ++i) {
+ for (i = index + 1; i < data->totlayer; i++) {
data->layers[i - 1] = data->layers[i];
}
@@ -2628,7 +2628,7 @@ void CustomData_free_temporary(CustomData *data, int totelem)
int i, j;
bool changed = false;
- for (i = 0, j = 0; i < data->totlayer; ++i) {
+ for (i = 0, j = 0; i < data->totlayer; i++) {
layer = &data->layers[i];
if (i != j) {
@@ -2660,7 +2660,7 @@ void CustomData_set_only_copy(const struct CustomData *data, CustomDataMask mask
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (!(mask & CD_TYPE_AS_MASK(data->layers[i].type))) {
data->layers[i].flag |= CD_FLAG_NOCOPY;
}
@@ -2725,7 +2725,7 @@ void CustomData_copy_data_named(
int src_i, dest_i;
/* copies a layer at a time */
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
dest_i = CustomData_get_named_layer_index(
dest, source->layers[src_i].type, source->layers[src_i].name);
@@ -2744,7 +2744,7 @@ void CustomData_copy_data(
/* copies a layer at a time */
dest_i = 0;
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
@@ -2800,7 +2800,7 @@ void CustomData_free_elem(CustomData *data, int index, int count)
int i;
const LayerTypeInfo *typeInfo;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
@@ -2835,7 +2835,7 @@ void CustomData_interp(const CustomData *source,
/* interpolates a layer at a time */
dest_i = 0;
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
const LayerTypeInfo *typeInfo = layerType_getInfo(source->layers[src_i].type);
if (!typeInfo->interp) {
continue;
@@ -2857,7 +2857,7 @@ void CustomData_interp(const CustomData *source,
if (dest->layers[dest_i].type == source->layers[src_i].type) {
void *src_data = source->layers[src_i].data;
- for (j = 0; j < count; ++j) {
+ for (j = 0; j < count; j++) {
sources[j] = POINTER_OFFSET(src_data, (size_t)src_indices[j] * typeInfo->size);
}
@@ -2893,7 +2893,7 @@ void CustomData_swap_corners(struct CustomData *data, int index, const int *corn
const LayerTypeInfo *typeInfo;
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
typeInfo = layerType_getInfo(data->layers[i].type);
if (typeInfo->swap) {
@@ -2916,7 +2916,7 @@ void CustomData_swap(struct CustomData *data, const int index_a, const int index
return;
}
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
const LayerTypeInfo *typeInfo = layerType_getInfo(data->layers[i].type);
const size_t size = typeInfo->size;
const size_t offset_a = size * index_a;
@@ -3392,7 +3392,7 @@ void CustomData_bmesh_free_block(CustomData *data, void **block)
return;
}
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
@@ -3422,7 +3422,7 @@ void CustomData_bmesh_free_block_data(CustomData *data, void *block)
return;
}
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
@@ -3476,7 +3476,7 @@ void CustomData_bmesh_set_default(CustomData *data, void **block)
CustomData_bmesh_alloc_block(data, block);
}
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
CustomData_bmesh_set_default_n(data, block, i);
}
}
@@ -3498,7 +3498,7 @@ void CustomData_bmesh_copy_data(const CustomData *source,
/* copies a layer at a time */
dest_i = 0;
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
@@ -3609,7 +3609,7 @@ bool CustomData_has_math(const struct CustomData *data)
int i;
/* interpolates a layer at a time */
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (CustomData_layer_has_math(data, i)) {
return true;
}
@@ -3624,7 +3624,7 @@ bool CustomData_bmesh_has_free(const struct CustomData *data)
const LayerTypeInfo *typeInfo;
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (!(data->layers[i].flag & CD_FLAG_NOFREE)) {
typeInfo = layerType_getInfo(data->layers[i].type);
if (typeInfo->free) {
@@ -3640,7 +3640,7 @@ bool CustomData_has_interp(const struct CustomData *data)
int i;
/* interpolates a layer at a time */
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (CustomData_layer_has_interp(data, i)) {
return true;
}
@@ -3652,7 +3652,7 @@ bool CustomData_has_interp(const struct CustomData *data)
bool CustomData_has_referenced(const struct CustomData *data)
{
int i;
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
if (data->layers[i].flag & CD_FLAG_NOFREE) {
return true;
}
@@ -3832,11 +3832,11 @@ void CustomData_bmesh_interp(CustomData *data,
}
/* interpolates a layer at a time */
- for (i = 0; i < data->totlayer; ++i) {
+ for (i = 0; i < data->totlayer; i++) {
CustomDataLayer *layer = &data->layers[i];
const LayerTypeInfo *typeInfo = layerType_getInfo(layer->type);
if (typeInfo->interp) {
- for (j = 0; j < count; ++j) {
+ for (j = 0; j < count; j++) {
sources[j] = POINTER_OFFSET(src_blocks[j], layer->offset);
}
CustomData_bmesh_interp_n(
@@ -3869,7 +3869,7 @@ void CustomData_to_bmesh_block(const CustomData *source,
/* copies a layer at a time */
dest_i = 0;
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
@@ -3927,7 +3927,7 @@ void CustomData_from_bmesh_block(const CustomData *source,
/* copies a layer at a time */
dest_i = 0;
- for (src_i = 0; src_i < source->totlayer; ++src_i) {
+ for (src_i = 0; src_i < source->totlayer; src_i++) {
/* find the first dest layer with type >= the source type
* (this should work because layers are ordered by type)
@@ -4198,7 +4198,7 @@ bool CustomData_verify_versions(struct CustomData *data, int index)
}
if (!keeplayer) {
- for (i = index + 1; i < data->totlayer; ++i) {
+ for (i = index + 1; i < data->totlayer; i++) {
data->layers[i - 1] = data->layers[i];
}
data->totlayer--;
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c
index 8a5a36481cf..90dba4bc737 100644
--- a/source/blender/blenkernel/intern/icons.c
+++ b/source/blender/blenkernel/intern/icons.c
@@ -224,7 +224,7 @@ static PreviewImage *previewimg_create_ex(size_t deferred_data_size)
prv_img->tag |= PRV_TAG_DEFFERED;
}
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
prv_img->flag[i] |= PRV_CHANGED;
prv_img->changed_timestamp[i] = 0;
}
@@ -242,7 +242,7 @@ void BKE_previewimg_freefunc(void *link)
if (prv) {
int i;
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
if (prv->rect[i]) {
MEM_freeN(prv->rect[i]);
}
@@ -278,7 +278,7 @@ void BKE_previewimg_clear_single(struct PreviewImage *prv, enum eIconSizes size)
void BKE_previewimg_clear(struct PreviewImage *prv)
{
int i;
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
BKE_previewimg_clear_single(prv, i);
}
}
@@ -290,7 +290,7 @@ PreviewImage *BKE_previewimg_copy(const PreviewImage *prv)
if (prv) {
prv_img = MEM_dupallocN(prv);
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
if (prv->rect[i]) {
prv_img->rect[i] = MEM_dupallocN(prv->rect[i]);
}
@@ -545,7 +545,7 @@ void BKE_icon_changed(const int icon_id)
/* If we have previews, they all are now invalid changed. */
if (p_prv && *p_prv) {
int i;
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
(*p_prv)->flag[i] |= PRV_CHANGED;
(*p_prv)->changed_timestamp[i]++;
}
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index bbae1f4d3bc..43bc05ffdc0 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -452,7 +452,7 @@ static int get_levels_from_disps(Object *ob)
mdisp = CustomData_get_layer(&me->ldata, CD_MDISPS);
- for (i = 0; i < me->totpoly; ++i) {
+ for (i = 0; i < me->totpoly; i++) {
md = mdisp + me->mpoly[i].loopstart;
for (j = 0; j < me->mpoly[i].totloop; j++, md++) {
@@ -520,7 +520,7 @@ static void multires_reallocate_mdisps(int totloop, MDisps *mdisps, int lvl)
int i;
/* reallocate displacements to be filled in */
- for (i = 0; i < totloop; ++i) {
+ for (i = 0; i < totloop; i++) {
int totdisp = multires_grid_tot[lvl];
float(*disps)[3] = MEM_calloc_arrayN(totdisp, 3 * sizeof(float), "multires disps");
@@ -633,7 +633,7 @@ static void multires_del_higher(MultiresModifierData *mmd, Object *ob, int lvl)
int hsize = multires_side_tot[mmd->totlvl];
int i, j;
- for (i = 0; i < me->totpoly; ++i) {
+ for (i = 0; i < me->totpoly; i++) {
for (j = 0; j < me->mpoly[i].totloop; j++) {
int g = me->mpoly[i].loopstart + j;
MDisps *mdisp = &mdisps[g];
@@ -802,7 +802,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Scene *scene, Object
/* copy the new locations of the base verts into the mesh */
offset = dispdm->getNumVerts(dispdm) - me->totvert;
- for (i = 0; i < me->totvert; ++i) {
+ for (i = 0; i < me->totvert; i++) {
dispdm->getVertCo(dispdm, offset + i, me->mvert[i].co);
}
@@ -811,11 +811,11 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Scene *scene, Object
cddm = CDDM_from_mesh(me);
pmap = cddm->getPolyMap(ob, cddm);
origco = MEM_calloc_arrayN(me->totvert, 3 * sizeof(float), "multires apply base origco");
- for (i = 0; i < me->totvert; ++i) {
+ for (i = 0; i < me->totvert; i++) {
copy_v3_v3(origco[i], me->mvert[i].co);
}
- for (i = 0; i < me->totvert; ++i) {
+ for (i = 0; i < me->totvert; i++) {
float avg_no[3] = {0, 0, 0}, center[3] = {0, 0, 0}, push[3];
float dist;
int tot = 0;
@@ -830,7 +830,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Scene *scene, Object
const MPoly *p = &me->mpoly[pmap[i].indices[j]];
/* this double counts, not sure if that's bad or good */
- for (k = 0; k < p->totloop; ++k) {
+ for (k = 0; k < p->totloop; k++) {
int vndx = me->mloop[p->loopstart + k].v;
if (vndx != i) {
add_v3_v3(center, origco[vndx]);
@@ -855,7 +855,7 @@ void multiresModifier_base_apply(MultiresModifierData *mmd, Scene *scene, Object
fake_loops = MEM_malloc_arrayN(p->totloop, sizeof(MLoop), "fake_loops");
fake_co = MEM_malloc_arrayN(p->totloop, 3 * sizeof(float), "fake_co");
- for (k = 0; k < p->totloop; ++k) {
+ for (k = 0; k < p->totloop; k++) {
int vndx = me->mloop[p->loopstart + k].v;
fake_loops[k].v = k;
@@ -975,7 +975,7 @@ static void multires_subdivide(
subGridData = MEM_calloc_arrayN(numGrids, sizeof(float *), "subGridData*");
- for (i = 0; i < numGrids; ++i) {
+ for (i = 0; i < numGrids; i++) {
/* backup subsurf grids */
subGridData[i] = MEM_calloc_arrayN(
highGridKey.elem_size, highGridSize * highGridSize, "subGridData");
@@ -1000,7 +1000,7 @@ static void multires_subdivide(
/* free */
highdm->release(highdm);
- for (i = 0; i < numGrids; ++i) {
+ for (i = 0; i < numGrids; i++) {
MEM_freeN(subGridData[i]);
}
MEM_freeN(subGridData);
@@ -1097,7 +1097,7 @@ static void multires_disp_run_cb(void *__restrict userdata,
const int numVerts = mpoly[pidx].totloop;
int S, x, y, gIndex = gridOffset[pidx];
- for (S = 0; S < numVerts; ++S, ++gIndex) {
+ for (S = 0; S < numVerts; S++, gIndex++) {
GridPaintMask *gpm = grid_paint_mask ? &grid_paint_mask[gIndex] : NULL;
MDisps *mdisp = &mdisps[mpoly[pidx].loopstart + S];
CCGElem *grid = gridData[gIndex];
@@ -1223,7 +1223,7 @@ static void multiresModifier_disp_run(
}
/* when adding new faces in edit mode, need to allocate disps */
- for (i = 0; i < totloop; ++i) {
+ for (i = 0; i < totloop; i++) {
if (mdisps[i].disps == NULL) {
multires_reallocate_mdisps(totloop, mdisps, totlvl);
break;
@@ -1324,7 +1324,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
subGridData = MEM_calloc_arrayN(numGrids, sizeof(CCGElem *), "subGridData*");
diffGrid = MEM_calloc_arrayN(lowGridKey.elem_size, lowGridSize * lowGridSize, "diff");
- for (i = 0; i < numGrids; ++i) {
+ for (i = 0; i < numGrids; i++) {
/* backup subsurf grids */
subGridData[i] = MEM_calloc_arrayN(
highGridKey.elem_size, highGridSize * highGridSize, "subGridData");
@@ -1332,7 +1332,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
subGridData[i], highGridData[i], highGridKey.elem_size * highGridSize * highGridSize);
/* write difference of subsurf and displaced low level into high subsurf */
- for (j = 0; j < lowGridSize * lowGridSize; ++j) {
+ for (j = 0; j < lowGridSize * lowGridSize; j++) {
sub_v4_v4v4(CCG_elem_offset_co(&lowGridKey, diffGrid, j),
CCG_elem_offset_co(&lowGridKey, gridData[i], j),
CCG_elem_offset_co(&lowGridKey, lowGridData[i], j));
@@ -1354,7 +1354,7 @@ void multires_modifier_update_mdisps(struct DerivedMesh *dm, Scene *scene)
/* free */
highdm->release(highdm);
- for (i = 0; i < numGrids; ++i) {
+ for (i = 0; i < numGrids; i++) {
MEM_freeN(subGridData[i]);
}
MEM_freeN(subGridData);
@@ -1617,8 +1617,8 @@ static void old_mdisps_convert(MFace *mface, MDisps *mdisp)
out = disps;
for (S = 0; S < nvert; S++) {
- for (y = 0; y < newside; ++y) {
- for (x = 0; x < newside; ++x, ++out) {
+ for (y = 0; y < newside; y++) {
+ for (x = 0; x < newside; x++, out++) {
old_mdisps_rotate(S, newside, oldside, x, y, &u, &v);
old_mdisps_bilinear(*out, mdisp->disps, oldside, u, v);
@@ -1749,8 +1749,8 @@ static void create_old_vert_face_map(ListBase **map,
node = *mem;
/* Find the users */
- for (i = 0; i < totface; ++i) {
- for (j = 0; j < (mface[i].v[3] ? 4 : 3); ++j, ++node) {
+ for (i = 0; i < totface; i++) {
+ for (j = 0; j < (mface[i].v[3] ? 4 : 3); j++, node++) {
node->index = i;
BLI_addtail(&(*map)[mface[i].v[j]], node);
}
@@ -1771,8 +1771,8 @@ static void create_old_vert_edge_map(ListBase **map,
node = *mem;
/* Find the users */
- for (i = 0; i < totedge; ++i) {
- for (j = 0; j < 2; ++j, ++node) {
+ for (i = 0; i < totedge; i++) {
+ for (j = 0; j < 2; j++, node++) {
node->index = i;
BLI_addtail(&(*map)[medge[i].v[j]], node);
}
@@ -1793,8 +1793,8 @@ static MultiresFace *find_old_face(
for (n1 = map[v1].first; n1; n1 = n1->next) {
int fnd[4] = {0, 0, 0, 0};
- for (i = 0; i < 4; ++i) {
- for (j = 0; j < 4; ++j) {
+ for (i = 0; i < 4; i++) {
+ for (j = 0; j < 4; j++) {
if (v[i] == faces[n1->index].v[j]) {
fnd[i] = 1;
}
@@ -2006,24 +2006,24 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
lvl1 = mr->levels.first;
/* Load base verts */
- for (i = 0; i < lvl1->totvert; ++i) {
+ for (i = 0; i < lvl1->totvert; i++) {
vvmap[totvert - lvl1->totvert + i] = src;
src++;
}
/* Original edges */
dst = totvert - lvl1->totvert - extedgelen * lvl1->totedge;
- for (i = 0; i < lvl1->totedge; ++i) {
+ for (i = 0; i < lvl1->totedge; i++) {
int ldst = dst + extedgelen * i;
int lsrc = src;
lvl = lvl1->next;
- for (j = 2; j <= mr->level_count; ++j) {
+ for (j = 2; j <= mr->level_count; j++) {
int base = multires_side_tot[totlvl - j + 1] - 2;
int skip = multires_side_tot[totlvl - j + 2] - 1;
int st = multires_side_tot[j - 1] - 1;
- for (x = 0; x < st; ++x) {
+ for (x = 0; x < st; x++) {
vvmap[ldst + base + x * skip] = lsrc + st * i + x;
}
@@ -2034,7 +2034,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
/* Center points */
dst = 0;
- for (i = 0; i < lvl1->totface; ++i) {
+ for (i = 0; i < lvl1->totface; i++) {
int sides = lvl1->faces[i].v[3] ? 4 : 3;
vvmap[dst] = src + lvl1->totedge + i;
@@ -2050,13 +2050,13 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
tottri = totquad = 0;
crossedgelen = multires_side_tot[totlvl - 1] - 2;
dst = 0;
- for (i = 0; i < lvl1->totface; ++i) {
+ for (i = 0; i < lvl1->totface; i++) {
int sides = lvl1->faces[i].v[3] ? 4 : 3;
lvl = lvl1->next->next;
dst++;
- for (j = 3; j <= mr->level_count; ++j) {
+ for (j = 3; j <= mr->level_count; j++) {
int base = multires_side_tot[totlvl - j + 1] - 2;
int skip = multires_side_tot[totlvl - j + 2] - 1;
int st = pow(2, j - 2);
@@ -2069,8 +2069,8 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
/* Skip earlier face edge crosses */
lsrc += st2 * (tottri * 3 + totquad * 4);
- for (s = 0; s < sides; ++s) {
- for (x = 0; x < st2; ++x) {
+ for (s = 0; s < sides; s++) {
+ for (x = 0; x < st2; x++) {
vvmap[dst + crossedgelen * (s + 1) - base - x * skip - 1] = lsrc;
lsrc++;
}
@@ -2082,10 +2082,10 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
dst += sides * (st_last - 1) * st_last;
if (sides == 4) {
- ++totquad;
+ totquad++;
}
else {
- ++tottri;
+ tottri++;
}
}
@@ -2095,7 +2095,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
fmem = MEM_calloc_arrayN((mr->level_count - 1), sizeof(IndexNode *), "multires fmem");
emem = MEM_calloc_arrayN((mr->level_count - 1), sizeof(IndexNode *), "multires emem");
lvl = lvl1;
- for (i = 0; i < (unsigned int)mr->level_count - 1; ++i) {
+ for (i = 0; i < (unsigned int)mr->level_count - 1; i++) {
create_old_vert_face_map(fmap + i, fmem + i, lvl->faces, lvl->totvert, lvl->totface);
create_old_vert_edge_map(emap + i, emem + i, lvl->edges, lvl->totvert, lvl->totedge);
lvl = lvl->next;
@@ -2104,11 +2104,11 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
/* Interior face verts */
/* lvl = lvl1->next->next; */ /* UNUSED */
dst = 0;
- for (j = 0; j < lvl1->totface; ++j) {
+ for (j = 0; j < lvl1->totface; j++) {
int sides = lvl1->faces[j].v[3] ? 4 : 3;
int ldst = dst + 1 + sides * (st_last - 1);
- for (s = 0; s < sides; ++s) {
+ for (s = 0; s < sides; s++) {
int st2 = multires_side_tot[totlvl - 1] - 2;
int st3 = multires_side_tot[totlvl - 2] - 2;
int st4 = st3 == 0 ? 1 : (st3 + 1) / 2;
@@ -2137,7 +2137,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
/*lvl = lvl->next;*/ /*UNUSED*/
- for (i = 0; i < (unsigned int)(mr->level_count - 1); ++i) {
+ for (i = 0; i < (unsigned int)(mr->level_count - 1); i++) {
MEM_freeN(fmap[i]);
MEM_freeN(fmem[i]);
MEM_freeN(emap[i]);
@@ -2151,7 +2151,7 @@ static void multires_load_old_dm(DerivedMesh *dm, Mesh *me, int totlvl)
}
/* Transfer verts */
- for (i = 0; i < totvert; ++i) {
+ for (i = 0; i < totvert; i++) {
copy_v3_v3(vdst[i].co, vsrc[vvmap[i]].co);
}
@@ -2183,8 +2183,8 @@ static void multires_load_old_vcols(Mesh *me)
return;
}
- for (i = 0; i < me->totface; ++i) {
- for (j = 0; j < 4; ++j) {
+ for (i = 0; i < me->totface; i++) {
+ for (j = 0; j < 4; j++) {
mcol[i * 4 + j].a = colface[i].col[j].a;
mcol[i * 4 + j].r = colface[i].col[j].r;
mcol[i * 4 + j].g = colface[i].col[j].g;
@@ -2208,7 +2208,7 @@ static void multires_load_old_face_flags(Mesh *me)
return;
}
- for (i = 0; i < me->totface; ++i) {
+ for (i = 0; i < me->totface; i++) {
me->mface[i].flag = faces[i].flag;
}
}
@@ -2234,11 +2234,11 @@ void multires_load_old(Object *ob, Mesh *me)
me->medge = CustomData_add_layer(&me->edata, CD_MEDGE, CD_CALLOC, NULL, me->totedge);
me->mface = CustomData_add_layer(&me->fdata, CD_MFACE, CD_CALLOC, NULL, me->totface);
memcpy(me->mvert, me->mr->verts, sizeof(MVert) * me->totvert);
- for (i = 0; i < me->totedge; ++i) {
+ for (i = 0; i < me->totedge; i++) {
me->medge[i].v1 = lvl->edges[i].v[0];
me->medge[i].v2 = lvl->edges[i].v[1];
}
- for (i = 0; i < me->totface; ++i) {
+ for (i = 0; i < me->totface; i++) {
me->mface[i].v1 = lvl->faces[i].v[0];
me->mface[i].v2 = lvl->faces[i].v[1];
me->mface[i].v3 = lvl->faces[i].v[2];
@@ -2248,10 +2248,10 @@ void multires_load_old(Object *ob, Mesh *me)
/* Copy the first-level data to the mesh */
/* XXX We must do this before converting tessfaces to polys/lopps! */
- for (i = 0, l = me->mr->vdata.layers; i < me->mr->vdata.totlayer; ++i, ++l) {
+ for (i = 0, l = me->mr->vdata.layers; i < me->mr->vdata.totlayer; i++, l++) {
CustomData_add_layer(&me->vdata, l->type, CD_REFERENCE, l->data, me->totvert);
}
- for (i = 0, l = me->mr->fdata.layers; i < me->mr->fdata.totlayer; ++i, ++l) {
+ for (i = 0, l = me->mr->fdata.layers; i < me->mr->fdata.totlayer; i++, l++) {
CustomData_add_layer(&me->fdata, l->type, CD_REFERENCE, l->data, me->totface);
}
CustomData_reset(&me->mr->vdata);
@@ -2271,7 +2271,7 @@ void multires_load_old(Object *ob, Mesh *me)
mmd = (MultiresModifierData *)modifier_new(eModifierType_Multires);
BLI_insertlinkbefore(&ob->modifiers, md, mmd);
- for (i = 0; i < me->mr->level_count - 1; ++i) {
+ for (i = 0; i < me->mr->level_count - 1; i++) {
multiresModifier_subdivide(mmd, NULL, ob, 1, 0);
}
@@ -2337,9 +2337,9 @@ static void multires_apply_uniform_scale(Object *object, const float scale)
{
Mesh *mesh = (Mesh *)object->data;
MDisps *mdisps = CustomData_get_layer(&mesh->ldata, CD_MDISPS);
- for (int i = 0; i < mesh->totloop; ++i) {
+ for (int i = 0; i < mesh->totloop; i++) {
MDisps *grid = &mdisps[i];
- for (int j = 0; j < grid->totdisp; ++j) {
+ for (int j = 0; j < grid->totdisp; j++) {
mul_v3_fl(grid->disps[j], scale);
}
}
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index 9947b96105d..3257bc1b193 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -650,7 +650,7 @@ static void multires_reshape_neighour_boundary_vertices(MultiresReshapeContext *
const int start_ptex_face_index = ctx->face_ptex_offset[coarse_poly_index];
const bool is_quad = (coarse_poly->totloop == 4);
if (corner_u == 1.0f && corner_v == 1.0f) {
- for (int current_corner = 0; current_corner < num_corners; ++current_corner) {
+ for (int current_corner = 0; current_corner < num_corners; current_corner++) {
if (current_corner == coarse_corner) {
continue;
}
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 2eba71fa6bd..c5e16b2d3cd 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -3146,7 +3146,7 @@ void BKE_node_instance_hash_remove_untagged(bNodeInstanceHash *hash,
}
}
- for (i = 0; i < num_untagged; ++i) {
+ for (i = 0; i < num_untagged; i++) {
BKE_node_instance_hash_remove(hash, untagged[i], valfreefp);
}
@@ -3571,7 +3571,7 @@ static bool unique_socket_template_identifier_check(void *arg, const char *name)
bNodeSocketTemplate *ntemp;
} *data = arg;
- for (ntemp = data->list; ntemp->type >= 0; ++ntemp) {
+ for (ntemp = data->list; ntemp->type >= 0; ntemp++) {
if (ntemp != data->ntemp) {
if (STREQ(ntemp->identifier, name)) {
return true;
@@ -3614,22 +3614,22 @@ void node_type_socket_templates(struct bNodeType *ntype,
/* automatically generate unique identifiers */
if (inputs) {
/* clear identifier strings (uninitialized memory) */
- for (ntemp = inputs; ntemp->type >= 0; ++ntemp) {
+ for (ntemp = inputs; ntemp->type >= 0; ntemp++) {
ntemp->identifier[0] = '\0';
}
- for (ntemp = inputs; ntemp->type >= 0; ++ntemp) {
+ for (ntemp = inputs; ntemp->type >= 0; ntemp++) {
BLI_strncpy(ntemp->identifier, ntemp->name, sizeof(ntemp->identifier));
unique_socket_template_identifier(inputs, ntemp, ntemp->identifier, '_');
}
}
if (outputs) {
/* clear identifier strings (uninitialized memory) */
- for (ntemp = outputs; ntemp->type >= 0; ++ntemp) {
+ for (ntemp = outputs; ntemp->type >= 0; ntemp++) {
ntemp->identifier[0] = '\0';
}
- for (ntemp = outputs; ntemp->type >= 0; ++ntemp) {
+ for (ntemp = outputs; ntemp->type >= 0; ntemp++) {
BLI_strncpy(ntemp->identifier, ntemp->name, sizeof(ntemp->identifier));
unique_socket_template_identifier(outputs, ntemp, ntemp->identifier, '_');
}
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index fcceebc3913..9faa61f986d 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -521,7 +521,7 @@ static void ocean_compute_htilda(void *__restrict userdata,
/* Note the <= _N/2 here, see the FFTW documentation
* about the mechanics of the complex->real fft storage. */
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex exp_param1;
fftw_complex exp_param2;
fftw_complex conj_param;
@@ -560,8 +560,8 @@ static void ocean_compute_displacement_x(TaskPool *__restrict pool,
const float chop_amount = osd->chop_amount;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
fftw_complex minus_i;
@@ -591,8 +591,8 @@ static void ocean_compute_displacement_z(TaskPool *__restrict pool,
const float chop_amount = osd->chop_amount;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
fftw_complex minus_i;
@@ -621,8 +621,8 @@ static void ocean_compute_jacobian_jxx(TaskPool *__restrict pool,
const float chop_amount = osd->chop_amount;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
/* init_complex(mul_param, -scale, 0); */
@@ -640,8 +640,8 @@ static void ocean_compute_jacobian_jxx(TaskPool *__restrict pool,
}
fftw_execute(o->_Jxx_plan);
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j < o->_N; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j < o->_N; j++) {
o->_Jxx[i * o->_N + j] += 1.0;
}
}
@@ -656,8 +656,8 @@ static void ocean_compute_jacobian_jzz(TaskPool *__restrict pool,
const float chop_amount = osd->chop_amount;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
/* init_complex(mul_param, -scale, 0); */
@@ -675,8 +675,8 @@ static void ocean_compute_jacobian_jzz(TaskPool *__restrict pool,
}
fftw_execute(o->_Jzz_plan);
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j < o->_N; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j < o->_N; j++) {
o->_Jzz[i * o->_N + j] += 1.0;
}
}
@@ -691,8 +691,8 @@ static void ocean_compute_jacobian_jxz(TaskPool *__restrict pool,
const float chop_amount = osd->chop_amount;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
/* init_complex(mul_param, -scale, 0); */
@@ -719,8 +719,8 @@ static void ocean_compute_normal_x(TaskPool *__restrict pool,
const Ocean *o = osd->o;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
init_complex(mul_param, 0.0, -1.0);
@@ -740,8 +740,8 @@ static void ocean_compute_normal_z(TaskPool *__restrict pool,
const Ocean *o = osd->o;
int i, j;
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
fftw_complex mul_param;
init_complex(mul_param, 0.0, -1.0);
@@ -829,8 +829,8 @@ static void set_height_normalize_factor(struct Ocean *oc)
BLI_rw_mutex_lock(&oc->oceanmutex, THREAD_LOCK_READ);
- for (i = 0; i < oc->_M; ++i) {
- for (j = 0; j < oc->_N; ++j) {
+ for (i = 0; i < oc->_M; i++) {
+ for (j = 0; j < oc->_N; j++) {
if (max_h < fabs(oc->_disp_y[i * oc->_N + j])) {
max_h = fabs(oc->_disp_y[i * oc->_N + j]);
}
@@ -959,28 +959,28 @@ void BKE_ocean_init(struct Ocean *o,
}
/* the +ve components and DC */
- for (i = 0; i <= o->_M / 2; ++i) {
+ for (i = 0; i <= o->_M / 2; i++) {
o->_kx[i] = 2.0f * (float)M_PI * i / o->_Lx;
}
/* the -ve components */
- for (i = o->_M - 1, ii = 0; i > o->_M / 2; --i, ++ii) {
+ for (i = o->_M - 1, ii = 0; i > o->_M / 2; i--, ii++) {
o->_kx[i] = -2.0f * (float)M_PI * ii / o->_Lx;
}
/* the +ve components and DC */
- for (i = 0; i <= o->_N / 2; ++i) {
+ for (i = 0; i <= o->_N / 2; i++) {
o->_kz[i] = 2.0f * (float)M_PI * i / o->_Lz;
}
/* the -ve components */
- for (i = o->_N - 1, ii = 0; i > o->_N / 2; --i, ++ii) {
+ for (i = o->_N - 1, ii = 0; i > o->_N / 2; i--, ii++) {
o->_kz[i] = -2.0f * (float)M_PI * ii / o->_Lz;
}
/* pre-calculate the k matrix */
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j <= o->_N / 2; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j <= o->_N / 2; j++) {
o->_k[i * (1 + o->_N / 2) + j] = sqrt(o->_kx[i] * o->_kx[i] + o->_kz[j] * o->_kz[j]);
}
}
@@ -988,8 +988,8 @@ void BKE_ocean_init(struct Ocean *o,
/*srand(seed);*/
rng = BLI_rng_new(seed);
- for (i = 0; i < o->_M; ++i) {
- for (j = 0; j < o->_N; ++j) {
+ for (i = 0; i < o->_M; i++) {
+ for (j = 0; j < o->_N; j++) {
float r1 = gaussRand(rng);
float r2 = gaussRand(rng);
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index a46bb36c883..86b3e347513 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1227,7 +1227,7 @@ static void sculpt_update_object(
BKE_crazyspace_build_sculpt(depsgraph, scene, ob, &ss->deform_imats, &ss->deform_cos);
BKE_pbvh_vert_coords_apply(ss->pbvh, ss->deform_cos, me->totvert);
- for (a = 0; a < me->totvert; ++a) {
+ for (a = 0; a < me->totvert; a++) {
invert_m3(ss->deform_imats[a]);
}
}
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 2de8d4a643a..312b8f883df 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -88,7 +88,7 @@ float PSYS_FRAND_BASE[PSYS_FRAND_COUNT];
void psys_init_rng(void)
{
RNG *rng = BLI_rng_new_srandom(5831); /* arbitrary */
- for (int i = 0; i < PSYS_FRAND_COUNT; ++i) {
+ for (int i = 0; i < PSYS_FRAND_COUNT; i++) {
PSYS_FRAND_BASE[i] = BLI_rng_get_float(rng);
PSYS_FRAND_SEED_OFFSET[i] = (unsigned int)BLI_rng_get_int(rng);
PSYS_FRAND_SEED_MULTIPLIER[i] = (unsigned int)BLI_rng_get_int(rng);
@@ -2747,7 +2747,7 @@ static void exec_child_path_cache(TaskPool *__restrict UNUSED(pool),
int i;
cpa = psys->child + task->begin;
- for (i = task->begin; i < task->end; ++i, ++cpa) {
+ for (i = task->begin; i < task->end; i++, cpa++) {
BLI_assert(i < psys->totchildcache);
psys_thread_create_path(task, cpa, cache[i], i);
}
@@ -2794,7 +2794,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim,
/* cache parent paths */
ctx.parent_pass = 1;
psys_tasks_create(&ctx, 0, totparent, &tasks_parent, &numtasks_parent);
- for (i = 0; i < numtasks_parent; ++i) {
+ for (i = 0; i < numtasks_parent; i++) {
ParticleTask *task = &tasks_parent[i];
psys_task_init_path(task, sim);
@@ -2805,7 +2805,7 @@ void psys_cache_child_paths(ParticleSimulationData *sim,
/* cache child paths */
ctx.parent_pass = 0;
psys_tasks_create(&ctx, totparent, totchild, &tasks_child, &numtasks_child);
- for (i = 0; i < numtasks_child; ++i) {
+ for (i = 0; i < numtasks_child; i++) {
ParticleTask *task = &tasks_child[i];
psys_task_init_path(task, sim);
@@ -3011,7 +3011,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra, const bool use_re
if (part->type == PART_HAIR) {
HairKey *hkey;
- for (k = 0, hkey = pa->hair; k < pa->totkey; ++k, ++hkey) {
+ for (k = 0, hkey = pa->hair; k < pa->totkey; k++, hkey++) {
mul_v3_m4v3(hkey->world_co, hairmat, hkey->co);
}
}
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index 3b02e010e7f..888ec753c54 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -381,7 +381,7 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx,
}
/* we have to correct velocity because of kink & clump */
- for (k = 0, key = keys; k < totkeys; ++k, ++key) {
+ for (k = 0, key = keys; k < totkeys; k++, key++) {
if (k >= 2) {
sub_v3_v3v3((key - 1)->vel, key->co, (key - 2)->co);
mul_v3_fl((key - 1)->vel, 0.5);
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 27d85b91ba4..1189785ce0f 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -787,17 +787,17 @@ static void exec_distribute_parent(TaskPool *__restrict UNUSED(pool),
pa = psys->particles + task->begin;
switch (psys->part->from) {
case PART_FROM_FACE:
- for (p = task->begin; p < task->end; ++p, ++pa) {
+ for (p = task->begin; p < task->end; p++, pa++) {
distribute_from_faces_exec(task, pa, p);
}
break;
case PART_FROM_VOLUME:
- for (p = task->begin; p < task->end; ++p, ++pa) {
+ for (p = task->begin; p < task->end; p++, pa++) {
distribute_from_volume_exec(task, pa, p);
}
break;
case PART_FROM_VERT:
- for (p = task->begin; p < task->end; ++p, ++pa) {
+ for (p = task->begin; p < task->end; p++, pa++) {
distribute_from_verts_exec(task, pa, p);
}
break;
@@ -815,11 +815,11 @@ static void exec_distribute_child(TaskPool *__restrict UNUSED(pool),
/* RNG skipping at the beginning */
cpa = psys->child;
- for (p = 0; p < task->begin; ++p, ++cpa) {
+ for (p = 0; p < task->begin; p++, cpa++) {
BLI_rng_skip(task->rng, PSYS_RND_DIST_SKIP);
}
- for (; p < task->end; ++p, ++cpa) {
+ for (; p < task->end; p++, cpa++) {
distribute_children_exec(task, cpa, p);
}
}
@@ -1341,7 +1341,7 @@ static void distribute_particles_on_dm(ParticleSimulationData *sim, int from)
totpart = (from == PART_FROM_CHILD ? sim->psys->totchild : sim->psys->totpart);
psys_tasks_create(&ctx, 0, totpart, &tasks, &numtasks);
- for (i = 0; i < numtasks; ++i) {
+ for (i = 0; i < numtasks; i++) {
ParticleTask *task = &tasks[i];
psys_task_init_distribute(task, sim);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index e328ae8952e..2655382021a 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -501,7 +501,7 @@ void psys_tasks_free(ParticleTask *tasks, int numtasks)
int i;
/* threads */
- for (i = 0; i < numtasks; ++i) {
+ for (i = 0; i < numtasks; i++) {
if (tasks[i].rng) {
BLI_rng_free(tasks[i].rng);
}
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 7a8c082842e..980d067c90f 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -80,7 +80,7 @@ void BB_reset(BB *bb)
/* Expand the bounding box to include a new coordinate */
void BB_expand(BB *bb, const float co[3])
{
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
bb->bmin[i] = min_ff(bb->bmin[i], co[i]);
bb->bmax[i] = max_ff(bb->bmax[i], co[i]);
}
@@ -89,7 +89,7 @@ void BB_expand(BB *bb, const float co[3])
/* Expand the bounding box to include another bounding box */
void BB_expand_with_bb(BB *bb, BB *bb2)
{
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
bb->bmin[i] = min_ff(bb->bmin[i], bb2->bmin[i]);
bb->bmax[i] = max_ff(bb->bmax[i], bb2->bmax[i]);
}
@@ -100,7 +100,7 @@ int BB_widest_axis(const BB *bb)
{
float dim[3];
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
dim[i] = bb->bmax[i] - bb->bmin[i];
}
@@ -124,7 +124,7 @@ int BB_widest_axis(const BB *bb)
void BBC_update_centroid(BBC *bbc)
{
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
bbc->bcentroid[i] = (bbc->bmin[i] + bbc->bmax[i]) * 0.5f;
}
}
@@ -294,9 +294,9 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
node->face_vert_indices = (const int(*)[3])face_vert_indices;
- for (int i = 0; i < totface; ++i) {
+ for (int i = 0; i < totface; i++) {
const MLoopTri *lt = &bvh->looptri[node->prim_indices[i]];
- for (int j = 0; j < 3; ++j) {
+ for (int j = 0; j < 3; j++) {
face_vert_indices[i][j] = map_insert_vert(
bvh, map, &node->face_verts, &node->uniq_verts, bvh->mloop[lt->tri[j]].v);
}
@@ -323,10 +323,10 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
vert_indices[ndx] = POINTER_AS_INT(BLI_ghashIterator_getKey(&gh_iter));
}
- for (int i = 0; i < totface; ++i) {
+ for (int i = 0; i < totface; i++) {
const int sides = 3;
- for (int j = 0; j < sides; ++j) {
+ for (int j = 0; j < sides; j++) {
if (face_vert_indices[i][j] < 0) {
face_vert_indices[i][j] = -face_vert_indices[i][j] + node->uniq_verts - 1;
}
@@ -343,7 +343,7 @@ static void build_mesh_leaf_node(PBVH *bvh, PBVHNode *node)
static void update_vb(PBVH *bvh, PBVHNode *node, BBC *prim_bbc, int offset, int count)
{
BB_reset(&node->vb);
- for (int i = offset + count - 1; i >= offset; --i) {
+ for (int i = offset + count - 1; i >= offset; i--) {
BB_expand_with_bb(&node->vb, (BB *)(&prim_bbc[bvh->prim_indices[i]]));
}
node->orig_vb = node->vb;
@@ -420,7 +420,7 @@ static bool leaf_needs_material_split(PBVH *bvh, int offset, int count)
const MLoopTri *first = &bvh->looptri[bvh->prim_indices[offset]];
const MPoly *mp = &bvh->mpoly[first->poly];
- for (int i = offset + count - 1; i > offset; --i) {
+ for (int i = offset + count - 1; i > offset; i--) {
int prim = bvh->prim_indices[i];
const MPoly *mp_other = &bvh->mpoly[bvh->looptri[prim].poly];
if (!face_materials_match(mp, mp_other)) {
@@ -431,7 +431,7 @@ static bool leaf_needs_material_split(PBVH *bvh, int offset, int count)
else {
const DMFlagMat *first = &bvh->grid_flag_mats[bvh->prim_indices[offset]];
- for (int i = offset + count - 1; i > offset; --i) {
+ for (int i = offset + count - 1; i > offset; i--) {
int prim = bvh->prim_indices[i];
if (!grid_materials_match(first, &bvh->grid_flag_mats[prim])) {
return true;
@@ -479,7 +479,7 @@ static void build_sub(PBVH *bvh, int node_index, BB *cb, BBC *prim_bbc, int offs
if (!cb) {
cb = &cb_backing;
BB_reset(cb);
- for (int i = offset + count - 1; i >= offset; --i) {
+ for (int i = offset + count - 1; i >= offset; i--) {
BB_expand(cb, prim_bbc[bvh->prim_indices[i]].bcentroid);
}
}
@@ -515,7 +515,7 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim)
MEM_freeN(bvh->prim_indices);
}
bvh->prim_indices = MEM_mallocN(sizeof(int) * totprim, "bvh prim indices");
- for (int i = 0; i < totprim; ++i) {
+ for (int i = 0; i < totprim; i++) {
bvh->prim_indices[i] = i;
}
bvh->totnode = 0;
@@ -564,14 +564,14 @@ void BKE_pbvh_build_mesh(PBVH *bvh,
/* For each face, store the AABB and the AABB centroid */
prim_bbc = MEM_mallocN(sizeof(BBC) * looptri_num, "prim_bbc");
- for (int i = 0; i < looptri_num; ++i) {
+ for (int i = 0; i < looptri_num; i++) {
const MLoopTri *lt = &looptri[i];
const int sides = 3;
BBC *bbc = prim_bbc + i;
BB_reset((BB *)bbc);
- for (int j = 0; j < sides; ++j) {
+ for (int j = 0; j < sides; j++) {
BB_expand((BB *)bbc, verts[bvh->mloop[lt->tri[j]].v].co);
}
@@ -614,13 +614,13 @@ void BKE_pbvh_build_grids(PBVH *bvh,
/* For each grid, store the AABB and the AABB centroid */
BBC *prim_bbc = MEM_mallocN(sizeof(BBC) * totgrid, "prim_bbc");
- for (int i = 0; i < totgrid; ++i) {
+ for (int i = 0; i < totgrid; i++) {
CCGElem *grid = grids[i];
BBC *bbc = prim_bbc + i;
BB_reset((BB *)bbc);
- for (int j = 0; j < gridsize * gridsize; ++j) {
+ for (int j = 0; j < gridsize * gridsize; j++) {
BB_expand((BB *)bbc, CCG_elem_offset_co(key, grid, j));
}
@@ -645,7 +645,7 @@ PBVH *BKE_pbvh_new(void)
void BKE_pbvh_free(PBVH *bvh)
{
- for (int i = 0; i < bvh->totnode; ++i) {
+ for (int i = 0; i < bvh->totnode; i++) {
PBVHNode *node = &bvh->nodes[i];
if (node->flag & PBVH_Leaf) {
@@ -697,7 +697,7 @@ void BKE_pbvh_free(PBVH *bvh)
void BKE_pbvh_free_layer_disp(PBVH *bvh)
{
- for (int i = 0; i < bvh->totnode; ++i) {
+ for (int i = 0; i < bvh->totnode; i++) {
BKE_pbvh_node_layer_disp_free(&bvh->nodes[i]);
}
}
@@ -1010,7 +1010,7 @@ static void pbvh_update_normals_accum_task_cb(void *__restrict userdata,
const int *faces = node->prim_indices;
const int totface = node->totprim;
- for (int i = 0; i < totface; ++i) {
+ for (int i = 0; i < totface; i++) {
const MLoopTri *lt = &bvh->looptri[faces[i]];
const unsigned int vtri[3] = {
bvh->mloop[lt->tri[0]].v,
@@ -1056,7 +1056,7 @@ static void pbvh_update_normals_store_task_cb(void *__restrict userdata,
const int *verts = node->vert_indices;
const int totvert = node->uniq_verts;
- for (int i = 0; i < totvert; ++i) {
+ for (int i = 0; i < totvert; i++) {
const int v = verts[i];
MVert *mvert = &bvh->verts[v];
@@ -1308,7 +1308,7 @@ void BKE_pbvh_get_grid_updates(PBVH *bvh, bool clear, void ***r_gridfaces, int *
while ((node = pbvh_iter_next(&iter))) {
if (node->flag & PBVH_UpdateNormals) {
- for (unsigned i = 0; i < node->totprim; ++i) {
+ for (unsigned i = 0; i < node->totprim; i++) {
void *face = bvh->gridfaces[node->prim_indices[i]];
BLI_gset_add(face_set, face);
}
@@ -1581,7 +1581,7 @@ bool BKE_pbvh_node_vert_update_check_any(PBVH *bvh, PBVHNode *node)
const int *verts = node->vert_indices;
const int totvert = node->uniq_verts + node->face_verts;
- for (int i = 0; i < totvert; ++i) {
+ for (int i = 0; i < totvert; i++) {
const int v = verts[i];
const MVert *mvert = &bvh->verts[v];
@@ -1769,7 +1769,7 @@ static bool pbvh_faces_node_raycast(PBVH *bvh,
float nearest_vertex_co[3];
copy_v3_fl(nearest_vertex_co, 0.0f);
- for (i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; i++) {
const MLoopTri *lt = &bvh->looptri[faces[i]];
const int *face_verts = node->face_vert_indices[i];
@@ -1827,7 +1827,7 @@ static bool pbvh_grids_node_raycast(PBVH *bvh,
const int gridsize = bvh->gridkey.grid_size;
bool hit = false;
- for (int i = 0; i < totgrid; ++i) {
+ for (int i = 0; i < totgrid; i++) {
CCGElem *grid = bvh->grids[node->prim_indices[i]];
BLI_bitmap *gh;
@@ -1837,8 +1837,8 @@ static bool pbvh_grids_node_raycast(PBVH *bvh,
gh = bvh->grid_hidden[node->prim_indices[i]];
- for (int y = 0; y < gridsize - 1; ++y) {
- for (int x = 0; x < gridsize - 1; ++x) {
+ for (int y = 0; y < gridsize - 1; y++) {
+ for (int x = 0; x < gridsize - 1; x++) {
/* check if grid face is hidden */
if (gh) {
if (paint_is_grid_face_hidden(gh, gridsize, x, y)) {
@@ -2029,7 +2029,7 @@ static bool pbvh_faces_node_nearest_to_ray(PBVH *bvh,
int i, totface = node->totprim;
bool hit = false;
- for (i = 0; i < totface; ++i) {
+ for (i = 0; i < totface; i++) {
const MLoopTri *lt = &bvh->looptri[faces[i]];
const int *face_verts = node->face_vert_indices[i];
@@ -2074,7 +2074,7 @@ static bool pbvh_grids_node_nearest_to_ray(PBVH *bvh,
const int gridsize = bvh->gridkey.grid_size;
bool hit = false;
- for (int i = 0; i < totgrid; ++i) {
+ for (int i = 0; i < totgrid; i++) {
CCGElem *grid = bvh->grids[node->prim_indices[i]];
BLI_bitmap *gh;
@@ -2084,8 +2084,8 @@ static bool pbvh_grids_node_nearest_to_ray(PBVH *bvh,
gh = bvh->grid_hidden[node->prim_indices[i]];
- for (int y = 0; y < gridsize - 1; ++y) {
- for (int x = 0; x < gridsize - 1; ++x) {
+ for (int y = 0; y < gridsize - 1; y++) {
+ for (int x = 0; x < gridsize - 1; x++) {
/* check if grid face is hidden */
if (gh) {
if (paint_is_grid_face_hidden(gh, gridsize, x, y)) {
@@ -2175,8 +2175,8 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3],
float vmin[3], vmax[3];
PlaneAABBIsect ret = ISECT_INSIDE;
- for (int i = 0; i < 4; ++i) {
- for (int axis = 0; axis < 3; ++axis) {
+ for (int i = 0; i < 4; i++) {
+ for (int axis = 0; axis < 3; axis++) {
if (planes[i][axis] > 0) {
vmin[axis] = bb_min[axis];
vmax[axis] = bb_max[axis];
@@ -2322,7 +2322,7 @@ void BKE_pbvh_grids_update(
bvh->grid_flag_mats = flagmats;
bvh->grid_hidden = grid_hidden;
- for (int a = 0; a < bvh->totnode; ++a) {
+ for (int a = 0; a < bvh->totnode; a++) {
BKE_pbvh_node_mark_rebuild_draw(&bvh->nodes[a]);
}
}
@@ -2390,7 +2390,7 @@ void BKE_pbvh_vert_coords_apply(PBVH *pbvh, const float (*vertCos)[3], const int
if (pbvh->verts) {
MVert *mvert = pbvh->verts;
/* copy new verts coords */
- for (int a = 0; a < pbvh->totvert; ++a, ++mvert) {
+ for (int a = 0; a < pbvh->totvert; a++, mvert++) {
/* no need for float comparison here (memory is exactly equal or not) */
if (memcmp(mvert->co, vertCos[a], sizeof(float[3])) != 0) {
copy_v3_v3(mvert->co, vertCos[a]);
@@ -2402,7 +2402,7 @@ void BKE_pbvh_vert_coords_apply(PBVH *pbvh, const float (*vertCos)[3], const int
BKE_mesh_calc_normals_looptri(
pbvh->verts, pbvh->totvert, pbvh->mloop, pbvh->looptri, pbvh->totprim, NULL);
- for (int a = 0; a < pbvh->totnode; ++a) {
+ for (int a = 0; a < pbvh->totnode; a++) {
BKE_pbvh_node_mark_update(&pbvh->nodes[a]);
}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 605f9b5b39e..b0e0f9f1efc 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1557,7 +1557,7 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_DEPSGRAPH_UPDATE_PRE);
}
- for (int pass = 0; pass < 2; ++pass) {
+ for (int pass = 0; pass < 2; pass++) {
/* (Re-)build dependency graph if needed. */
DEG_graph_relations_update(depsgraph, bmain, scene, view_layer);
/* Uncomment this to check if graph was properly tagged for update. */
@@ -1609,7 +1609,7 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
/* Keep this first. */
BLI_callback_exec(bmain, &scene->id, BLI_CB_EVT_FRAME_CHANGE_PRE);
- for (int pass = 0; pass < 2; ++pass) {
+ for (int pass = 0; pass < 2; pass++) {
/* Update animated image textures for particles, modifiers, gpu, etc,
* call this at the start so modifiers with textures don't lag 1 frame.
*/
diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 89f3f9ef9fd..dbdaaaa5fc3 100644
--- a/source/blender/blenkernel/intern/seqeffects.c
+++ b/source/blender/blenkernel/intern/seqeffects.c
@@ -3434,13 +3434,13 @@ static void do_gaussian_blur_effect_byte_x(Sequence *seq,
float *gausstab_x;
gausstab_x = make_gaussian_blur_kernel(data->size_x, size_x);
- for (i = 0; i < y; ++i) {
- for (j = 0; j < x; ++j) {
+ for (i = 0; i < y; i++) {
+ for (j = 0; j < x; j++) {
int out_index = INDEX(j, i);
float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float accum_weight = 0.0f;
- for (int current_x = j - size_x; current_x <= j + size_x; ++current_x) {
+ for (int current_x = j - size_x; current_x <= j + size_x; current_x++) {
if (current_x < 0 || current_x >= frame_width) {
/* Out of bounds. */
continue;
@@ -3484,12 +3484,12 @@ static void do_gaussian_blur_effect_byte_y(Sequence *seq,
float *gausstab_y;
gausstab_y = make_gaussian_blur_kernel(data->size_y, size_y);
- for (i = 0; i < y; ++i) {
- for (j = 0; j < x; ++j) {
+ for (i = 0; i < y; i++) {
+ for (j = 0; j < x; j++) {
int out_index = INDEX(j, i);
float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float accum_weight = 0.0f;
- for (int current_y = i - size_y; current_y <= i + size_y; ++current_y) {
+ for (int current_y = i - size_y; current_y <= i + size_y; current_y++) {
if (current_y < -start_line || current_y + start_line >= frame_height) {
/* Out of bounds. */
continue;
@@ -3532,12 +3532,12 @@ static void do_gaussian_blur_effect_float_x(Sequence *seq,
float *gausstab_x;
gausstab_x = make_gaussian_blur_kernel(data->size_x, size_x);
- for (i = 0; i < y; ++i) {
- for (j = 0; j < x; ++j) {
+ for (i = 0; i < y; i++) {
+ for (j = 0; j < x; j++) {
int out_index = INDEX(j, i);
float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float accum_weight = 0.0f;
- for (int current_x = j - size_x; current_x <= j + size_x; ++current_x) {
+ for (int current_x = j - size_x; current_x <= j + size_x; current_x++) {
if (current_x < 0 || current_x >= frame_width) {
/* Out of bounds. */
continue;
@@ -3573,12 +3573,12 @@ static void do_gaussian_blur_effect_float_y(Sequence *seq,
float *gausstab_y;
gausstab_y = make_gaussian_blur_kernel(data->size_y, size_y);
- for (i = 0; i < y; ++i) {
- for (j = 0; j < x; ++j) {
+ for (i = 0; i < y; i++) {
+ for (j = 0; j < x; j++) {
int out_index = INDEX(j, i);
float accum[4] = {0.0f, 0.0f, 0.0f, 0.0f};
float accum_weight = 0.0f;
- for (int current_y = i - size_y; current_y <= i + size_y; ++current_y) {
+ for (int current_y = i - size_y; current_y <= i + size_y; current_y++) {
if (current_y < -start_line || current_y + start_line >= frame_height) {
/* Out of bounds. */
continue;
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c
index b3f2a624ebe..9f45826d59e 100644
--- a/source/blender/blenkernel/intern/studiolight.c
+++ b/source/blender/blenkernel/intern/studiolight.c
@@ -762,7 +762,7 @@ static void studiolight_spherical_harmonics_calculate_coefficients(StudioLight *
/* The sum of solid angle should be equal to the solid angle of the sphere (4 PI),
* so normalize in order to make our weightAccum exactly match 4 PI. */
- for (int i = 0; i < STUDIOLIGHT_SH_COEFS_LEN; ++i) {
+ for (int i = 0; i < STUDIOLIGHT_SH_COEFS_LEN; i++) {
mul_v3_fl(sh[i], M_PI * 4.0f / weight_accum);
}
}
@@ -801,11 +801,11 @@ static float studiolight_spherical_harmonics_lambda_get(float *sh, float max_lap
}
const int no_iterations = 10000000;
- for (int i = 0; i < no_iterations; ++i) {
+ for (int i = 0; i < no_iterations; i++) {
float f = 0.0f;
float fd = 0.0f;
- for (int level = 1; level < STUDIOLIGHT_SH_BANDS; ++level) {
+ for (int level = 1; level < STUDIOLIGHT_SH_BANDS; level++) {
f += table_l[level] * table_b[level] / SQUARE(1.0f + lambda * table_l[level]);
fd += (2.0f * SQUARE(table_l[level]) * table_b[level]) /
CUBE(1.0f + lambda * table_l[level]);
@@ -882,7 +882,7 @@ BLI_INLINE void studiolight_spherical_harmonics_eval(StudioLight *sl,
{
#if STUDIOLIGHT_SH_BANDS == 2
float(*sh)[3] = (float(*)[3])sl->spherical_harmonics_coefs;
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
color[i] = studiolight_spherical_harmonics_geomerics_eval(
normal, sh[0][i], sh[1][i], sh[2][i], sh[3][i]);
}
@@ -1118,7 +1118,7 @@ static void studiolight_lights_eval(StudioLight *sl, float color[3], const float
copy_v3_v3(spec_light, sl->light_ambient);
reflect_v3_v3v3(R, I, N);
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
SolidLight *light = &sl->light[i];
if (light->flag) {
/* Diffuse lighting */
diff --git a/source/blender/blenkernel/intern/subdiv_converter_mesh.c b/source/blender/blenkernel/intern/subdiv_converter_mesh.c
index 37ca6d0e485..60f80628f5a 100644
--- a/source/blender/blenkernel/intern/subdiv_converter_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_converter_mesh.c
@@ -221,7 +221,7 @@ static void precalc_uv_layer(const OpenSubdiv_Converter *converter, const int la
mpoly, mloop, mloopuv, num_poly, num_vert, limit, false, true);
/* NOTE: First UV vertex is supposed to be always marked as separate. */
storage->num_uv_coordinates = -1;
- for (int vertex_index = 0; vertex_index < num_vert; ++vertex_index) {
+ for (int vertex_index = 0; vertex_index < num_vert; vertex_index++) {
const UvMapVert *uv_vert = BKE_mesh_uv_vert_map_get_vert(uv_vert_map, vertex_index);
while (uv_vert != NULL) {
if (uv_vert->separate) {
diff --git a/source/blender/blenkernel/intern/subdiv_eval.c b/source/blender/blenkernel/intern/subdiv_eval.c
index cb042e087d5..419371c7a4b 100644
--- a/source/blender/blenkernel/intern/subdiv_eval.c
+++ b/source/blender/blenkernel/intern/subdiv_eval.c
@@ -101,7 +101,7 @@ static void set_face_varying_data_from_uv(Subdiv *subdiv,
/* TODO(sergey): OpenSubdiv's C-API converter can change winding of
* loops of a face, need to watch for that, to prevent wrong UVs assigned.
*/
- for (int face_index = 0; face_index < num_faces; ++face_index) {
+ for (int face_index = 0; face_index < num_faces; face_index++) {
const int num_face_vertices = topology_refiner->getNumFaceVertices(topology_refiner,
face_index);
const int *uv_indices = topology_refiner->getFaceFVarValueIndices(
diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c
index 9d713d1937d..1604c2560ff 100644
--- a/source/blender/blenkernel/intern/subdiv_mesh.c
+++ b/source/blender/blenkernel/intern/subdiv_mesh.c
@@ -82,7 +82,7 @@ static void subdiv_mesh_ctx_cache_uv_layers(SubdivMeshContext *ctx)
{
Mesh *subdiv_mesh = ctx->subdiv_mesh;
ctx->num_uv_layers = CustomData_number_of_layers(&subdiv_mesh->ldata, CD_MLOOPUV);
- for (int layer_index = 0; layer_index < ctx->num_uv_layers; ++layer_index) {
+ for (int layer_index = 0; layer_index < ctx->num_uv_layers; layer_index++) {
ctx->uv_layers[layer_index] = CustomData_get_layer_n(
&subdiv_mesh->ldata, CD_MLOOPUV, layer_index);
}
@@ -220,7 +220,7 @@ static void vertex_interpolation_init(const SubdivMeshContext *ctx,
const float weight = 1.0f / (float)coarse_poly->totloop;
float *weights = BLI_array_alloca(weights, coarse_poly->totloop);
int *indices = BLI_array_alloca(indices, coarse_poly->totloop);
- for (int i = 0; i < coarse_poly->totloop; ++i) {
+ for (int i = 0; i < coarse_poly->totloop; i++) {
weights[i] = weight;
indices[i] = coarse_mloop[coarse_poly->loopstart + i].v;
}
@@ -352,7 +352,7 @@ static void loop_interpolation_init(const SubdivMeshContext *ctx,
const float weight = 1.0f / (float)coarse_poly->totloop;
float *weights = BLI_array_alloca(weights, coarse_poly->totloop);
int *indices = BLI_array_alloca(indices, coarse_poly->totloop);
- for (int i = 0; i < coarse_poly->totloop; ++i) {
+ for (int i = 0; i < coarse_poly->totloop; i++) {
weights[i] = weight;
indices[i] = coarse_poly->loopstart + i;
}
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 77dc438cd04..11d2314ace3 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -1784,7 +1784,7 @@ static void *ccgDM_get_tessface_data_layer(DerivedMesh *dm, int type)
/* With ccgdm, we have a simple one to one mapping between loops
* and tessellated face corners. */
- for (i = 0; i < numLoops; ++i, ++tlnors_it, ++lnors) {
+ for (i = 0; i < numLoops; i++, tlnors_it++, lnors++) {
normal_float_to_short_v3(*tlnors_it, *lnors);
}
}
@@ -2263,7 +2263,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
}
if (edgeOrigIndex) {
- for (i = 0; i < numFinalEdges; ++i) {
+ for (i = 0; i < numFinalEdges; i++) {
edgeOrigIndex[edgeNum + i] = ORIGINDEX_NONE;
}
}
@@ -2321,7 +2321,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
edgeNum += numFinalEdges;
}
- for (index = 0; index < totedge; ++index) {
+ for (index = 0; index < totedge; index++) {
CCGEdge *e = ccgdm->edgeMap[index].edge;
int numFinalEdges = edgeSize - 1;
int mapIndex = ccgDM_getEdgeMapIndex(ss, e);
@@ -2359,13 +2359,13 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
if (has_edge_cd) {
BLI_assert(edgeIdx >= 0 && edgeIdx < dm->getNumEdges(dm));
- for (i = 0; i < numFinalEdges; ++i) {
+ for (i = 0; i < numFinalEdges; i++) {
CustomData_copy_data(&dm->edgeData, &ccgdm->dm.edgeData, edgeIdx, edgeNum + i, 1);
}
}
if (edgeOrigIndex) {
- for (i = 0; i < numFinalEdges; ++i) {
+ for (i = 0; i < numFinalEdges; i++) {
edgeOrigIndex[edgeNum + i] = mapIndex;
}
}
@@ -2384,7 +2384,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
}
}
- for (index = 0; index < totvert; ++index) {
+ for (index = 0; index < totvert; index++) {
CCGVert *v = ccgdm->vertMap[index].vert;
int mapIndex = ccgDM_getVertMapIndex(ccgdm->ss, v);
int vertIdx;
diff --git a/source/blender/blenkernel/intern/tracking.c b/source/blender/blenkernel/intern/tracking.c
index a5445be7ce5..1e7b3af53d5 100644
--- a/source/blender/blenkernel/intern/tracking.c
+++ b/source/blender/blenkernel/intern/tracking.c
@@ -1843,18 +1843,18 @@ void BKE_tracking_plane_marker_get_subframe_corners(MovieTrackingPlaneTrack *pla
MovieTrackingPlaneMarker *marker_next = marker + 1;
if (marker_next->framenr == marker->framenr + 1) {
float fac = (framenr - (int)framenr) / (marker_next->framenr - marker->framenr);
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
interp_v2_v2v2(corners[i], marker->corners[i], marker_next->corners[i], fac);
}
}
else {
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
copy_v2_v2(corners[i], marker->corners[i]);
}
}
}
else {
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
copy_v2_v2(corners[i], marker->corners[i]);
}
}
diff --git a/source/blender/blenkernel/intern/tracking_auto.c b/source/blender/blenkernel/intern/tracking_auto.c
index 47c12b329dc..fad928c12fe 100644
--- a/source/blender/blenkernel/intern/tracking_auto.c
+++ b/source/blender/blenkernel/intern/tracking_auto.c
@@ -133,7 +133,7 @@ static void dna_marker_to_libmv_marker(/*const*/ MovieTrackingTrack *track,
libmv_marker->track = track_index;
normalized_to_libmv_frame(marker->pos, frame_dimensions, libmv_marker->center);
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
normalized_relative_to_libmv_frame(
marker->pattern_corners[i], marker->pos, frame_dimensions, libmv_marker->patch[i]);
}
@@ -187,7 +187,7 @@ static void libmv_marker_to_dna_marker(libmv_Marker *libmv_marker,
marker->framenr = libmv_marker->frame;
libmv_frame_to_normalized(libmv_marker->center, frame_dimensions, marker->pos);
- for (i = 0; i < 4; ++i) {
+ for (i = 0; i < 4; i++) {
libmv_frame_to_normalized_relative(libmv_marker->patch[i],
libmv_marker->center,
frame_dimensions,
@@ -261,7 +261,7 @@ static void fill_autotrack_tracks(const int frame_width,
/* Count number of markers to be put to a context. */
size_t num_trackable_markers = 0;
for (MovieTrackingTrack *track = tracksbase->first; track != NULL; track = track->next) {
- for (int i = 0; i < track->markersnr; ++i) {
+ for (int i = 0; i < track->markersnr; i++) {
const MovieTrackingMarker *marker = track->markers + i;
if ((marker->flag & MARKER_DISABLED) == 0) {
num_trackable_markers++;
@@ -278,7 +278,7 @@ static void fill_autotrack_tracks(const int frame_width,
/* Fill in markers array. */
int track_index = 0, num_filled_libmv_markers = 0;
for (MovieTrackingTrack *track = tracksbase->first; track != NULL; track = track->next) {
- for (int i = 0; i < track->markersnr; ++i) {
+ for (int i = 0; i < track->markersnr; i++) {
MovieTrackingMarker *marker = track->markers + i;
if ((marker->flag & MARKER_DISABLED) != 0) {
continue;
@@ -319,7 +319,7 @@ static void create_per_track_tracking_options(const MovieClip *clip,
int i = 0, track_index = 0;
for (MovieTrackingTrack *track = tracksbase->first; track != NULL; track = track->next) {
if (!check_track_trackable(clip, track, user)) {
- ++track_index;
+ track_index++;
continue;
}
AutoTrackOptions *options = &context->options[i++];
@@ -330,7 +330,7 @@ static void create_per_track_tracking_options(const MovieClip *clip,
tracking_configure_tracker(track, NULL, &options->track_region_options);
options->use_keyframe_match = track->pattern_match == TRACK_MATCH_KEYFRAME;
context->tracks[track_index] = track;
- ++track_index;
+ track_index++;
}
}
@@ -471,7 +471,7 @@ void BKE_autotrack_context_sync(AutoTrackContext *context)
libmv_Marker libmv_marker;
int clip = 0;
int track;
- for (track = 0; track < context->num_tracks; ++track) {
+ for (track = 0; track < context->num_tracks; track++) {
AutoTrackOptions *options = &context->options[track];
int track_frame = BKE_movieclip_remap_scene_to_clip_frame(
context->clips[options->clip_index], frame);
@@ -506,7 +506,7 @@ void BKE_autotrack_context_sync(AutoTrackContext *context)
}
BLI_spin_unlock(&context->spin_lock);
- for (int clip = 0; clip < context->num_clips; ++clip) {
+ for (int clip = 0; clip < context->num_clips; clip++) {
MovieTracking *tracking = &context->clips[clip]->tracking;
BKE_tracking_dopesheet_tag_update(tracking);
}
@@ -524,7 +524,7 @@ void BKE_autotrack_context_finish(AutoTrackContext *context)
{
int clip_index;
- for (clip_index = 0; clip_index < context->num_clips; ++clip_index) {
+ for (clip_index = 0; clip_index < context->num_clips; clip_index++) {
MovieClip *clip = context->clips[clip_index];
ListBase *plane_tracks_base = BKE_tracking_get_active_plane_tracks(&clip->tracking);
MovieTrackingPlaneTrack *plane_track;
@@ -532,7 +532,7 @@ void BKE_autotrack_context_finish(AutoTrackContext *context)
for (plane_track = plane_tracks_base->first; plane_track; plane_track = plane_track->next) {
if ((plane_track->flag & PLANE_TRACK_AUTOKEY) == 0) {
int track;
- for (track = 0; track < context->num_tracks; ++track) {
+ for (track = 0; track < context->num_tracks; track++) {
if (BKE_tracking_plane_track_has_point_track(plane_track,
context->options[track].track)) {
BKE_tracking_track_plane_from_existing_motion(plane_track, context->first_frame);
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index 7da36ba9af9..2c270f10908 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -274,10 +274,10 @@ static int search_closest_marker_index(MovieTrackingTrack *track, int ref_frame)
i = MAX2(0, i);
i = MIN2(i, end - 1);
- for (; i < end - 1 && markers[i].framenr <= ref_frame; ++i) {
+ for (; i < end - 1 && markers[i].framenr <= ref_frame; i++) {
/* pass */
}
- for (; 0 < i && markers[i].framenr > ref_frame; --i) {
+ for (; 0 < i && markers[i].framenr > ref_frame; i--) {
/* pass */
}
@@ -294,7 +294,7 @@ static void retrieve_next_higher_usable_frame(
while (i < end &&
(markers[i].framenr < ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) {
- ++i;
+ i++;
}
if (i < end && markers[i].framenr < *next_higher) {
BLI_assert(markers[i].framenr >= ref_frame);
@@ -309,7 +309,7 @@ static void retrieve_next_lower_usable_frame(
BLI_assert(0 <= i && i < track->markersnr);
while (i >= 0 &&
(markers[i].framenr > ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) {
- --i;
+ i--;
}
if (0 <= i && markers[i].framenr > *next_lower) {
BLI_assert(markers[i].framenr <= ref_frame);
@@ -782,7 +782,7 @@ static int establish_track_initialization_order(StabContext *ctx, TrackInitOrder
if (marker != NULL && (track->flag & (TRACK_USE_2D_STAB | TRACK_USE_2D_STAB_ROT))) {
order[tracknr].sort_value = abs(marker->framenr - anchor_frame);
order[tracknr].reference_frame = marker->framenr;
- ++tracknr;
+ tracknr++;
}
}
if (tracknr) {
@@ -907,7 +907,7 @@ static void initialize_all_tracks(StabContext *ctx, float aspect)
local_data->track_weight_curve = retrieve_track_weight_animation(clip, track);
local_data->is_init_for_stabilization = false;
- ++track_len;
+ track_len++;
}
if (!track_len) {
return;
@@ -927,7 +927,7 @@ static void initialize_all_tracks(StabContext *ctx, float aspect)
average_marker_positions(ctx, reference_frame, average_pos);
setup_pivot(average_pos, pivot);
- for (i = 0; i < track_len; ++i) {
+ for (i = 0; i < track_len; i++) {
track = order[i].data;
if (reference_frame != order[i].reference_frame) {
reference_frame = order[i].reference_frame;
diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c
index 358d8fa0a3e..ed582dc5b94 100644
--- a/source/blender/blenkernel/intern/tracking_util.c
+++ b/source/blender/blenkernel/intern/tracking_util.c
@@ -688,7 +688,7 @@ static ImBuf *make_grayscale_ibuf_copy(ImBuf *ibuf)
grayscale->mall |= IB_rectfloat;
grayscale->flags |= IB_rectfloat;
- for (i = 0; i < grayscale->x * grayscale->y; ++i) {
+ for (i = 0; i < grayscale->x * grayscale->y; i++) {
const float *pixel = ibuf->rect_float + ibuf->channels * i;
grayscale->rect_float[i] = 0.2126f * pixel[0] + 0.7152f * pixel[1] + 0.0722f * pixel[2];
@@ -790,9 +790,9 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
* here. Probably Libmv is better to work in the linear space,
* but keep sRGB space here for compatibility for now.
*/
- for (y = 0; y < clamped_height; ++y) {
+ for (y = 0; y < clamped_height; y++) {
int x;
- for (x = 0; x < clamped_width; ++x) {
+ for (x = 0; x < clamped_width; x++) {
int src_x = x + clamped_origin_x, src_y = y + clamped_origin_y;
int dst_x = x + dst_offset_x, dst_y = y + dst_offset_y;
int dst_index = (dst_y * width + dst_x) * 4,