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:
-rw-r--r--source/blender/alembic/intern/abc_curves.cc26
-rw-r--r--source/blender/alembic/intern/abc_customdata.cc34
-rw-r--r--source/blender/alembic/intern/abc_exporter.cc16
-rw-r--r--source/blender/alembic/intern/abc_hair.cc14
-rw-r--r--source/blender/alembic/intern/abc_mesh.cc50
-rw-r--r--source/blender/alembic/intern/abc_nurbs.cc18
-rw-r--r--source/blender/alembic/intern/abc_object.cc16
-rw-r--r--source/blender/alembic/intern/abc_transform.cc2
-rw-r--r--source/blender/alembic/intern/abc_util.cc8
-rw-r--r--source/blender/alembic/intern/alembic_capi.cc18
-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
-rw-r--r--source/blender/blenlib/intern/BLI_filelist.c4
-rw-r--r--source/blender/blenlib/intern/fileops.c2
-rw-r--r--source/blender/blenlib/intern/hash_md5.c4
-rw-r--r--source/blender/blenlib/intern/list_sort_impl.h4
-rw-r--r--source/blender/blenlib/intern/math_interp.c4
-rw-r--r--source/blender/blenlib/intern/path_util.c8
-rw-r--r--source/blender/blenlib/intern/string.c2
-rw-r--r--source/blender/blenlib/intern/string_utf8.c10
-rw-r--r--source/blender/blenlib/intern/task.c16
-rw-r--r--source/blender/blenloader/intern/readfile.c8
-rw-r--r--source/blender/blenloader/intern/versioning_260.c4
-rw-r--r--source/blender/blenloader/intern/versioning_280.c2
-rw-r--r--source/blender/blenloader/intern/writefile.c6
-rw-r--r--source/blender/collada/AnimationExporter.cpp8
-rw-r--r--source/blender/collada/BCAnimationCurve.cpp4
-rw-r--r--source/blender/collada/BCAnimationSampler.cpp28
-rw-r--r--source/blender/collada/BCAnimationSampler.h4
-rw-r--r--source/blender/collada/BCSampleData.cpp4
-rw-r--r--source/blender/collada/ControllerExporter.cpp6
-rw-r--r--source/blender/collada/DocumentImporter.cpp12
-rw-r--r--source/blender/collada/SceneExporter.cpp2
-rw-r--r--source/blender/collada/collada_utils.cpp4
-rw-r--r--source/blender/compositor/intern/COM_Debug.cpp14
-rw-r--r--source/blender/compositor/intern/COM_NodeGraph.cpp6
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp2
-rw-r--r--source/blender/compositor/intern/COM_NodeOperationBuilder.cpp54
-rw-r--r--source/blender/compositor/nodes/COM_CornerPinNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_CryptomatteNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_ImageNode.cpp2
-rw-r--r--source/blender/compositor/nodes/COM_OutputFileNode.cpp4
-rw-r--r--source/blender/compositor/operations/COM_BlurBaseOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_DenoiseOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_DilateErodeOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp2
-rw-r--r--source/blender/compositor/operations/COM_DisplaceOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp18
-rw-r--r--source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp16
-rw-r--r--source/blender/compositor/operations/COM_GlareStreaksOperation.cpp6
-rw-r--r--source/blender/compositor/operations/COM_KeyingBlurOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_KeyingClipOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_MapUVOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cpp10
-rw-r--r--source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp8
-rw-r--r--source/blender/compositor/operations/COM_PlaneTrackOperation.cpp4
-rw-r--r--source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_cycle.cc2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc2
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_transitive.cc6
-rw-r--r--source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc4
-rw-r--r--source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_debug.cc10
-rw-r--r--source/blender/draw/engines/eevee/eevee_bloom.c12
-rw-r--r--source/blender/draw/engines/eevee/eevee_depth_of_field.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_effects.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightcache.c26
-rw-r--r--source/blender/draw/engines/eevee/eevee_lightprobes.c12
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c12
-rw-r--r--source/blender/draw/engines/eevee/eevee_render.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_screen_raytrace.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_shadows.c6
-rw-r--r--source/blender/draw/engines/eevee/eevee_shadows_cascade.c16
-rw-r--r--source/blender/draw/engines/eevee/eevee_temporal_sampling.c6
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl4
-rw-r--r--source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl8
-rw-r--r--source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl2
-rw-r--r--source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl2
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl6
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl2
-rw-r--r--source/blender/draw/engines/workbench/workbench_deferred.c6
-rw-r--r--source/blender/draw/engines/workbench/workbench_effect_dof.c6
-rw-r--r--source/blender/draw/engines/workbench/workbench_forward.c4
-rw-r--r--source/blender/draw/engines/workbench/workbench_studiolight.c16
-rw-r--r--source/blender/draw/engines/workbench/workbench_volume.c2
-rw-r--r--source/blender/draw/intern/draw_cache.c80
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.c2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_curve.c22
-rw-r--r--source/blender/draw/intern/draw_cache_impl_lattice.c4
-rw-r--r--source/blender/draw/intern/draw_cache_impl_mesh.c30
-rw-r--r--source/blender/draw/intern/draw_cache_impl_metaball.c2
-rw-r--r--source/blender/draw/intern/draw_cache_impl_particles.c8
-rw-r--r--source/blender/draw/intern/draw_common.c4
-rw-r--r--source/blender/draw/intern/draw_debug.c4
-rw-r--r--source/blender/draw/intern/draw_hair.c10
-rw-r--r--source/blender/draw/intern/draw_instance_data.c8
-rw-r--r--source/blender/draw/intern/draw_manager_data.c4
-rw-r--r--source/blender/draw/intern/draw_manager_exec.c6
-rw-r--r--source/blender/draw/intern/draw_manager_profiling.c6
-rw-r--r--source/blender/draw/modes/edit_armature_mode.c2
-rw-r--r--source/blender/draw/modes/object_mode.c6
-rw-r--r--source/blender/draw/modes/pose_mode.c2
-rw-r--r--source/blender/editors/animation/anim_draw.c2
-rw-r--r--source/blender/editors/armature/armature_skinning.c4
-rw-r--r--source/blender/editors/curve/editcurve.c2
-rw-r--r--source/blender/editors/gizmo_library/gizmo_draw_utils.c2
-rw-r--r--source/blender/editors/interface/interface_draw.c4
-rw-r--r--source/blender/editors/interface/interface_templates.c2
-rw-r--r--source/blender/editors/interface/interface_widgets.c4
-rw-r--r--source/blender/editors/interface/view2d.c6
-rw-r--r--source/blender/editors/io/io_alembic.c2
-rw-r--r--source/blender/editors/mask/mask_add.c2
-rw-r--r--source/blender/editors/mask/mask_draw.c2
-rw-r--r--source/blender/editors/object/object_transform.c8
-rw-r--r--source/blender/editors/physics/particle_edit.c2
-rw-r--r--source/blender/editors/physics/particle_object.c4
-rw-r--r--source/blender/editors/render/render_preview.c2
-rw-r--r--source/blender/editors/screen/screen_draw.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c4
-rw-r--r--source/blender/editors/sculpt_paint/paint_utils.c6
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c18
-rw-r--r--source/blender/editors/space_file/file_ops.c4
-rw-r--r--source/blender/editors/space_file/filelist.c2
-rw-r--r--source/blender/editors/space_file/filesel.c4
-rw-r--r--source/blender/editors/space_file/fsmenu.c2
-rw-r--r--source/blender/editors/space_node/drawnode.c10
-rw-r--r--source/blender/editors/space_node/node_draw.c12
-rw-r--r--source/blender/editors/space_node/node_group.c6
-rw-r--r--source/blender/editors/space_node/node_relationships.c12
-rw-r--r--source/blender/editors/space_node/node_templates.c12
-rw-r--r--source/blender/editors/space_node/space_node.c8
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c2
-rw-r--r--source/blender/editors/undo/ed_undo.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c2
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c4
-rw-r--r--source/blender/gpu/intern/gpu_attr_binding.c4
-rw-r--r--source/blender/gpu/intern/gpu_batch.c36
-rw-r--r--source/blender/gpu/intern/gpu_buffers.c14
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c2
-rw-r--r--source/blender/gpu/intern/gpu_draw.c2
-rw-r--r--source/blender/gpu/intern/gpu_element.c6
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c8
-rw-r--r--source/blender/gpu/intern/gpu_immediate.c6
-rw-r--r--source/blender/gpu/intern/gpu_immediate_util.c20
-rw-r--r--source/blender/gpu/intern/gpu_material.c6
-rw-r--r--source/blender/gpu/intern/gpu_shader_interface.c16
-rw-r--r--source/blender/gpu/intern/gpu_texture.c12
-rw-r--r--source/blender/gpu/intern/gpu_vertex_buffer.c2
-rw-r--r--source/blender/gpu/intern/gpu_vertex_format.c8
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c4
-rw-r--r--source/blender/gpu/shaders/gpu_shader_geometry.glsl2
-rw-r--r--source/blender/ikplugin/intern/itasc_plugin.cpp24
-rw-r--r--source/blender/imbuf/intern/dds/FlipDXT.cpp8
-rw-r--r--source/blender/imbuf/intern/indexer.c6
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp16
-rw-r--r--source/blender/imbuf/intern/targa.c4
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c38
-rw-r--r--source/blender/modifiers/intern/MOD_skin.c6
-rw-r--r--source/blender/modifiers/intern/MOD_util.c4
-rw-r--r--source/blender/modifiers/intern/MOD_uvproject.c18
-rw-r--r--source/blender/modifiers/intern/MOD_weightvg_util.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_colorbalance.c4
-rw-r--r--source/blender/nodes/composite/nodes/node_composite_cryptomatte.c4
-rw-r--r--source/blender/nodes/intern/node_exec.c10
-rw-r--r--source/blender/nodes/intern/node_util.c10
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c4
-rw-r--r--source/blender/nodes/shader/node_shader_util.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_common.c8
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_curves.c2
-rw-r--r--source/blender/nodes/texture/nodes/node_texture_common.c4
-rw-r--r--source/blender/physics/intern/BPH_mass_spring.cpp8
-rw-r--r--source/blender/physics/intern/ConstrainedConjugateGradient.h2
-rw-r--r--source/blender/physics/intern/eigen_utils.h26
-rw-r--r--source/blender/physics/intern/hair_volume.cpp84
-rw-r--r--source/blender/physics/intern/implicit_blender.c24
-rw-r--r--source/blender/physics/intern/implicit_eigen.cpp44
-rw-r--r--source/blender/python/intern/bpy_props.c12
-rw-r--r--source/blender/python/mathutils/mathutils_noise.c4
-rw-r--r--source/blender/render/intern/source/imagetexture.c4
-rw-r--r--source/blender/render/intern/source/pipeline.c4
-rw-r--r--source/blender/render/intern/source/pointdensity.c8
217 files changed, 1114 insertions, 1114 deletions
diff --git a/source/blender/alembic/intern/abc_curves.cc b/source/blender/alembic/intern/abc_curves.cc
index 13872618d74..50aa13bea4f 100644
--- a/source/blender/alembic/intern/abc_curves.cc
+++ b/source/blender/alembic/intern/abc_curves.cc
@@ -111,7 +111,7 @@ void AbcCurveWriter::do_write()
const BPoint *point = nurbs->bp;
- for (int i = 0; i < totpoint; ++i, ++point) {
+ for (int i = 0; i < totpoint; i++, point++) {
copy_yup_from_zup(temp_vert.getValue(), point->vec);
verts.push_back(temp_vert);
weights.push_back(point->vec[3]);
@@ -127,7 +127,7 @@ void AbcCurveWriter::do_write()
const BezTriple *bezier = nurbs->bezt;
/* TODO(kevin): store info about handles, Alembic doesn't have this. */
- for (int i = 0; i < totpoint; ++i, ++bezier) {
+ for (int i = 0; i < totpoint; i++, bezier++) {
copy_yup_from_zup(temp_vert.getValue(), bezier->vec[1]);
verts.push_back(temp_vert);
widths.push_back(bezier->radius);
@@ -144,7 +144,7 @@ void AbcCurveWriter::do_write()
* cyclic since other software need those.
*/
- for (int i = 0; i < nurbs->orderu; ++i) {
+ for (int i = 0; i < nurbs->orderu; i++) {
verts.push_back(verts[i]);
}
}
@@ -156,7 +156,7 @@ void AbcCurveWriter::do_write()
* require/expect them. */
knots.resize(num_knots + 2);
- for (int i = 0; i < num_knots; ++i) {
+ for (int i = 0; i < num_knots; i++) {
knots[i + 1] = nurbs->knotsu[i];
}
@@ -316,7 +316,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
int knot_offset = 0;
size_t idx = 0;
- for (size_t i = 0; i < num_vertices->size(); ++i) {
+ for (size_t i = 0; i < num_vertices->size(); i++) {
const int num_verts = (*num_vertices)[i];
Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb"));
@@ -357,7 +357,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
const int end = idx + num_verts;
int overlap = 0;
- for (int j = start, k = end - nu->orderu; j < nu->orderu; ++j, ++k) {
+ for (int j = start, k = end - nu->orderu; j < nu->orderu; j++, k++) {
const Imath::V3f &p1 = (*positions)[j];
const Imath::V3f &p2 = (*positions)[k];
@@ -365,7 +365,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
break;
}
- ++overlap;
+ overlap++;
}
/* TODO: Special case, need to figure out how it coincides with knots. */
@@ -393,7 +393,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
nu->bp = static_cast<BPoint *>(MEM_callocN(sizeof(BPoint) * nu->pntsu, "abc_getnurb"));
BPoint *bp = nu->bp;
- for (int j = 0; j < nu->pntsu; ++j, ++bp, ++idx) {
+ for (int j = 0; j < nu->pntsu; j++, bp++, idx++) {
const Imath::V3f &pos = (*positions)[idx];
if (do_radius) {
@@ -418,7 +418,7 @@ void AbcCurveReader::read_curve_sample(Curve *cu,
/* TODO: second check is temporary, for until the check for cycles is rock solid. */
if (periodicity == Alembic::AbcGeom::kPeriodic && (KNOTSU(nu) == knots->size() - 2)) {
/* Skip first and last knots. */
- for (size_t i = 1; i < knots->size() - 1; ++i) {
+ for (size_t i = 1; i < knots->size() - 1; i++) {
nu->knotsu[i - 1] = (*knots)[knot_offset + i];
}
}
@@ -476,7 +476,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh,
if (same_topology) {
Nurb *nurbs = static_cast<Nurb *>(curve->nurb.first);
- for (curve_idx = 0; nurbs; nurbs = nurbs->next, ++curve_idx) {
+ for (curve_idx = 0; nurbs; nurbs = nurbs->next, curve_idx++) {
const int num_in_alembic = (*num_vertices)[curve_idx];
const int num_in_blender = nurbs->pntsu;
@@ -493,13 +493,13 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh,
}
else {
Nurb *nurbs = static_cast<Nurb *>(curve->nurb.first);
- for (curve_idx = 0; nurbs; nurbs = nurbs->next, ++curve_idx) {
+ for (curve_idx = 0; nurbs; nurbs = nurbs->next, curve_idx++) {
const int totpoint = (*num_vertices)[curve_idx];
if (nurbs->bp) {
BPoint *point = nurbs->bp;
- for (int i = 0; i < totpoint; ++i, ++point, ++vertex_idx) {
+ for (int i = 0; i < totpoint; i++, point++, vertex_idx++) {
const Imath::V3f &pos = (*positions)[vertex_idx];
copy_zup_from_yup(point->vec, pos.getValue());
}
@@ -507,7 +507,7 @@ Mesh *AbcCurveReader::read_mesh(Mesh *existing_mesh,
else if (nurbs->bezt) {
BezTriple *bezier = nurbs->bezt;
- for (int i = 0; i < totpoint; ++i, ++bezier, ++vertex_idx) {
+ for (int i = 0; i < totpoint; i++, bezier++, vertex_idx++) {
const Imath::V3f &pos = (*positions)[vertex_idx];
copy_zup_from_yup(bezier->vec[1], pos.getValue());
}
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc
index 63887d36381..7f04bb77052 100644
--- a/source/blender/alembic/intern/abc_customdata.cc
+++ b/source/blender/alembic/intern/abc_customdata.cc
@@ -72,12 +72,12 @@ static void get_uvs(const CDStreamConfig &config,
uvs.resize(config.totloop);
/* Iterate in reverse order to match exported polygons. */
- for (int i = 0; i < num_poly; ++i) {
+ for (int i = 0; i < num_poly; i++) {
MPoly &current_poly = polygons[i];
MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop;
- for (int j = 0; j < current_poly.totloop; ++j, ++cnt) {
- --loopuv;
+ for (int j = 0; j < current_poly.totloop; j++, cnt++) {
+ loopuv--;
uvidx[cnt] = cnt;
uvs[cnt][0] = loopuv->uv[0];
@@ -90,14 +90,14 @@ static void get_uvs(const CDStreamConfig &config,
std::vector<std::vector<uint32_t>> idx_map(config.totvert);
int idx_count = 0;
- for (int i = 0; i < num_poly; ++i) {
+ for (int i = 0; i < num_poly; i++) {
MPoly &current_poly = polygons[i];
MLoop *looppoly = mloop + current_poly.loopstart + current_poly.totloop;
MLoopUV *loopuv = mloopuv_array + current_poly.loopstart + current_poly.totloop;
- for (int j = 0; j < current_poly.totloop; ++j) {
- --looppoly;
- --loopuv;
+ for (int j = 0; j < current_poly.totloop; j++) {
+ looppoly--;
+ loopuv--;
Imath::V2f uv(loopuv->uv[0], loopuv->uv[1]);
bool found_same = false;
@@ -188,12 +188,12 @@ static void write_mcol(const OCompoundProperty &prop,
Imath::C4f col;
- for (int i = 0; i < config.totpoly; ++i) {
+ for (int i = 0; i < config.totpoly; i++) {
MPoly *p = &polys[i];
MCol *cface = &cfaces[p->loopstart + p->totloop];
MLoop *mloop = &mloops[p->loopstart + p->totloop];
- for (int j = 0; j < p->totloop; ++j) {
+ for (int j = 0; j < p->totloop; j++) {
cface--;
mloop--;
@@ -230,7 +230,7 @@ void write_custom_data(const OCompoundProperty &prop,
const int active_layer = CustomData_get_active_layer(data, cd_data_type);
const int tot_layers = CustomData_number_of_layers(data, cd_data_type);
- for (int i = 0; i < tot_layers; ++i) {
+ for (int i = 0; i < tot_layers; i++) {
void *cd_data = CustomData_get_layer_n(data, cd_data_type, i);
const char *name = CustomData_get_layer_name(data, cd_data_type, i);
@@ -268,11 +268,11 @@ static void read_uvs(const CDStreamConfig &config,
unsigned int uv_index, loop_index, rev_loop_index;
- for (int i = 0; i < config.totpoly; ++i) {
+ for (int i = 0; i < config.totpoly; i++) {
MPoly &poly = mpolys[i];
unsigned int rev_loop_offset = poly.loopstart + poly.totloop - 1;
- for (int f = 0; f < poly.totloop; ++f) {
+ for (int f = 0; f < poly.totloop; f++) {
loop_index = poly.loopstart + f;
rev_loop_index = rev_loop_offset - f;
uv_index = (*indices)[loop_index];
@@ -368,14 +368,14 @@ static void read_custom_data_mcols(const std::string &iobject_full_name,
* is why we have to check for indices->size() > 0 */
bool use_dual_indexing = is_facevarying && indices->size() > 0;
- for (int i = 0; i < config.totpoly; ++i) {
+ for (int i = 0; i < config.totpoly; i++) {
MPoly *poly = &mpolys[i];
MCol *cface = &cfaces[poly->loopstart + poly->totloop];
MLoop *mloop = &mloops[poly->loopstart + poly->totloop];
- for (int j = 0; j < poly->totloop; ++j, ++face_index) {
- --cface;
- --mloop;
+ for (int j = 0; j < poly->totloop; j++, face_index++) {
+ cface--;
+ mloop--;
color_index = is_facevarying ? face_index : mloop->v;
if (use_dual_indexing) {
@@ -456,7 +456,7 @@ void read_custom_data(const std::string &iobject_full_name,
const size_t num_props = prop.getNumProperties();
- for (size_t i = 0; i < num_props; ++i) {
+ for (size_t i = 0; i < num_props; i++) {
const Alembic::Abc::PropertyHeader &prop_header = prop.getPropertyHeader(i);
/* Read UVs according to convention. */
diff --git a/source/blender/alembic/intern/abc_exporter.cc b/source/blender/alembic/intern/abc_exporter.cc
index f19e0257b1b..9c1909b6022 100644
--- a/source/blender/alembic/intern/abc_exporter.cc
+++ b/source/blender/alembic/intern/abc_exporter.cc
@@ -197,12 +197,12 @@ AbcExporter::~AbcExporter()
{
/* Free xforms map */
m_xforms_type::iterator it_x, e_x;
- for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; ++it_x) {
+ for (it_x = m_xforms.begin(), e_x = m_xforms.end(); it_x != e_x; it_x++) {
delete it_x->second;
}
/* Free shapes vector */
- for (int i = 0, e = m_shapes.size(); i != e; ++i) {
+ for (int i = 0, e = m_shapes.size(); i != e; i++) {
delete m_shapes[i];
}
@@ -223,7 +223,7 @@ void AbcExporter::getShutterSamples(unsigned int nr_of_samples,
double time_inc = (shutter_close - shutter_open) / nr_of_samples;
/* sample between shutter open & close */
- for (int sample = 0; sample < nr_of_samples; ++sample) {
+ for (int sample = 0; sample < nr_of_samples; sample++) {
double sample_time = shutter_open + time_inc * sample;
double time = (frame_offset + sample_time) / time_factor;
@@ -257,7 +257,7 @@ void AbcExporter::getFrameSet(unsigned int nr_of_samples, std::set<double> &fram
getShutterSamples(nr_of_samples, false, shutter_samples);
for (double frame = m_settings.frame_start; frame <= m_settings.frame_end; frame += 1.0) {
- for (size_t j = 0; j < nr_of_samples; ++j) {
+ for (size_t j = 0; j < nr_of_samples; j++) {
frames.insert(frame + shutter_samples[j]);
}
}
@@ -331,7 +331,7 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
const float size = static_cast<float>(frames.size());
size_t i = 0;
- for (; begin != end; ++begin) {
+ for (; begin != end; begin++) {
progress = (++i / size);
if (G.is_break) {
@@ -345,7 +345,7 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
setCurrentFrame(m_bmain, frame);
if (shape_frames.count(frame) != 0) {
- for (int i = 0, e = m_shapes.size(); i != e; ++i) {
+ for (int i = 0, e = m_shapes.size(); i != e; i++) {
m_shapes[i]->write();
}
}
@@ -355,14 +355,14 @@ void AbcExporter::operator()(float &progress, bool &was_canceled)
}
m_xforms_type::iterator xit, xe;
- for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) {
+ for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) {
xit->second->write();
}
/* Save the archive 's bounding box. */
Imath::Box3d bounds;
- for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; ++xit) {
+ for (xit = m_xforms.begin(), xe = m_xforms.end(); xit != xe; xit++) {
Imath::Box3d box = xit->second->bounds();
bounds.extendBy(box);
}
diff --git a/source/blender/alembic/intern/abc_hair.cc b/source/blender/alembic/intern/abc_hair.cc
index b2489169856..38042bc7286 100644
--- a/source/blender/alembic/intern/abc_hair.cc
+++ b/source/blender/alembic/intern/abc_hair.cc
@@ -139,7 +139,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
float normal[3];
Imath::V3f tmp_nor;
- for (int p = 0; p < m_psys->totpart; ++p, ++pa) {
+ for (int p = 0; p < m_psys->totpart; p++, pa++) {
/* underlying info for faces-only emission */
path = cache[p];
@@ -173,7 +173,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
const int num = (pa->num_dmcache >= 0) ? pa->num_dmcache : pa->num;
/* iterate over all faces to find a corresponding underlying UV */
- for (int n = 0; n < mesh->totface; ++n) {
+ for (int n = 0; n < mesh->totface; n++) {
MFace *face = &mface[n];
MTFace *tface = mtface + n;
unsigned int vtx[4];
@@ -183,7 +183,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
vtx[3] = face->v4;
bool found = false;
- for (int o = 0; o < 4; ++o) {
+ for (int o = 0; o < 4; o++) {
if (o > 2 && vtx[o] == 0) {
break;
}
@@ -210,7 +210,7 @@ void AbcHairWriter::write_hair_sample(Mesh *mesh,
int steps = path->segments + 1;
hvertices.push_back(steps);
- for (k = 0; k < steps; ++k, ++path) {
+ for (k = 0; k < steps; k++, path++) {
float vert[3];
copy_v3_v3(vert, path->co);
mul_m4_v3(inv_mat, vert);
@@ -240,7 +240,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
ChildParticle *pc = m_psys->child;
- for (int p = 0; p < m_psys->totchild; ++p, ++pc) {
+ for (int p = 0; p < m_psys->totchild; p++, pc++) {
path = cache[p];
if (part->from == PART_FROM_FACE && part->childtype != PART_CHILD_PARTICLES && mtface) {
@@ -278,7 +278,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
int steps = path->segments + 1;
hvertices.push_back(steps);
- for (int k = 0; k < steps; ++k) {
+ for (int k = 0; k < steps; k++) {
float vert[3];
copy_v3_v3(vert, path->co);
mul_m4_v3(inv_mat, vert);
@@ -286,7 +286,7 @@ void AbcHairWriter::write_hair_child_sample(Mesh *mesh,
/* Convert Z-up to Y-up. */
verts.push_back(Imath::V3f(vert[0], vert[2], -vert[1]));
- ++path;
+ path++;
}
}
}
diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc
index 8728303923a..92de3547fd2 100644
--- a/source/blender/alembic/intern/abc_mesh.cc
+++ b/source/blender/alembic/intern/abc_mesh.cc
@@ -116,7 +116,7 @@ static void get_vertices(struct Mesh *mesh, std::vector<Imath::V3f> &points)
MVert *verts = mesh->mvert;
- for (int i = 0, e = mesh->totvert; i < e; ++i) {
+ for (int i = 0, e = mesh->totvert; i < e; i++) {
copy_yup_from_zup(points[i].getValue(), verts[i].co);
}
}
@@ -137,7 +137,7 @@ static void get_topology(struct Mesh *mesh,
loop_counts.reserve(num_poly);
/* NOTE: data needs to be written in the reverse order. */
- for (int i = 0; i < num_poly; ++i) {
+ for (int i = 0; i < num_poly; i++) {
MPoly &poly = mpoly[i];
loop_counts.push_back(poly.totloop);
@@ -145,7 +145,7 @@ static void get_topology(struct Mesh *mesh,
MLoop *loop = mloop + poly.loopstart + (poly.totloop - 1);
- for (int j = 0; j < poly.totloop; ++j, --loop) {
+ for (int j = 0; j < poly.totloop; j++, loop--) {
poly_verts.push_back(loop->v);
}
}
@@ -164,7 +164,7 @@ static void get_creases(struct Mesh *mesh,
MEdge *edge = mesh->medge;
- for (int i = 0, e = mesh->totedge; i < e; ++i) {
+ for (int i = 0, e = mesh->totedge; i < e; i++) {
const float sharpness = static_cast<float>(edge[i].crease) * factor;
if (sharpness != 0.0f) {
@@ -185,7 +185,7 @@ static void get_vertex_normals(struct Mesh *mesh, std::vector<Imath::V3f> &norma
MVert *verts = mesh->mvert;
float no[3];
- for (int i = 0, e = mesh->totvert; i < e; ++i) {
+ for (int i = 0, e = mesh->totvert; i < e; i++) {
normal_short_to_float_v3(no, verts[i].no);
copy_yup_from_zup(normals[i].getValue(), no);
}
@@ -209,8 +209,8 @@ static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals
int abc_index = 0;
if (lnors) {
- for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) {
- for (int j = mp->totloop - 1; j >= 0; --j, ++abc_index) {
+ for (int i = 0, e = mesh->totpoly; i < e; i++, mp++) {
+ for (int j = mp->totloop - 1; j >= 0; j--, abc_index++) {
int blender_index = mp->loopstart + j;
copy_yup_from_zup(normals[abc_index].getValue(), lnors[blender_index]);
}
@@ -219,20 +219,20 @@ static void get_loop_normals(struct Mesh *mesh, std::vector<Imath::V3f> &normals
else {
float no[3];
- for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mp) {
+ for (int i = 0, e = mesh->totpoly; i < e; i++, mp++) {
ml = mloop + mp->loopstart + (mp->totloop - 1);
/* Flat shaded, use common normal for all verts. */
if ((mp->flag & ME_SMOOTH) == 0) {
BKE_mesh_calc_poly_normal(mp, ml - (mp->totloop - 1), verts, no);
- for (int j = 0; j < mp->totloop; --ml, ++j, ++abc_index) {
+ for (int j = 0; j < mp->totloop; ml--, j++, abc_index++) {
copy_yup_from_zup(normals[abc_index].getValue(), no);
}
}
else {
/* Smooth shaded, use individual vert normals. */
- for (int j = 0; j < mp->totloop; --ml, ++j, ++abc_index) {
+ for (int j = 0; j < mp->totloop; ml--, j++, abc_index++) {
normal_short_to_float_v3(no, verts[ml->v].no);
copy_yup_from_zup(normals[abc_index].getValue(), no);
}
@@ -525,7 +525,7 @@ template<typename Schema> void AbcGenericMeshWriter::writeFaceSets(struct Mesh *
getGeoGroups(me, geo_groups);
std::map<std::string, std::vector<int32_t>>::iterator it;
- for (it = geo_groups.begin(); it != geo_groups.end(); ++it) {
+ for (it = geo_groups.begin(); it != geo_groups.end(); it++) {
OFaceSet face_set = schema.createFaceSet(it->first);
OFaceSetSchema::Sample samp;
samp.setFaces(Int32ArraySample(it->second));
@@ -615,7 +615,7 @@ void AbcGenericMeshWriter::getVelocities(struct Mesh *mesh, std::vector<Imath::V
if (fss->meshVelocities) {
float *mesh_vels = reinterpret_cast<float *>(fss->meshVelocities);
- for (int i = 0; i < totverts; ++i) {
+ for (int i = 0; i < totverts; i++) {
copy_yup_from_zup(vels[i].getValue(), mesh_vels);
mesh_vels += 3;
}
@@ -631,7 +631,7 @@ void AbcGenericMeshWriter::getGeoGroups(struct Mesh *mesh,
const int num_poly = mesh->totpoly;
MPoly *polygons = mesh->mpoly;
- for (int i = 0; i < num_poly; ++i) {
+ for (int i = 0; i < num_poly; i++) {
MPoly &current_poly = polygons[i];
short mnr = current_poly.mat_nr;
@@ -658,7 +658,7 @@ void AbcGenericMeshWriter::getGeoGroups(struct Mesh *mesh,
std::vector<int32_t> faceArray;
- for (int i = 0, e = mesh->totface; i < e; ++i) {
+ for (int i = 0, e = mesh->totface; i < e; i++) {
faceArray.push_back(i);
}
@@ -707,7 +707,7 @@ static void assign_materials(Main *bmain,
std::map<std::string, int>::const_iterator it = mat_index_map.begin();
int matcount = 0;
- for (; it != mat_index_map.end(); ++it, ++matcount) {
+ for (; it != mat_index_map.end(); it++, matcount++) {
if (!BKE_object_material_slot_add(bmain, ob)) {
can_assign = false;
break;
@@ -723,7 +723,7 @@ static void assign_materials(Main *bmain,
if (can_assign) {
it = mat_index_map.begin();
- for (; it != mat_index_map.end(); ++it) {
+ for (; it != mat_index_map.end(); it++) {
std::string mat_name = it->first;
mat_iter = mat_map.find(mat_name.c_str());
@@ -770,7 +770,7 @@ static void read_mverts_interp(MVert *mverts,
const float weight)
{
float tmp[3];
- for (int i = 0; i < positions->size(); ++i) {
+ for (int i = 0; i < positions->size(); i++) {
MVert &mvert = mverts[i];
const Imath::V3f &floor_pos = (*positions)[i];
const Imath::V3f &ceil_pos = (*ceil_positions)[i];
@@ -801,7 +801,7 @@ void read_mverts(MVert *mverts,
const P3fArraySamplePtr &positions,
const N3fArraySamplePtr &normals)
{
- for (int i = 0; i < positions->size(); ++i) {
+ for (int i = 0; i < positions->size(); i++) {
MVert &mvert = mverts[i];
Imath::V3f pos_in = (*positions)[i];
@@ -839,7 +839,7 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data)
unsigned int rev_loop_index = 0;
unsigned int uv_index = 0;
- for (int i = 0; i < face_counts->size(); ++i) {
+ for (int i = 0; i < face_counts->size(); i++) {
const int face_size = (*face_counts)[i];
MPoly &poly = mpolys[i];
@@ -856,7 +856,7 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data)
/* NOTE: Alembic data is stored in the reverse order. */
rev_loop_index = loop_index + (face_size - 1);
- for (int f = 0; f < face_size; ++f, ++loop_index, --rev_loop_index) {
+ for (int f = 0; f < face_size; f++, loop_index++, rev_loop_index--) {
MLoop &loop = mloops[rev_loop_index];
loop.v = (*face_indices)[loop_index];
@@ -899,9 +899,9 @@ static void process_normals(CDStreamConfig &config, const AbcMeshData &mesh_data
MPoly *mpoly = mesh->mpoly;
int abc_index = 0;
- for (int i = 0, e = mesh->totpoly; i < e; ++i, ++mpoly) {
+ for (int i = 0, e = mesh->totpoly; i < e; i++, mpoly++) {
/* As usual, ABC orders the loops in reverse. */
- for (int j = mpoly->totloop - 1; j >= 0; --j, ++abc_index) {
+ for (int j = mpoly->totloop - 1; j >= 0; j--, abc_index++) {
int blender_index = mpoly->loopstart + j;
copy_zup_from_yup(lnors[blender_index], loop_normals[abc_index].getValue());
}
@@ -1246,7 +1246,7 @@ void AbcMeshReader::assign_facesets_to_mpoly(const ISampleSelector &sample_sel,
int current_mat = 0;
- for (int i = 0; i < face_sets.size(); ++i) {
+ for (int i = 0; i < face_sets.size(); i++) {
const std::string &grp_name = face_sets[i];
if (r_mat_map.find(grp_name) == r_mat_map.end()) {
@@ -1292,7 +1292,7 @@ void AbcMeshReader::readFaceSetsSample(Main *bmain, Mesh *mesh, const ISampleSel
ABC_INLINE MEdge *find_edge(MEdge *edges, int totedge, int v1, int v2)
{
- for (int i = 0, e = totedge; i < e; ++i) {
+ for (int i = 0, e = totedge; i < e; i++) {
MEdge &edge = edges[i];
if (edge.v1 == v1 && edge.v2 == v2) {
@@ -1419,7 +1419,7 @@ void AbcSubDReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSelec
MEdge *edges = mesh->medge;
if (indices && sharpnesses) {
- for (int i = 0, s = 0, e = indices->size(); i < e; i += 2, ++s) {
+ for (int i = 0, s = 0, e = indices->size(); i < e; i += 2, s++) {
MEdge *edge = find_edge(edges, mesh->totedge, (*indices)[i], (*indices)[i + 1]);
if (edge) {
diff --git a/source/blender/alembic/intern/abc_nurbs.cc b/source/blender/alembic/intern/abc_nurbs.cc
index c78cc4570c9..f2d0a9f1e16 100644
--- a/source/blender/alembic/intern/abc_nurbs.cc
+++ b/source/blender/alembic/intern/abc_nurbs.cc
@@ -74,7 +74,7 @@ AbcNurbsWriter::AbcNurbsWriter(Object *ob,
Curve *curve = static_cast<Curve *>(m_object->data);
size_t numNurbs = BLI_listbase_count(&curve->nurb);
- for (size_t i = 0; i < numNurbs; ++i) {
+ for (size_t i = 0; i < numNurbs; i++) {
std::stringstream str;
str << m_name << '_' << i;
@@ -106,7 +106,7 @@ static void get_knots(std::vector<float> &knots, const int num_knots, float *nu_
knots.push_back(0.0f);
- for (int i = 0; i < num_knots; ++i) {
+ for (int i = 0; i < num_knots; i++) {
knots.push_back(nu_knots[i]);
}
@@ -136,7 +136,7 @@ void AbcNurbsWriter::do_write()
}
size_t count = 0;
- for (Nurb *nu = static_cast<Nurb *>(nulb->first); nu; nu = nu->next, ++count) {
+ for (Nurb *nu = static_cast<Nurb *>(nulb->first); nu; nu = nu->next, count++) {
std::vector<float> knotsU;
get_knots(knotsU, KNOTSU(nu), nu->knotsu);
@@ -149,7 +149,7 @@ void AbcNurbsWriter::do_write()
const BPoint *bp = nu->bp;
- for (int i = 0; i < size; ++i, ++bp) {
+ for (int i = 0; i < size; i++, bp++) {
copy_yup_from_zup(positions[i].getValue(), bp->vec);
weights[i] = bp->vec[3];
}
@@ -208,7 +208,7 @@ bool AbcNurbsReader::valid() const
}
std::vector<std::pair<INuPatchSchema, IObject>>::const_iterator it;
- for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
+ for (it = m_schemas.begin(); it != m_schemas.end(); it++) {
const INuPatchSchema &schema = it->first;
if (!schema.valid()) {
@@ -229,7 +229,7 @@ static bool set_knots(const FloatArraySamplePtr &knots, float *&nu_knots)
const size_t num_knots = knots->size() - 2;
nu_knots = static_cast<float *>(MEM_callocN(num_knots * sizeof(float), "abc_setsplineknotsu"));
- for (size_t i = 0; i < num_knots; ++i) {
+ for (size_t i = 0; i < num_knots; i++) {
nu_knots[i] = (*knots)[i + 1];
}
@@ -243,7 +243,7 @@ void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele
std::vector<std::pair<INuPatchSchema, IObject>>::iterator it;
- for (it = m_schemas.begin(); it != m_schemas.end(); ++it) {
+ for (it = m_schemas.begin(); it != m_schemas.end(); it++) {
Nurb *nu = static_cast<Nurb *>(MEM_callocN(sizeof(Nurb), "abc_getnurb"));
nu->flag = CU_SMOOTH;
nu->type = CU_NURBS;
@@ -281,7 +281,7 @@ void AbcNurbsReader::readObjectData(Main *bmain, const Alembic::Abc::ISampleSele
BPoint *bp = nu->bp;
float posw_in = 1.0f;
- for (int i = 0; i < num_points; ++i, ++bp) {
+ for (int i = 0; i < num_points; i++, bp++) {
const Imath::V3f &pos_in = (*positions)[i];
if (weights) {
@@ -349,7 +349,7 @@ void AbcNurbsReader::getNurbsPatches(const IObject &obj)
return;
}
- for (int i = 0; i < num_children; ++i) {
+ for (int i = 0; i < num_children; i++) {
bool ok = true;
IObject child(obj, obj.getChildHeader(i).getName());
diff --git a/source/blender/alembic/intern/abc_object.cc b/source/blender/alembic/intern/abc_object.cc
index ebebbc0da1e..b05246371fa 100644
--- a/source/blender/alembic/intern/abc_object.cc
+++ b/source/blender/alembic/intern/abc_object.cc
@@ -195,14 +195,14 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1,
* the matrices manually.
*/
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
mat0[i][j] = static_cast<float>(m0[i][j]);
}
}
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
mat1[i][j] = static_cast<float>(m1[i][j]);
}
}
@@ -211,8 +211,8 @@ static Imath::M44d blend_matrices(const Imath::M44d &m0, const Imath::M44d &m1,
Imath::M44d m;
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
m[i][j] = ret[i][j];
}
}
@@ -389,11 +389,11 @@ int AbcObjectReader::refcount() const
void AbcObjectReader::incref()
{
- ++m_refcount;
+ m_refcount++;
}
void AbcObjectReader::decref()
{
- --m_refcount;
+ m_refcount--;
BLI_assert(m_refcount >= 0);
}
diff --git a/source/blender/alembic/intern/abc_transform.cc b/source/blender/alembic/intern/abc_transform.cc
index 08f8eb8bd8f..505acfc164a 100644
--- a/source/blender/alembic/intern/abc_transform.cc
+++ b/source/blender/alembic/intern/abc_transform.cc
@@ -122,7 +122,7 @@ Imath::Box3d AbcTransformWriter::bounds()
{
Imath::Box3d bounds;
- for (int i = 0; i < m_children.size(); ++i) {
+ for (int i = 0; i < m_children.size(); i++) {
Imath::Box3d box(m_children[i]->bounds());
bounds.extendBy(box);
}
diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc
index 2fc340f73ce..b6743c8b363 100644
--- a/source/blender/alembic/intern/abc_util.cc
+++ b/source/blender/alembic/intern/abc_util.cc
@@ -90,8 +90,8 @@ Imath::M44d convert_matrix(float mat[4][4])
{
Imath::M44d m;
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
m[i][j] = mat[i][j];
}
}
@@ -226,8 +226,8 @@ void copy_m44_axis_swap(float dst_mat[4][4], float src_mat[4][4], AbcAxisSwapMod
void convert_matrix(const Imath::M44d &xform, Object *ob, float r_mat[4][4])
{
- for (int i = 0; i < 4; ++i) {
- for (int j = 0; j < 4; ++j) {
+ for (int i = 0; i < 4; i++) {
+ for (int j = 0; j < 4; j++) {
r_mat[i][j] = static_cast<float>(xform[i][j]);
}
}
diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc
index dc525e0c46c..ffe58f7976f 100644
--- a/source/blender/alembic/intern/alembic_capi.cc
+++ b/source/blender/alembic/intern/alembic_capi.cc
@@ -129,7 +129,7 @@ static bool gather_objects_paths(const IObject &object, ListBase *object_paths)
size_t children_claiming_this_object = 0;
size_t num_children = object.getNumChildren();
- for (size_t i = 0; i < num_children; ++i) {
+ for (size_t i = 0; i < num_children; i++) {
bool child_claims_this_object = gather_objects_paths(object.getChild(i), object_paths);
children_claiming_this_object += child_claims_this_object ? 1 : 0;
}
@@ -211,7 +211,7 @@ static void find_iobject(const IObject &object, IObject &ret, const std::string
IObject tmp = object;
std::vector<std::string>::iterator iter;
- for (iter = tokens.begin(); iter != tokens.end(); ++iter) {
+ for (iter = tokens.begin(); iter != tokens.end(); iter++) {
IObject child = tmp.getChild(*iter);
tmp = child;
}
@@ -452,7 +452,7 @@ static std::pair<bool, AbcObjectReader *> visit_object(
AbcObjectReader::ptr_vector claiming_child_readers;
AbcObjectReader::ptr_vector nonclaiming_child_readers;
AbcObjectReader::ptr_vector assign_as_parent;
- for (size_t i = 0; i < num_children; ++i) {
+ for (size_t i = 0; i < num_children; i++) {
const IObject ichild = object.getChild(i);
/* TODO: When we only support C++11, use std::tie() instead. */
@@ -704,7 +704,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
ISampleSelector sample_sel(0.0f);
std::vector<AbcObjectReader *>::iterator iter;
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
AbcObjectReader *reader = *iter;
if (reader->valid()) {
@@ -743,7 +743,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
}
/* Setup parenthood. */
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
const AbcObjectReader *reader = *iter;
const AbcObjectReader *parent_reader = reader->parent_reader;
Object *ob = reader->object();
@@ -758,7 +758,7 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
/* Setup transformations and constraints. */
i = 0;
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
AbcObjectReader *reader = *iter;
reader->setupObjectTransform(0.0f);
@@ -782,7 +782,7 @@ static void import_endjob(void *user_data)
/* Delete objects on cancellation. */
if (data->was_cancelled) {
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
Object *ob = (*iter)->object();
/* It's possible that cancellation occurred between the creation of
@@ -804,7 +804,7 @@ static void import_endjob(void *user_data)
lc = BKE_layer_collection_get_active(view_layer);
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
Object *ob = (*iter)->object();
BKE_collection_object_add(data->bmain, lc->collection, ob);
@@ -824,7 +824,7 @@ static void import_endjob(void *user_data)
DEG_relations_tag_update(data->bmain);
}
- for (iter = data->readers.begin(); iter != data->readers.end(); ++iter) {
+ for (iter = data->readers.begin(); iter != data->readers.end(); iter++) {
AbcObjectReader *reader = *iter;
reader->decref();
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,
diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c
index c92505acb54..3c53d1eee1b 100644
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@ -437,7 +437,7 @@ void BLI_filelist_duplicate(struct direntry **dest_filelist,
unsigned int i;
*dest_filelist = MEM_mallocN(sizeof(**dest_filelist) * (size_t)(nrentries), __func__);
- for (i = 0; i < nrentries; ++i) {
+ for (i = 0; i < nrentries; i++) {
struct direntry *const src = &src_filelist[i];
struct direntry *dst = &(*dest_filelist)[i];
BLI_filelist_entry_duplicate(dst, src);
@@ -463,7 +463,7 @@ void BLI_filelist_entry_free(struct direntry *entry)
void BLI_filelist_free(struct direntry *filelist, const unsigned int nrentries)
{
unsigned int i;
- for (i = 0; i < nrentries; ++i) {
+ for (i = 0; i < nrentries; i++) {
BLI_filelist_entry_free(&filelist[i]);
}
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 0e3987eefc9..c203c45bb93 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -343,7 +343,7 @@ static bool delete_recursive(const char *dir)
err = true;
}
}
- ++fl;
+ fl++;
}
if (!err && delete_unique(dir, true)) {
diff --git a/source/blender/blenlib/intern/hash_md5.c b/source/blender/blenlib/intern/hash_md5.c
index 44a9348c5d3..f9e9b3bfbf9 100644
--- a/source/blender/blenlib/intern/hash_md5.c
+++ b/source/blender/blenlib/intern/hash_md5.c
@@ -151,7 +151,7 @@ static void md5_process_block(const void *buffer, size_t len, struct md5_ctx *ct
*/
#define OP(a, b, c, d, s, T) \
a += FF(b, c, d) + (*cwp++ = SWAP(*words)) + T; \
- ++words; \
+ words++; \
CYCLIC(a, s); \
a += b; \
(void)0
@@ -408,7 +408,7 @@ char *BLI_hash_md5_to_hexdigest(void *resblock, char r_hex_digest[33])
char *q;
short len;
- for (q = r_hex_digest, p = (const unsigned char *)resblock, len = 0; len < 16; ++p, ++len) {
+ for (q = r_hex_digest, p = (const unsigned char *)resblock, len = 0; len < 16; p++, len++) {
const unsigned char c = *p;
*q++ = hex_map[c >> 4];
*q++ = hex_map[c & 15];
diff --git a/source/blender/blenlib/intern/list_sort_impl.h b/source/blender/blenlib/intern/list_sort_impl.h
index fac1ca8e983..458ace3a712 100644
--- a/source/blender/blenlib/intern/list_sort_impl.h
+++ b/source/blender/blenlib/intern/list_sort_impl.h
@@ -240,7 +240,7 @@ BLI_INLINE void insert_list(struct SortInfo *si, list_node *list, unsigned int r
rank = MAX_RANKS;
}
list = merge_lists(sweep_up(si, NULL, si->n_ranks), list, THUNK_APPEND1(si->func, si->thunk));
- for (i = si->n_ranks; i < rank; ++i) {
+ for (i = si->n_ranks; i < rank; i++) {
si->ranks[i] = NULL;
}
}
@@ -248,7 +248,7 @@ BLI_INLINE void insert_list(struct SortInfo *si, list_node *list, unsigned int r
if (rank) {
list = merge_lists(sweep_up(si, NULL, rank), list, THUNK_APPEND1(si->func, si->thunk));
}
- for (i = rank; i < si->n_ranks && si->ranks[i]; ++i) {
+ for (i = rank; i < si->n_ranks && si->ranks[i]; i++) {
list = merge_lists(si->ranks[i], list, THUNK_APPEND1(si->func, si->thunk));
si->ranks[i] = NULL;
}
diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c
index 14fde18aa52..6277b1cd9dc 100644
--- a/source/blender/blenlib/intern/math_interp.c
+++ b/source/blender/blenlib/intern/math_interp.c
@@ -687,11 +687,11 @@ void BLI_ewa_filter(const int width,
d = 0.0f;
zero_v4(result);
- for (v = v1; v <= v2; ++v) {
+ for (v = v1; v <= v2; v++) {
const float V = (float)v - V0;
float DQ = ac1 + B * V;
float Q = (C * V + BU) * V + ac2;
- for (u = u1; u <= u2; ++u) {
+ for (u = u1; u <= u2; u++) {
if (Q < (float)(EWA_MAXIDX + 1)) {
float tc[4];
const float wt = EWA_WTS[(Q < 0.0f) ? 0 : (unsigned int)Q];
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 18acbca00a1..725b6f8937a 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -618,14 +618,14 @@ void BLI_path_rel(char *file, const char *relfile)
*/
if (*q != '/') {
while ((q >= file) && (*q != '/')) {
- --q;
- --p;
+ q--;
+ p--;
}
}
else if (*p != '/') {
while ((p >= temp) && (*p != '/')) {
- --p;
- --q;
+ p--;
+ q--;
}
}
diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c
index 4059e0401c0..0b8ec44cbcd 100644
--- a/source/blender/blenlib/intern/string.c
+++ b/source/blender/blenlib/intern/string.c
@@ -978,7 +978,7 @@ size_t BLI_str_partition_ex(const char *str,
*sep = *suf = NULL;
- for (d = delim; *d != '\0'; ++d) {
+ for (d = delim; *d != '\0'; d++) {
const char *tmp;
if (end) {
diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c
index 22c23727d76..92c4ec73768 100644
--- a/source/blender/blenlib/intern/string_utf8.c
+++ b/source/blender/blenlib/intern/string_utf8.c
@@ -716,7 +716,7 @@ size_t BLI_str_utf8_from_unicode(uint c, char *outbuf)
}
if (outbuf) {
- for (i = len - 1; i > 0; --i) {
+ for (i = len - 1; i > 0; i--) {
outbuf[i] = (c & 0x3f) | 0x80;
c >>= 6;
}
@@ -744,7 +744,7 @@ size_t BLI_str_utf8_from_unicode(uint c, char *outbuf)
*/
char *BLI_str_find_prev_char_utf8(const char *str, const char *p)
{
- for (--p; p >= str; --p) {
+ for (--p; p >= str; p--) {
if ((*p & 0xc0) != 0x80) {
return (char *)p;
}
@@ -771,12 +771,12 @@ char *BLI_str_find_next_char_utf8(const char *p, const char *end)
{
if (*p) {
if (end) {
- for (++p; p < end && (*p & 0xc0) == 0x80; ++p) {
+ for (++p; p < end && (*p & 0xc0) == 0x80; p++) {
/* do nothing */
}
}
else {
- for (++p; (*p & 0xc0) == 0x80; ++p) {
+ for (++p; (*p & 0xc0) == 0x80; p++) {
/* do nothing */
}
}
@@ -852,7 +852,7 @@ size_t BLI_str_partition_ex_utf8(const char *str,
break;
}
- for (d = delim; *d != '\0'; ++d) {
+ for (d = delim; *d != '\0'; d++) {
if (*d == c) {
/* *suf is already correct in case from_right is true. */
if (!from_right) {
diff --git a/source/blender/blenlib/intern/task.c b/source/blender/blenlib/intern/task.c
index 7c5ccd7aeb6..2f6c88c128a 100644
--- a/source/blender/blenlib/intern/task.c
+++ b/source/blender/blenlib/intern/task.c
@@ -266,7 +266,7 @@ BLI_INLINE TaskThreadLocalStorage *get_task_tls(TaskPool *pool, const int thread
BLI_INLINE void free_task_tls(TaskThreadLocalStorage *tls)
{
TaskMemPool *task_mempool = &tls->task_mempool;
- for (int i = 0; i < task_mempool->num_tasks; ++i) {
+ for (int i = 0; i < task_mempool->num_tasks; i++) {
MEM_freeN(task_mempool->tasks[i]);
}
}
@@ -561,7 +561,7 @@ void BLI_task_scheduler_free(TaskScheduler *scheduler)
/* Delete task thread data */
if (scheduler->task_threads) {
- for (int i = 0; i < scheduler->num_threads + 1; ++i) {
+ for (int i = 0; i < scheduler->num_threads + 1; i++) {
TaskThreadLocalStorage *tls = &scheduler->task_threads[i].tls;
free_task_tls(tls);
}
@@ -777,7 +777,7 @@ void BLI_task_pool_free(TaskPool *pool)
#ifdef DEBUG_STATS
printf("Thread ID Allocated Reused Discarded\n");
- for (int i = 0; i < pool->scheduler->num_threads + 1; ++i) {
+ for (int i = 0; i < pool->scheduler->num_threads + 1; i++) {
printf("%02d %05d %05d %05d\n",
i,
pool->mempool_stats[i].num_alloc,
@@ -1116,7 +1116,7 @@ static void parallel_range_func(TaskPool *__restrict pool, void *userdata_chunk,
};
int iter, count;
while (parallel_range_next_iter_get(state, &iter, &count)) {
- for (int i = 0; i < count; ++i) {
+ for (int i = 0; i < count; i++) {
state->func(state->userdata, iter + i, &tls);
}
}
@@ -1140,7 +1140,7 @@ static void parallel_range_single_thread(const int start,
.thread_id = 0,
.userdata_chunk = userdata_chunk_local,
};
- for (int i = start; i < stop; ++i) {
+ for (int i = start; i < stop; i++) {
func(userdata, i, &tls);
}
if (settings->func_finalize != NULL) {
@@ -1273,7 +1273,7 @@ BLI_INLINE Link *parallel_listbase_next_iter_get(ParallelListState *__restrict s
if (LIKELY(result != NULL)) {
*index = state->index;
while (state->link != NULL && task_count < state->chunk_size) {
- ++task_count;
+ task_count++;
state->link = state->link->next;
}
state->index += task_count;
@@ -1292,7 +1292,7 @@ static void parallel_listbase_func(TaskPool *__restrict pool,
int index, count;
while ((link = parallel_listbase_next_iter_get(state, &index, &count)) != NULL) {
- for (int i = 0; i < count; ++i) {
+ for (int i = 0; i < count; i++) {
state->func(state->userdata, link, index + i);
link = link->next;
}
@@ -1304,7 +1304,7 @@ static void task_parallel_listbase_no_threads(struct ListBase *listbase,
TaskParallelListbaseFunc func)
{
int i = 0;
- for (Link *link = listbase->first; link != NULL; link = link->next, ++i) {
+ for (Link *link = listbase->first; link != NULL; link = link->next, i++) {
func(userdata, link, i);
}
}
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index a133dd30c9b..bd2580dba74 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -2597,7 +2597,7 @@ static PreviewImage *direct_link_preview_image(FileData *fd, PreviewImage *old_p
if (prv) {
int i;
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
if (prv->rect[i]) {
prv->rect[i] = newdataadr(fd, prv->rect[i]);
}
@@ -4938,7 +4938,7 @@ static void direct_link_mdisps(FileData *fd, int count, MDisps *mdisps, int exte
if (mdisps) {
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
mdisps[i].disps = newdataadr(fd, mdisps[i].disps);
mdisps[i].hidden = newdataadr(fd, mdisps[i].hidden);
@@ -4968,7 +4968,7 @@ static void direct_link_grid_paint_mask(FileData *fd, int count, GridPaintMask *
if (grid_paint_mask) {
int i;
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
GridPaintMask *gpm = &grid_paint_mask[i];
if (gpm->data) {
gpm->data = newdataadr(fd, gpm->data);
@@ -6344,7 +6344,7 @@ static void direct_link_lightcache(FileData *fd, LightCache *cache)
if (cache->cube_mips) {
cache->cube_mips = newdataadr(fd, cache->cube_mips);
- for (int i = 0; i < cache->mips_len; ++i) {
+ for (int i = 0; i < cache->mips_len; i++) {
direct_link_lightcache_texture(fd, &cache->cube_mips[i]);
}
}
diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index 31f6f93e856..07900dee0d0 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -2608,7 +2608,7 @@ void do_versions_after_linking_260(Main *bmain)
if (input_node) {
link->fromnode = input_node;
link->fromsock = node_group_input_find_socket(input_node, link->fromsock->identifier);
- ++num_inputs;
+ num_inputs++;
if (link->tonode) {
if (input_locx > link->tonode->locx - offsetx) {
@@ -2626,7 +2626,7 @@ void do_versions_after_linking_260(Main *bmain)
if (output_node) {
link->tonode = output_node;
link->tosock = node_group_output_find_socket(output_node, link->tosock->identifier);
- ++num_outputs;
+ num_outputs++;
if (link->fromnode) {
if (output_locx < link->fromnode->locx + offsetx) {
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index ddab3972106..1784cd0ab95 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -1454,7 +1454,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
ToolSettings *ts = scene->toolsettings;
/* sculpt brushes */
GP_Sculpt_Settings *gset = &ts->gp_sculpt;
- for (int i = 0; i < GP_SCULPT_TYPE_MAX; ++i) {
+ for (int i = 0; i < GP_SCULPT_TYPE_MAX; i++) {
gp_brush = &gset->brush[i];
gp_brush->flag |= GP_SCULPT_FLAG_ENABLE_CURSOR;
copy_v3_v3(gp_brush->curcolor_add, curcolor_add);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 0ff7ba0034f..c9c3a96fb32 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2014,7 +2014,7 @@ static void write_mdisps(WriteData *wd, int count, MDisps *mdlist, int external)
int i;
writestruct(wd, DATA, MDisps, count, mdlist);
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
MDisps *md = &mdlist[i];
if (md->disps) {
if (!external) {
@@ -2035,7 +2035,7 @@ static void write_grid_paint_mask(WriteData *wd, int count, GridPaintMask *grid_
int i;
writestruct(wd, DATA, GridPaintMask, count, grid_paint_mask);
- for (i = 0; i < count; ++i) {
+ for (i = 0; i < count; i++) {
GridPaintMask *gpm = &grid_paint_mask[i];
if (gpm->data) {
const int gridsize = BKE_ccg_gridsize(gpm->level);
@@ -2471,7 +2471,7 @@ static void write_lightcache(WriteData *wd, LightCache *cache)
if (cache->cube_mips) {
writestruct(wd, DATA, LightCacheTexture, cache->mips_len, cache->cube_mips);
- for (int i = 0; i < cache->mips_len; ++i) {
+ for (int i = 0; i < cache->mips_len; i++) {
write_lightcache_texture(wd, &cache->cube_mips[i]);
}
}
diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index a15c215d2e2..c2ba397131c 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -100,7 +100,7 @@ bool AnimationExporter::exportAnimations()
openLibrary();
BCObjectSet::iterator it;
- for (it = animated_subset.begin(); it != animated_subset.end(); ++it) {
+ for (it = animated_subset.begin(); it != animated_subset.end(); it++) {
Object *ob = *it;
exportAnimation(ob, animation_sampler);
}
@@ -183,7 +183,7 @@ void AnimationExporter::export_curve_animation_set(Object *ob,
bool keep_flat_curves = this->export_settings.get_keep_flat_curves();
BCAnimationCurveMap::iterator it;
- for (it = curves->begin(); it != curves->end(); ++it) {
+ for (it = curves->begin(); it != curves->end(); it++) {
BCAnimationCurve &curve = *it->second;
std::string channel_type = curve.get_channel_type();
if (channel_type == "rotation_quaternion") {
@@ -310,7 +310,7 @@ BCAnimationCurve *AnimationExporter::get_modified_export_curve(Object *ob,
}
BCValueMap::const_iterator vit;
- for (vit = lens_values.begin(); vit != lens_values.end(); ++vit) {
+ for (vit = lens_values.begin(); vit != lens_values.end(); vit++) {
int frame = vit->first;
float lens_value = vit->second;
@@ -594,7 +594,7 @@ std::string AnimationExporter::collada_tangent_from_curve(
const FCurve *fcu = curve.get_fcurve();
int tangent = (semantic == COLLADASW::InputSemantic::IN_TANGENT) ? 0 : 2;
- for (int i = 0; i < fcu->totvert; ++i) {
+ for (int i = 0; i < fcu->totvert; i++) {
BezTriple &bezt = fcu->bezt[i];
float sampled_time = bezt.vec[tangent][0];
diff --git a/source/blender/collada/BCAnimationCurve.cpp b/source/blender/collada/BCAnimationCurve.cpp
index b494c749fe3..bf32ec9148c 100644
--- a/source/blender/collada/BCAnimationCurve.cpp
+++ b/source/blender/collada/BCAnimationCurve.cpp
@@ -249,7 +249,7 @@ const int BCAnimationCurve::closest_index_below(const float sample_frame) const
int lower_index = 0;
int upper_index = 0;
- for (int fcu_index = 0; fcu_index < fcurve->totvert; ++fcu_index) {
+ for (int fcu_index = 0; fcu_index < fcurve->totvert; fcu_index++) {
upper_index = fcu_index;
const int cframe = fcurve->bezt[fcu_index].vec[1][0]; // inacurate!
@@ -537,7 +537,7 @@ bool BCAnimationCurve::is_keyframe(int frame)
return false;
}
- for (int i = 0; i < fcurve->totvert; ++i) {
+ for (int i = 0; i < fcurve->totvert; i++) {
const int cframe = nearbyint(fcurve->bezt[i].vec[1][0]);
if (cframe == frame) {
return true;
diff --git a/source/blender/collada/BCAnimationSampler.cpp b/source/blender/collada/BCAnimationSampler.cpp
index 49d87f92fda..d1f59125790 100644
--- a/source/blender/collada/BCAnimationSampler.cpp
+++ b/source/blender/collada/BCAnimationSampler.cpp
@@ -49,7 +49,7 @@ BCAnimationSampler::BCAnimationSampler(BCExportSettings &export_settings, BCObje
: export_settings(export_settings)
{
BCObjectSet::iterator it;
- for (it = object_set.begin(); it != object_set.end(); ++it) {
+ for (it = object_set.begin(); it != object_set.end(); it++) {
Object *ob = *it;
add_object(ob);
}
@@ -58,7 +58,7 @@ BCAnimationSampler::BCAnimationSampler(BCExportSettings &export_settings, BCObje
BCAnimationSampler::~BCAnimationSampler()
{
BCAnimationObjectMap::iterator it;
- for (it = objects.begin(); it != objects.end(); ++it) {
+ for (it = objects.begin(); it != objects.end(); it++) {
BCAnimation *animation = it->second;
delete animation;
}
@@ -129,7 +129,7 @@ static void add_keyframes_from(bAction *action, BCFrameSet &frameset)
void BCAnimationSampler::check_property_is_animated(
BCAnimation &animation, float *ref, float *val, std::string data_path, int length)
{
- for (int array_index = 0; array_index < length; ++array_index) {
+ for (int array_index = 0; array_index < length; array_index++) {
if (!bc_in_range(ref[length], val[length], 0.00001)) {
BCCurveKey key(BC_ANIMATION_TYPE_OBJECT, data_path, array_index);
BCAnimationCurveMap::iterator it = animation.curve_map.find(key);
@@ -146,7 +146,7 @@ void BCAnimationSampler::update_animation_curves(BCAnimation &animation,
int frame)
{
BCAnimationCurveMap::iterator it;
- for (it = animation.curve_map.begin(); it != animation.curve_map.end(); ++it) {
+ for (it = animation.curve_map.begin(); it != animation.curve_map.end(); it++) {
BCAnimationCurve *curve = it->second;
if (curve->is_transform_curve()) {
curve->add_value_from_matrix(sample, frame);
@@ -195,7 +195,7 @@ void BCAnimationSampler::sample_scene(BCExportSettings &export_settings, bool ke
int startframe = scene->r.sfra;
int endframe = scene->r.efra;
- for (int frame_index = startframe; frame_index <= endframe; ++frame_index) {
+ for (int frame_index = startframe; frame_index <= endframe; frame_index++) {
/* Loop over all frames and decide for each frame if sampling is necessary */
bool is_scene_sample_frame = false;
bool needs_update = true;
@@ -212,7 +212,7 @@ void BCAnimationSampler::sample_scene(BCExportSettings &export_settings, bool ke
}
BCAnimationObjectMap::iterator obit;
- for (obit = objects.begin(); obit != objects.end(); ++obit) {
+ for (obit = objects.begin(); obit != objects.end(); obit++) {
Object *ob = obit->first;
BCAnimation *animation = obit->second;
BCFrameSet &object_keyframes = animation->frame_set;
@@ -268,7 +268,7 @@ void BCAnimationSampler::find_depending_animated(std::set<Object *> &animated_ob
do {
found_more = false;
std::set<Object *>::iterator it;
- for (it = candidates.begin(); it != candidates.end(); ++it) {
+ for (it = candidates.begin(); it != candidates.end(); it++) {
Object *cob = *it;
ListBase *conlist = get_active_constraints(cob);
if (is_animated_by_constraint(cob, conlist, animated_objects)) {
@@ -353,7 +353,7 @@ void BCAnimationSampler::add_value_set(BCAnimationCurve &curve,
const BC_animation_transform_type tm_type = curve.get_transform_type();
BCFrameSampleMap::iterator it;
- for (it = samples.begin(); it != samples.end(); ++it) {
+ for (it = samples.begin(); it != samples.end(); it++) {
const int frame_index = nearbyint(it->first);
if (animation_type == BC_ANIMATION_EXPORT_SAMPLES || curve.is_keyframe(frame_index)) {
@@ -585,7 +585,7 @@ const int BCSampleFrameContainer::get_frames(std::vector<int> &frames) const
{
frames.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
frames.push_back(it->first);
}
return frames.size();
@@ -595,7 +595,7 @@ const int BCSampleFrameContainer::get_frames(Object *ob, BCFrames &frames) const
{
frames.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
const BCSampleFrame &frame = it->second;
if (frame.has_sample_for(ob)) {
frames.push_back(it->first);
@@ -608,7 +608,7 @@ const int BCSampleFrameContainer::get_frames(Object *ob, Bone *bone, BCFrames &f
{
frames.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
const BCSampleFrame &frame = it->second;
if (frame.has_sample_for(ob, bone)) {
frames.push_back(it->first);
@@ -621,7 +621,7 @@ const int BCSampleFrameContainer::get_samples(Object *ob, BCFrameSampleMap &samp
{
samples.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
const BCSampleFrame &frame = it->second;
const BCSample *sample = frame.get_sample(ob);
if (sample) {
@@ -635,7 +635,7 @@ const int BCSampleFrameContainer::get_matrices(Object *ob, BCMatrixSampleMap &sa
{
samples.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
const BCSampleFrame &frame = it->second;
const BCMatrix *matrix = frame.get_sample_matrix(ob);
if (matrix) {
@@ -651,7 +651,7 @@ const int BCSampleFrameContainer::get_matrices(Object *ob,
{
samples.clear(); // safety;
BCSampleFrameMap::const_iterator it;
- for (it = sample_frames.begin(); it != sample_frames.end(); ++it) {
+ for (it = sample_frames.begin(); it != sample_frames.end(); it++) {
const BCSampleFrame &frame = it->second;
const BCMatrix *sample = frame.get_sample_matrix(ob, bone);
if (sample) {
diff --git a/source/blender/collada/BCAnimationSampler.h b/source/blender/collada/BCAnimationSampler.h
index e8d2ab56ae7..3d156134260 100644
--- a/source/blender/collada/BCAnimationSampler.h
+++ b/source/blender/collada/BCAnimationSampler.h
@@ -47,7 +47,7 @@ class BCAnimation {
~BCAnimation()
{
BCAnimationCurveMap::iterator it;
- for (it = curve_map.begin(); it != curve_map.end(); ++it) {
+ for (it = curve_map.begin(); it != curve_map.end(); it++) {
delete it->second;
}
@@ -79,7 +79,7 @@ class BCSampleFrame {
~BCSampleFrame()
{
BCSampleMap::iterator it;
- for (it = sampleMap.begin(); it != sampleMap.end(); ++it) {
+ for (it = sampleMap.begin(); it != sampleMap.end(); it++) {
BCSample *sample = it->second;
delete sample;
}
diff --git a/source/blender/collada/BCSampleData.cpp b/source/blender/collada/BCSampleData.cpp
index 7e23a2de00f..4ef13621c97 100644
--- a/source/blender/collada/BCSampleData.cpp
+++ b/source/blender/collada/BCSampleData.cpp
@@ -23,7 +23,7 @@
BCSample::~BCSample()
{
BCBoneMatrixMap::iterator it;
- for (it = bonemats.begin(); it != bonemats.end(); ++it) {
+ for (it = bonemats.begin(); it != bonemats.end(); it++) {
delete it->second;
}
}
@@ -50,7 +50,7 @@ const bool BCSample::get_value(std::string channel_target, const int array_index
bname = bname.substr(2);
bname = bc_string_before(bname, "\"");
BCBoneMatrixMap::const_iterator it;
- for (it = bonemats.begin(); it != bonemats.end(); ++it) {
+ for (it = bonemats.begin(); it != bonemats.end(); it++) {
Bone *bone = it->first;
if (bname == bone->name) {
matrix = it->second;
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp
index bfec387a199..61835f448ee 100644
--- a/source/blender/collada/ControllerExporter.cpp
+++ b/source/blender/collada/ControllerExporter.cpp
@@ -265,7 +265,7 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
if (sumw > 0.0f) {
float invsumw = 1.0f / sumw;
vcounts.push_back(jw.size());
- for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); ++m) {
+ for (std::map<int, float>::iterator m = jw.begin(); m != jw.end(); m++) {
joints.push_back((*m).first);
weights.push_back(invsumw * (*m).second);
}
@@ -616,7 +616,7 @@ std::string ControllerExporter::add_weights_source(Mesh *me,
source.prepareToAppendValues();
- for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); ++i) {
+ for (std::list<float>::const_iterator i = weights.begin(); i != weights.end(); i++) {
source.appendValues(*i);
}
@@ -658,7 +658,7 @@ void ControllerExporter::add_vertex_weights_element(const std::string &weights_s
/* write deformer index - weight index pairs */
int weight_index = 0;
- for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); ++i) {
+ for (std::list<int>::const_iterator i = joints.begin(); i != joints.end(); i++) {
weightselem.appendValues(*i, weight_index++);
}
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 98b166716c3..9d838406101 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -333,7 +333,7 @@ std::string DocumentImporter::get_import_version(const COLLADAFW::FileInfo *asse
const char AUTORING_TOOL[] = "authoring_tool";
const std::string BLENDER("Blender ");
const COLLADAFW::FileInfo::ValuePairPointerArray &valuePairs = asset->getValuePairArray();
- for (size_t i = 0, count = valuePairs.getCount(); i < count; ++i) {
+ for (size_t i = 0, count = valuePairs.getCount(); i < count; i++) {
const COLLADAFW::FileInfo::ValuePair *valuePair = valuePairs[i];
const COLLADAFW::String &key = valuePair->first;
const COLLADAFW::String &value = valuePair->second;
@@ -567,7 +567,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
root_objects->push_back(ob);
}
}
- ++geom_done;
+ geom_done++;
}
while (camera_done < camera.getCount()) {
ob = create_camera_object(camera[camera_done], sce);
@@ -580,7 +580,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
root_objects->push_back(ob);
}
}
- ++camera_done;
+ camera_done++;
}
while (lamp_done < lamp.getCount()) {
ob = create_light_object(lamp[lamp_done], sce);
@@ -593,7 +593,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
root_objects->push_back(ob);
}
}
- ++lamp_done;
+ lamp_done++;
}
while (controller_done < controller.getCount()) {
COLLADAFW::InstanceGeometry *geometry = (COLLADAFW::InstanceGeometry *)
@@ -608,7 +608,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
root_objects->push_back(ob);
}
}
- ++controller_done;
+ controller_done++;
}
/* XXX instance_node is not supported yet */
while (inst_done < inst_node.getCount()) {
@@ -635,7 +635,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
}
}
}
- ++inst_done;
+ inst_done++;
read_transform = false;
}
diff --git a/source/blender/collada/SceneExporter.cpp b/source/blender/collada/SceneExporter.cpp
index 01854bef328..24449de0ddd 100644
--- a/source/blender/collada/SceneExporter.cpp
+++ b/source/blender/collada/SceneExporter.cpp
@@ -88,7 +88,7 @@ void SceneExporter::writeNodeList(std::vector<Object *> &child_objects, Object *
* I really prefer to enforce the export of hidden
* elements in an object hierarchy. When the children of
* the hidden elements are exported as well. */
- for (int i = 0; i < child_objects.size(); ++i) {
+ for (int i = 0; i < child_objects.size(); i++) {
Object *child = child_objects[i];
writeNode(child);
if (bc_is_marked(child)) {
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index dd5611c4bef..f740fcee664 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -525,7 +525,7 @@ BoneExtensionMap &BoneExtensionManager::getExtensionMap(bArmature *armature)
BoneExtensionManager::~BoneExtensionManager()
{
std::map<std::string, BoneExtensionMap *>::iterator map_it;
- for (map_it = extended_bone_maps.begin(); map_it != extended_bone_maps.end(); ++map_it) {
+ for (map_it = extended_bone_maps.begin(); map_it != extended_bone_maps.end(); map_it++) {
BoneExtensionMap *extended_bones = map_it->second;
for (BoneExtensionMap::iterator ext_it = extended_bones->begin();
ext_it != extended_bones->end();
@@ -916,7 +916,7 @@ bool bc_is_animated(BCMatrixSampleMap &values)
BCMatrixSampleMap::iterator it;
const BCMatrix *refmat = NULL;
- for (it = values.begin(); it != values.end(); ++it) {
+ for (it = values.begin(); it != values.end(); it++) {
const BCMatrix *matrix = it->second;
if (refmat == NULL) {
diff --git a/source/blender/compositor/intern/COM_Debug.cpp b/source/blender/compositor/intern/COM_Debug.cpp
index 72c1e0cf316..c2ef7d37a59 100644
--- a/source/blender/compositor/intern/COM_Debug.cpp
+++ b/source/blender/compositor/intern/COM_Debug.cpp
@@ -335,7 +335,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
int totops = system->m_operations.size();
int totgroups = system->m_groups.size();
std::map<NodeOperation *, std::vector<std::string>> op_groups;
- for (int i = 0; i < totgroups; ++i) {
+ for (int i = 0; i < totgroups; i++) {
const ExecutionGroup *group = system->m_groups[i];
len += snprintf(str + len, maxlen > len ? maxlen - len : 0, "// GROUP: %d\r\n", i);
@@ -377,7 +377,7 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
}
/* operations not included in any group */
- for (int j = 0; j < totops; ++j) {
+ for (int j = 0; j < totops; j++) {
NodeOperation *operation = system->m_operations[j];
if (op_groups.find(operation) != op_groups.end()) {
continue;
@@ -397,8 +397,8 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
std::vector<std::string> &read_groups = op_groups[read];
std::vector<std::string> &write_groups = op_groups[write];
- for (int k = 0; k < write_groups.size(); ++k) {
- for (int l = 0; l < read_groups.size(); ++l) {
+ for (int k = 0; k < write_groups.size(); k++) {
+ for (int l = 0; l < read_groups.size(); l++) {
len += snprintf(str + len,
maxlen > len ? maxlen - len : 0,
"\"O_%p%s\" -> \"O_%p%s\" [style=dotted]\r\n",
@@ -448,8 +448,8 @@ bool DebugInfo::graphviz_system(const ExecutionSystem *system, char *str, int ma
from,
to_op,
to);
- for (int k = 0; k < from_groups.size(); ++k) {
- for (int l = 0; l < to_groups.size(); ++l) {
+ for (int k = 0; k < from_groups.size(); k++) {
+ for (int l = 0; l < to_groups.size(); l++) {
len += snprintf(str + len,
maxlen > len ? maxlen - len : 0,
"\"O_%p%s\":\"OUT_%p\":e -> \"O_%p%s\":\"IN_%p\":w",
@@ -483,7 +483,7 @@ void DebugInfo::graphviz(const ExecutionSystem *system)
BLI_snprintf(basename, sizeof(basename), "compositor_%d.dot", m_file_index);
BLI_join_dirfile(filename, sizeof(filename), BKE_tempdir_session(), basename);
- ++m_file_index;
+ m_file_index++;
FILE *fp = BLI_fopen(filename, "wb");
fputs(str, fp);
diff --git a/source/blender/compositor/intern/COM_NodeGraph.cpp b/source/blender/compositor/intern/COM_NodeGraph.cpp
index b4d6cc0ff60..ce54aef946b 100644
--- a/source/blender/compositor/intern/COM_NodeGraph.cpp
+++ b/source/blender/compositor/intern/COM_NodeGraph.cpp
@@ -160,7 +160,7 @@ void NodeGraph::add_bNode(const CompositorContext &context,
NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeSocket *b_socket)
{
NodeInputs result;
- for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) {
+ for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) {
Node *node = *it;
for (int index = 0; index < node->getNumberOfInputSockets(); index++) {
NodeInput *input = node->getInputSocket(index);
@@ -174,7 +174,7 @@ NodeGraph::NodeInputs NodeGraph::find_inputs(const NodeRange &node_range, bNodeS
NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_socket)
{
- for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; ++it) {
+ for (NodeGraph::NodeIterator it = node_range.first; it != node_range.second; it++) {
Node *node = *it;
for (int index = 0; index < node->getNumberOfOutputSockets(); index++) {
NodeOutput *output = node->getOutputSocket(index);
@@ -206,7 +206,7 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink
}
NodeInputs inputs = find_inputs(node_range, b_nodelink->tosock);
- for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); ++it) {
+ for (NodeInputs::const_iterator it = inputs.begin(); it != inputs.end(); it++) {
NodeInput *input = *it;
if (input->isLinked()) {
continue;
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index 80243c10760..61e18c93a61 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -152,7 +152,7 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex)
void NodeOperation::getConnectedInputSockets(Inputs *sockets)
{
- for (Inputs::const_iterator it = m_inputs.begin(); it != m_inputs.end(); ++it) {
+ for (Inputs::const_iterator it = m_inputs.begin(); it != m_inputs.end(); it++) {
NodeOperationInput *input = *it;
if (input->isConnected()) {
sockets->push_back(input);
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
index 198385649da..ae9949b9018 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
@@ -70,7 +70,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
* so multiple operations can use the same node input.
*/
OpInputInverseMap inverse_input_map;
- for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); ++it) {
+ for (InputSocketMap::const_iterator it = m_input_map.begin(); it != m_input_map.end(); it++) {
inverse_input_map[it->second].push_back(it->first);
}
@@ -92,7 +92,7 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
continue;
}
- for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); ++it) {
+ for (OpInputs::const_iterator it = op_to_list.begin(); it != op_to_list.end(); it++) {
NodeOperationInput *op_to = *it;
addLink(op_from, op_to);
}
@@ -166,7 +166,7 @@ void NodeOperationBuilder::addLink(NodeOperationOutput *from, NodeOperationInput
void NodeOperationBuilder::removeInputLink(NodeOperationInput *to)
{
- for (Links::iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::iterator it = m_links.begin(); it != m_links.end(); it++) {
Link &link = *it;
if (link.to() == to) {
/* unregister with the input */
@@ -274,7 +274,7 @@ void NodeOperationBuilder::registerViewer(ViewerOperation *viewer)
void NodeOperationBuilder::add_datatype_conversions()
{
Links convert_links;
- for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
const Link &link = *it;
/* proxy operations can skip data type conversion */
@@ -288,7 +288,7 @@ void NodeOperationBuilder::add_datatype_conversions()
convert_links.push_back(link);
}
}
- for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
+ for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); it++) {
const Link &link = *it;
NodeOperation *converter = Converter::convertDataType(link.from(), link.to());
if (converter) {
@@ -308,16 +308,16 @@ void NodeOperationBuilder::add_operation_input_constants()
*/
typedef std::vector<NodeOperationInput *> Inputs;
Inputs pending_inputs;
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
- for (int k = 0; k < op->getNumberOfInputSockets(); ++k) {
+ for (int k = 0; k < op->getNumberOfInputSockets(); k++) {
NodeOperationInput *input = op->getInputSocket(k);
if (!input->isConnected()) {
pending_inputs.push_back(input);
}
}
}
- for (Inputs::const_iterator it = pending_inputs.begin(); it != pending_inputs.end(); ++it) {
+ for (Inputs::const_iterator it = pending_inputs.begin(); it != pending_inputs.end(); it++) {
NodeOperationInput *input = *it;
add_input_constant_value(input, find_node_input(m_input_map, input));
}
@@ -378,7 +378,7 @@ void NodeOperationBuilder::add_input_constant_value(NodeOperationInput *input,
void NodeOperationBuilder::resolve_proxies()
{
Links proxy_links;
- for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
const Link &link = *it;
/* don't replace links from proxy to proxy, since we may need them for replacing others! */
if (link.from()->getOperation().isProxyOperation() &&
@@ -387,7 +387,7 @@ void NodeOperationBuilder::resolve_proxies()
}
}
- for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); ++it) {
+ for (Links::const_iterator it = proxy_links.begin(); it != proxy_links.end(); it++) {
const Link &link = *it;
NodeOperationInput *to = link.to();
@@ -410,7 +410,7 @@ void NodeOperationBuilder::resolve_proxies()
void NodeOperationBuilder::determineResolutions()
{
/* determine all resolutions of the operations (Width/Height) */
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && !op->isPreviewOperation()) {
@@ -421,7 +421,7 @@ void NodeOperationBuilder::determineResolutions()
}
}
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering()) && op->isPreviewOperation()) {
@@ -435,7 +435,7 @@ void NodeOperationBuilder::determineResolutions()
/* add convert resolution operations when needed */
{
Links convert_links;
- for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
const Link &link = *it;
if (link.to()->getResizeMode() != COM_SC_NO_RESIZE) {
@@ -446,7 +446,7 @@ void NodeOperationBuilder::determineResolutions()
}
}
}
- for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); ++it) {
+ for (Links::const_iterator it = convert_links.begin(); it != convert_links.end(); it++) {
const Link &link = *it;
Converter::convertResolution(*this, link.from(), link.to());
}
@@ -457,7 +457,7 @@ NodeOperationBuilder::OpInputs NodeOperationBuilder::cache_output_links(
NodeOperationOutput *output) const
{
OpInputs inputs;
- for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
const Link &link = *it;
if (link.from() == output) {
inputs.push_back(link.to());
@@ -469,7 +469,7 @@ NodeOperationBuilder::OpInputs NodeOperationBuilder::cache_output_links(
WriteBufferOperation *NodeOperationBuilder::find_attached_write_buffer_operation(
NodeOperationOutput *output) const
{
- for (Links::const_iterator it = m_links.begin(); it != m_links.end(); ++it) {
+ for (Links::const_iterator it = m_links.begin(); it != m_links.end(); it++) {
const Link &link = *it;
if (link.from() == output) {
NodeOperation &op = link.to()->getOperation();
@@ -529,7 +529,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
}
WriteBufferOperation *writeOperation = NULL;
- for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
+ for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); it++) {
NodeOperationInput *target = *it;
/* try to find existing write buffer operation */
@@ -555,7 +555,7 @@ void NodeOperationBuilder::add_output_buffers(NodeOperation *operation,
writeOperation->readResolutionFromInputSocket();
/* add readbuffer op for every former connected input */
- for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); ++it) {
+ for (OpInputs::const_iterator it = targets.begin(); it != targets.end(); it++) {
NodeOperationInput *target = *it;
if (&target->getOperation() == writeOperation) {
continue; /* skip existing write op links */
@@ -578,13 +578,13 @@ void NodeOperationBuilder::add_complex_operation_buffers()
* will invalidate iterators over the main m_operations
*/
Operations complex_ops;
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
if ((*it)->isComplex()) {
complex_ops.push_back(*it);
}
}
- for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); ++it) {
+ for (Operations::const_iterator it = complex_ops.begin(); it != complex_ops.end(); it++) {
NodeOperation *op = *it;
DebugInfo::operation_read_write_buffer(op);
@@ -608,7 +608,7 @@ static void find_reachable_operations_recursive(Tags &reachable, NodeOperation *
}
reachable.insert(op);
- for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
+ for (int i = 0; i < op->getNumberOfInputSockets(); i++) {
NodeOperationInput *input = op->getInputSocket(i);
if (input->isConnected()) {
find_reachable_operations_recursive(reachable, &input->getLink()->getOperation());
@@ -626,7 +626,7 @@ static void find_reachable_operations_recursive(Tags &reachable, NodeOperation *
void NodeOperationBuilder::prune_operations()
{
Tags reachable;
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
/* output operations are primary executed operations */
@@ -637,7 +637,7 @@ void NodeOperationBuilder::prune_operations()
/* delete unreachable operations */
Operations reachable_ops;
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
if (reachable.find(op) != reachable.end()) {
@@ -661,7 +661,7 @@ static void sort_operations_recursive(NodeOperationBuilder::Operations &sorted,
}
visited.insert(op);
- for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
+ for (int i = 0; i < op->getNumberOfInputSockets(); i++) {
NodeOperationInput *input = op->getInputSocket(i);
if (input->isConnected()) {
sort_operations_recursive(sorted, visited, &input->getLink()->getOperation());
@@ -677,7 +677,7 @@ void NodeOperationBuilder::sort_operations()
sorted.reserve(m_operations.size());
Tags visited;
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
sort_operations_recursive(sorted, visited, *it);
}
@@ -696,7 +696,7 @@ static void add_group_operations_recursive(Tags &visited, NodeOperation *op, Exe
}
/* add all eligible input ops to the group */
- for (int i = 0; i < op->getNumberOfInputSockets(); ++i) {
+ for (int i = 0; i < op->getNumberOfInputSockets(); i++) {
NodeOperationInput *input = op->getInputSocket(i);
if (input->isConnected()) {
add_group_operations_recursive(visited, &input->getLink()->getOperation(), group);
@@ -717,7 +717,7 @@ ExecutionGroup *NodeOperationBuilder::make_group(NodeOperation *op)
void NodeOperationBuilder::group_operations()
{
- for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); ++it) {
+ for (Operations::const_iterator it = m_operations.begin(); it != m_operations.end(); it++) {
NodeOperation *op = *it;
if (op->isOutputOperation(m_context->isRendering())) {
diff --git a/source/blender/compositor/nodes/COM_CornerPinNode.cpp b/source/blender/compositor/nodes/COM_CornerPinNode.cpp
index 9a9ecb755af..efe847bbfbf 100644
--- a/source/blender/compositor/nodes/COM_CornerPinNode.cpp
+++ b/source/blender/compositor/nodes/COM_CornerPinNode.cpp
@@ -45,7 +45,7 @@ void CornerPinNode::convertToOperations(NodeConverter &converter,
converter.addOperation(plane_mask_operation);
converter.mapInputSocket(input_image, warp_image_operation->getInputSocket(0));
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
NodeInput *corner_input = getInputSocket(node_corner_index[i]);
converter.mapInputSocket(corner_input, warp_image_operation->getInputSocket(i + 1));
converter.mapInputSocket(corner_input, plane_mask_operation->getInputSocket(i));
diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cpp b/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
index 4219fd49d44..da80ef697c1 100644
--- a/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
+++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cpp
@@ -90,7 +90,7 @@ void CryptomatteNode::convertToOperations(NodeConverter &converter,
converter.addOperation(operation);
- for (int i = 0; i < getNumberOfInputSockets() - 1; ++i) {
+ for (int i = 0; i < getNumberOfInputSockets() - 1; i++) {
converter.mapInputSocket(this->getInputSocket(i + 1), operation->getInputSocket(i));
}
diff --git a/source/blender/compositor/nodes/COM_ImageNode.cpp b/source/blender/compositor/nodes/COM_ImageNode.cpp
index 6bce56ffd52..8e2590a9d92 100644
--- a/source/blender/compositor/nodes/COM_ImageNode.cpp
+++ b/source/blender/compositor/nodes/COM_ImageNode.cpp
@@ -206,7 +206,7 @@ void ImageNode::convertToOperations(NodeConverter &converter,
/* without this, multilayer that fail to load will crash blender [#32490] */
if (is_multilayer_ok == false) {
- for (int i = 0; i < getNumberOfOutputSockets(); ++i) {
+ for (int i = 0; i < getNumberOfOutputSockets(); i++) {
converter.setInvalidOutput(getOutputSocket(i));
}
}
diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
index 822359771f3..d40f822eb55 100644
--- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp
+++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
@@ -69,7 +69,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter,
int num_inputs = getNumberOfInputSockets();
bool previewAdded = false;
- for (int i = 0; i < num_inputs; ++i) {
+ for (int i = 0; i < num_inputs; i++) {
NodeInput *input = getInputSocket(i);
NodeImageMultiFileSocket *sockdata =
(NodeImageMultiFileSocket *)input->getbNodeSocket()->storage;
@@ -88,7 +88,7 @@ void OutputFileNode::convertToOperations(NodeConverter &converter,
else { /* single layer format */
int num_inputs = getNumberOfInputSockets();
bool previewAdded = false;
- for (int i = 0; i < num_inputs; ++i) {
+ for (int i = 0; i < num_inputs; i++) {
NodeInput *input = getInputSocket(i);
if (input->isLinked()) {
NodeImageMultiFileSocket *sockdata =
diff --git a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
index 84c41134b89..1b2e3b2821e 100644
--- a/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
+++ b/source/blender/compositor/operations/COM_BlurBaseOperation.cpp
@@ -93,7 +93,7 @@ __m128 *BlurBaseOperation::convert_gausstab_sse(const float *gausstab, int size)
{
int n = 2 * size + 1;
__m128 *gausstab_sse = (__m128 *)MEM_mallocN_aligned(sizeof(__m128) * n, 16, "gausstab sse");
- for (int i = 0; i < n; ++i) {
+ for (int i = 0; i < n; i++) {
gausstab_sse[i] = _mm_set1_ps(gausstab[i]);
}
return gausstab_sse;
diff --git a/source/blender/compositor/operations/COM_DenoiseOperation.cpp b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
index 3aeaba539f9..8235c296c5a 100644
--- a/source/blender/compositor/operations/COM_DenoiseOperation.cpp
+++ b/source/blender/compositor/operations/COM_DenoiseOperation.cpp
@@ -152,7 +152,7 @@ void DenoiseOperation::generateDenoise(float *data,
/* copy the alpha channel, OpenImageDenoise currently only supports RGB */
size_t numPixels = inputTileColor->getWidth() * inputTileColor->getHeight();
- for (size_t i = 0; i < numPixels; ++i) {
+ for (size_t i = 0; i < numPixels; i++) {
data[i * 4 + 3] = inputBufferColor[i * 4 + 3];
}
return;
diff --git a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
index 7cf1086dca1..52bc00e9b84 100644
--- a/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
+++ b/source/blender/compositor/operations/COM_DilateErodeOperation.cpp
@@ -387,7 +387,7 @@ void *DilateStepOperation::initializeTileData(rcti *rect)
for (x = 0; x < bwidth + 5 * half_window; x++) {
buf[x] = -FLT_MAX;
}
- for (x = xmin; x < xmax; ++x) {
+ for (x = xmin; x < xmax; x++) {
buf[x - rect->xmin + window - 1] = buffer[(y * width + x)];
}
@@ -516,7 +516,7 @@ void *ErodeStepOperation::initializeTileData(rcti *rect)
for (x = 0; x < bwidth + 5 * half_window; x++) {
buf[x] = FLT_MAX;
}
- for (x = xmin; x < xmax; ++x) {
+ for (x = xmin; x < xmax; x++) {
buf[x - rect->xmin + window - 1] = buffer[(y * width + x)];
}
diff --git a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
index 59a397ab32d..1b590c0c392 100644
--- a/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_DirectionalBlurOperation.cpp
@@ -72,7 +72,7 @@ void DirectionalBlurOperation::executePixel(float output[4], int x, int y, void
float lsc = this->m_sc;
float lrot = this->m_rot;
/* blur the image */
- for (int i = 0; i < iterations; ++i) {
+ for (int i = 0; i < iterations; i++) {
const float cs = cosf(lrot), ss = sinf(lrot);
const float isc = 1.0f / (1.0f + lsc);
diff --git a/source/blender/compositor/operations/COM_DisplaceOperation.cpp b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
index 3efc566cb4e..b775bfdee4c 100644
--- a/source/blender/compositor/operations/COM_DisplaceOperation.cpp
+++ b/source/blender/compositor/operations/COM_DisplaceOperation.cpp
@@ -111,12 +111,12 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r
if (read_displacement(xy[0] + epsilon[0], xy[1], xs, ys, xy, uv[0], uv[1])) {
r_deriv[0][0] += uv[0] - r_uv[0];
r_deriv[1][0] += uv[1] - r_uv[1];
- ++num;
+ num++;
}
if (read_displacement(xy[0] - epsilon[0], xy[1], xs, ys, xy, uv[0], uv[1])) {
r_deriv[0][0] += r_uv[0] - uv[0];
r_deriv[1][0] += r_uv[1] - uv[1];
- ++num;
+ num++;
}
if (num > 0) {
float numinv = 1.0f / (float)num;
@@ -128,12 +128,12 @@ void DisplaceOperation::pixelTransform(const float xy[2], float r_uv[2], float r
if (read_displacement(xy[0], xy[1] + epsilon[1], xs, ys, xy, uv[0], uv[1])) {
r_deriv[0][1] += uv[0] - r_uv[0];
r_deriv[1][1] += uv[1] - r_uv[1];
- ++num;
+ num++;
}
if (read_displacement(xy[0], xy[1] - epsilon[1], xs, ys, xy, uv[0], uv[1])) {
r_deriv[0][1] += r_uv[0] - uv[0];
r_deriv[1][1] += r_uv[1] - uv[1];
- ++num;
+ num++;
}
if (num > 0) {
float numinv = 1.0f / (float)num;
diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
index 2c12091c458..3058a5990c6 100644
--- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cpp
@@ -89,18 +89,18 @@ void *FastGaussianBlurOperation::initializeTileData(rcti *rect)
this->m_sy = this->m_data.sizey * this->m_size / 2.0f;
if ((this->m_sx == this->m_sy) && (this->m_sx > 0.0f)) {
- for (c = 0; c < COM_NUM_CHANNELS_COLOR; ++c) {
+ for (c = 0; c < COM_NUM_CHANNELS_COLOR; c++) {
IIR_gauss(copy, this->m_sx, c, 3);
}
}
else {
if (this->m_sx > 0.0f) {
- for (c = 0; c < COM_NUM_CHANNELS_COLOR; ++c) {
+ for (c = 0; c < COM_NUM_CHANNELS_COLOR; c++) {
IIR_gauss(copy, this->m_sx, c, 1);
}
}
if (this->m_sy > 0.0f) {
- for (c = 0; c < COM_NUM_CHANNELS_COLOR; ++c) {
+ for (c = 0; c < COM_NUM_CHANNELS_COLOR; c++) {
IIR_gauss(copy, this->m_sy, c, 2);
}
}
@@ -216,16 +216,16 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src,
W = (double *)MEM_callocN(sz * sizeof(double), "IIR_gauss W buf");
if (xy & 1) { // H
int offset;
- for (y = 0; y < src_height; ++y) {
+ for (y = 0; y < src_height; y++) {
const int yx = y * src_width;
offset = yx * num_channels + chan;
- for (x = 0; x < src_width; ++x) {
+ for (x = 0; x < src_width; x++) {
X[x] = buffer[offset];
offset += num_channels;
}
YVV(src_width);
offset = yx * num_channels + chan;
- for (x = 0; x < src_width; ++x) {
+ for (x = 0; x < src_width; x++) {
buffer[offset] = Y[x];
offset += num_channels;
}
@@ -235,15 +235,15 @@ void FastGaussianBlurOperation::IIR_gauss(MemoryBuffer *src,
int offset;
const int add = src_width * num_channels;
- for (x = 0; x < src_width; ++x) {
+ for (x = 0; x < src_width; x++) {
offset = x * num_channels + chan;
- for (y = 0; y < src_height; ++y) {
+ for (y = 0; y < src_height; y++) {
X[y] = buffer[offset];
offset += add;
}
YVV(src_height);
offset = x * num_channels + chan;
- for (y = 0; y < src_height; ++y) {
+ for (y = 0; y < src_height; y++) {
buffer[offset] = Y[y];
offset += add;
}
diff --git a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
index 30a6a05ed2c..b43b94af06a 100644
--- a/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
@@ -61,7 +61,7 @@ static void FHT(fREAL *data, unsigned int M, unsigned int inverse)
int i, j = 0;
unsigned int Nh = len >> 1;
- for (i = 1; i < (len - 1); ++i) {
+ for (i = 1; i < (len - 1); i++) {
j = revbin_upd(j, Nh);
if (j > i) {
t1 = data[i];
@@ -117,7 +117,7 @@ static void FHT(fREAL *data, unsigned int M, unsigned int inverse)
if (inverse) {
fREAL sc = (fREAL)1 / (fREAL)len;
- for (k = 0; k < len; ++k) {
+ for (k = 0; k < len; k++) {
data[k] *= sc;
}
}
@@ -136,14 +136,14 @@ static void FHT2D(
// rows (forward transform skips 0 pad data)
maxy = inverse ? Ny : nzp;
- for (j = 0; j < maxy; ++j) {
+ for (j = 0; j < maxy; j++) {
FHT(&data[Nx * j], Mx, inverse);
}
// transpose data
if (Nx == Ny) { // square
- for (j = 0; j < Ny; ++j) {
- for (i = j + 1; i < Nx; ++i) {
+ for (j = 0; j < Ny; j++) {
+ for (i = j + 1; i < Nx; i++) {
unsigned int op = i + (j << Mx), np = j + (i << My);
SWAP(fREAL, data[op], data[np]);
}
@@ -171,7 +171,7 @@ static void FHT2D(
SWAP(unsigned int, Mx, My);
// now columns == transposed rows
- for (j = 0; j < Ny; ++j) {
+ for (j = 0; j < Ny; j++) {
FHT(&data[Nx * j], Mx, inverse);
}
@@ -421,9 +421,9 @@ void GlareFogGlowOperation::generateGlare(float *data,
scale = 0.25f * sqrtf((float)(sz * sz));
- for (y = 0; y < sz; ++y) {
+ for (y = 0; y < sz; y++) {
v = 2.0f * (y / (float)sz) - 1.0f;
- for (x = 0; x < sz; ++x) {
+ for (x = 0; x < sz; x++) {
u = 2.0f * (x / (float)sz) - 1.0f;
r = (u * u + v * v) * scale;
d = -sqrtf(sqrtf(sqrtf(r))) * 9.0f;
diff --git a/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp b/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
index 951dec9281e..4fccb62e3df 100644
--- a/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
+++ b/source/blender/compositor/operations/COM_GlareStreaksOperation.cpp
@@ -41,7 +41,7 @@ void GlareStreaksOperation::generateGlare(float *data,
for (a = 0.0f; a < DEG2RADF(360.0f) && (!breaked); a += ang) {
const float an = a + settings->angle_ofs;
const float vx = cos((double)an), vy = sin((double)an);
- for (n = 0; n < settings->iter && (!breaked); ++n) {
+ for (n = 0; n < settings->iter && (!breaked); n++) {
const float p4 = pow(4.0, (double)n);
const float vxp = vx * p4, vyp = vy * p4;
const float wt = pow((double)settings->fade, (double)p4);
@@ -50,8 +50,8 @@ void GlareStreaksOperation::generateGlare(float *data,
(double)n +
1); // colormodulation amount relative to current pass
float *tdstcol = tdst->getBuffer();
- for (y = 0; y < tsrc->getHeight() && (!breaked); ++y) {
- for (x = 0; x < tsrc->getWidth(); ++x, tdstcol += 4) {
+ for (y = 0; y < tsrc->getHeight() && (!breaked); y++) {
+ for (x = 0; x < tsrc->getWidth(); x++, tdstcol += 4) {
// first pass no offset, always same for every pass, exact copy,
// otherwise results in uneven brightness, only need once
if (n == 0) {
diff --git a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
index 300d122589f..83dd90ef08b 100644
--- a/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingBlurOperation.cpp
@@ -51,7 +51,7 @@ void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data
if (this->m_axis == 0) {
const int start = max(0, x - this->m_size + 1), end = min(bufferWidth, x + this->m_size);
- for (int cx = start; cx < end; ++cx) {
+ for (int cx = start; cx < end; cx++) {
int bufferIndex = (y * bufferWidth + cx);
average += buffer[bufferIndex];
count++;
@@ -60,7 +60,7 @@ void KeyingBlurOperation::executePixel(float output[4], int x, int y, void *data
else {
const int start = max(0, y - this->m_size + 1),
end = min(inputBuffer->getHeight(), y + this->m_size);
- for (int cy = start; cy < end; ++cy) {
+ for (int cy = start; cy < end; cy++) {
int bufferIndex = (cy * bufferWidth + x);
average += buffer[bufferIndex];
count++;
diff --git a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp
index b11bd54a190..eafd1e671f8 100644
--- a/source/blender/compositor/operations/COM_KeyingClipOperation.cpp
+++ b/source/blender/compositor/operations/COM_KeyingClipOperation.cpp
@@ -71,8 +71,8 @@ void KeyingClipOperation::executePixel(float output[4], int x, int y, void *data
ok = true;
}
- for (int cx = start_x; ok == false && cx <= end_x; ++cx) {
- for (int cy = start_y; ok == false && cy <= end_y; ++cy) {
+ for (int cx = start_x; ok == false && cx <= end_x; cx++) {
+ for (int cy = start_y; ok == false && cy <= end_y; cy++) {
if (UNLIKELY(cx == x && cy == y)) {
continue;
}
diff --git a/source/blender/compositor/operations/COM_MapUVOperation.cpp b/source/blender/compositor/operations/COM_MapUVOperation.cpp
index 21d432b9222..de55c9fb4b8 100644
--- a/source/blender/compositor/operations/COM_MapUVOperation.cpp
+++ b/source/blender/compositor/operations/COM_MapUVOperation.cpp
@@ -117,12 +117,12 @@ void MapUVOperation::pixelTransform(const float xy[2],
if (read_uv(xy[0] + epsilon[0], xy[1], uv[0], uv[1], alpha)) {
r_deriv[0][0] += uv[0] - r_uv[0];
r_deriv[1][0] += uv[1] - r_uv[1];
- ++num;
+ num++;
}
if (read_uv(xy[0] - epsilon[0], xy[1], uv[0], uv[1], alpha)) {
r_deriv[0][0] += r_uv[0] - uv[0];
r_deriv[1][0] += r_uv[1] - uv[1];
- ++num;
+ num++;
}
if (num > 0) {
float numinv = 1.0f / (float)num;
@@ -134,12 +134,12 @@ void MapUVOperation::pixelTransform(const float xy[2],
if (read_uv(xy[0], xy[1] + epsilon[1], uv[0], uv[1], alpha)) {
r_deriv[0][1] += uv[0] - r_uv[0];
r_deriv[1][1] += uv[1] - r_uv[1];
- ++num;
+ num++;
}
if (read_uv(xy[0], xy[1] - epsilon[1], uv[0], uv[1], alpha)) {
r_deriv[0][1] += r_uv[0] - uv[0];
r_deriv[1][1] += r_uv[1] - uv[1];
- ++num;
+ num++;
}
if (num > 0) {
float numinv = 1.0f / (float)num;
diff --git a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
index 9d1be09de0e..444af5c4cf7 100644
--- a/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileMultiViewOperation.cpp
@@ -183,7 +183,7 @@ void *OutputOpenExrMultiLayerMultiViewOperation::get_handle(const char *filename
IMB_exr_add_view(exrhandle, srv->name);
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
add_exr_channels(exrhandle,
this->m_layers[i].name,
this->m_layers[i].datatype,
@@ -229,7 +229,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinitExecution()
exrhandle = this->get_handle(filename);
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
add_exr_channels(exrhandle,
this->m_layers[i].name,
this->m_layers[i].datatype,
@@ -239,7 +239,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinitExecution()
this->m_layers[i].outputBuffer);
}
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
/* memory can only be freed after we write all views to the file */
this->m_layers[i].outputBuffer = NULL;
this->m_layers[i].imageInput = NULL;
@@ -250,7 +250,7 @@ void OutputOpenExrMultiLayerMultiViewOperation::deinitExecution()
IMB_exr_write_channels(exrhandle);
/* free buffer memory for all the views */
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
free_exr_channels(
exrhandle, this->m_rd, this->m_layers[i].name, this->m_layers[i].datatype);
}
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
index 79e3b2f1108..c06994d7cdb 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
@@ -162,7 +162,7 @@ static void write_buffer_rect(rcti *rect,
for (x = x1; x < x2 && (!breaked); x++) {
reader->readSampled(color, x, y, COM_PS_NEAREST);
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
buffer[offset + i] = color[i];
}
offset += size;
@@ -298,7 +298,7 @@ void OutputOpenExrMultiLayerOperation::add_layer(const char *name,
void OutputOpenExrMultiLayerOperation::initExecution()
{
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
if (this->m_layers[i].use_layer) {
SocketReader *reader = getInputSocketReader(i);
this->m_layers[i].imageInput = reader;
@@ -310,7 +310,7 @@ void OutputOpenExrMultiLayerOperation::initExecution()
void OutputOpenExrMultiLayerOperation::executeRegion(rcti *rect, unsigned int /*tileNumber*/)
{
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
OutputOpenExrLayer &layer = this->m_layers[i];
if (layer.imageInput) {
write_buffer_rect(rect,
@@ -343,7 +343,7 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
suffix);
BLI_make_existing_file(filename);
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
OutputOpenExrLayer &layer = this->m_layers[i];
if (!layer.imageInput) {
continue; /* skip unconnected sockets */
@@ -369,7 +369,7 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
}
IMB_exr_close(exrhandle);
- for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ for (unsigned int i = 0; i < this->m_layers.size(); i++) {
if (this->m_layers[i].outputBuffer) {
MEM_freeN(this->m_layers[i].outputBuffer);
this->m_layers[i].outputBuffer = NULL;
diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp
index 313be2f5ecf..676601d82da 100644
--- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp
+++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cpp
@@ -60,7 +60,7 @@ static bool check_corners(float corners[4][2])
static void readCornersFromSockets(rcti *rect, SocketReader *readers[4], float corners[4][2])
{
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
float result[4] = {0.0f, 0.0f, 0.0f, 0.0f};
readers[i]->readSampled(result, rect->xmin, rect->ymin, COM_PS_NEAREST);
corners[i][0] = result[0];
@@ -208,7 +208,7 @@ void *PlaneCornerPinWarpImageOperation::initializeTileData(rcti *rect)
bool PlaneCornerPinWarpImageOperation::determineDependingAreaOfInterest(
rcti *input, ReadBufferOperation *readOperation, rcti *output)
{
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
if (getInputOperation(i + 1)->determineDependingAreaOfInterest(input, readOperation, output)) {
return true;
}
diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
index ef7dfbd4116..78a83391ed1 100644
--- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
+++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cpp
@@ -105,7 +105,7 @@ void PlaneDistortWarpImageOperation::executePixelSampled(float output[4],
}
else {
zero_v4(output);
- for (int sample = 0; sample < this->m_motion_blur_samples; ++sample) {
+ for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
float color[4];
warpCoord(x, y, this->m_samples[sample].perspectiveMatrix, uv, deriv);
m_pixelReader->readFiltered(color, uv[0], uv[1], deriv[0], deriv[1]);
@@ -121,7 +121,7 @@ bool PlaneDistortWarpImageOperation::determineDependingAreaOfInterest(
float min[2], max[2];
INIT_MINMAX2(min, max);
- for (int sample = 0; sample < this->m_motion_blur_samples; ++sample) {
+ for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
float UVs[4][2];
float deriv[2][2];
MotionSample *sample_data = &this->m_samples[sample];
@@ -208,9 +208,9 @@ void PlaneDistortMaskOperation::executePixelSampled(float output[4],
output[0] = (float)inside_counter / this->m_osa;
}
else {
- for (int motion_sample = 0; motion_sample < this->m_motion_blur_samples; ++motion_sample) {
+ for (int motion_sample = 0; motion_sample < this->m_motion_blur_samples; motion_sample++) {
MotionSample *sample_data = &this->m_samples[motion_sample];
- for (int osa_sample = 0; osa_sample < this->m_osa; ++osa_sample) {
+ for (int osa_sample = 0; osa_sample < this->m_osa; osa_sample++) {
point[0] = x + this->m_jitter[osa_sample][0];
point[1] = y + this->m_jitter[osa_sample][1];
if (isect_point_tri_v2(point,
diff --git a/source/blender/compositor/operations/COM_PlaneTrackOperation.cpp b/source/blender/compositor/operations/COM_PlaneTrackOperation.cpp
index c2fe41eea1d..cbf5a25fa31 100644
--- a/source/blender/compositor/operations/COM_PlaneTrackOperation.cpp
+++ b/source/blender/compositor/operations/COM_PlaneTrackOperation.cpp
@@ -93,7 +93,7 @@ void PlaneTrackMaskOperation::initExecution()
const float frame = (float)this->m_framenumber - this->m_motion_blur_shutter;
const float frame_step = (this->m_motion_blur_shutter * 2.0f) / this->m_motion_blur_samples;
float frame_iter = frame;
- for (int sample = 0; sample < this->m_motion_blur_samples; ++sample) {
+ for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
readCornersFromTrack(corners, frame_iter);
calculateCorners(corners, true, sample);
frame_iter += frame_step;
@@ -116,7 +116,7 @@ void PlaneTrackWarpImageOperation::initExecution()
const float frame = (float)this->m_framenumber - this->m_motion_blur_shutter;
const float frame_step = (this->m_motion_blur_shutter * 2.0f) / this->m_motion_blur_samples;
float frame_iter = frame;
- for (int sample = 0; sample < this->m_motion_blur_samples; ++sample) {
+ for (int sample = 0; sample < this->m_motion_blur_samples; sample++) {
readCornersFromTrack(corners, frame_iter);
calculateCorners(corners, true, sample);
frame_iter += frame_step;
diff --git a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
index 738f7ed31ba..94224ac77a6 100644
--- a/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
+++ b/source/blender/compositor/operations/COM_ScreenLensDistortionOperation.cpp
@@ -148,7 +148,7 @@ void ScreenLensDistortionOperation::accumulate(MemoryBuffer *buffer,
float k4 = m_k4[a];
float dk4 = m_dk4[a];
- for (float z = 0; z < ds; ++z) {
+ for (float z = 0; z < ds; z++) {
float tz = (z + (m_jitter ? BLI_rng_get_float(m_rng) : 0.5f)) * sd;
float t = 1.0f - (k4 + tz * dk4) * r_sq;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
index bfb1a981c4d..bea59eceea2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_cycle.cc
@@ -176,7 +176,7 @@ void solve_cycles(CyclesSolverState *state)
OperationNode *node = entry->node;
bool all_child_traversed = true;
const int num_visited = get_node_num_visited_children(node);
- for (int i = num_visited; i < node->outlinks.size(); ++i) {
+ for (int i = num_visited; i < node->outlinks.size(); i++) {
Relation *rel = node->outlinks[i];
if (rel->to->type == NodeType::OPERATION) {
OperationNode *to = (OperationNode *)rel->to;
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index fd4c1e251e4..88f2f041354 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@ -1155,7 +1155,7 @@ void DepsgraphNodeBuilder::build_particle_settings(ParticleSettings *particle_se
&particle_settings->id, NodeType::PARTICLE_SETTINGS, OperationCode::PARTICLE_SETTINGS_EVAL);
op_node->set_as_exit();
/* Texture slots. */
- for (int mtex_index = 0; mtex_index < MAX_MTEX; ++mtex_index) {
+ for (int mtex_index = 0; mtex_index < MAX_MTEX; mtex_index++) {
MTex *mtex = particle_settings->mtex[mtex_index];
if (mtex == NULL || mtex->tex == NULL) {
continue;
@@ -1436,7 +1436,7 @@ void DepsgraphNodeBuilder::build_material(Material *material)
void DepsgraphNodeBuilder::build_materials(Material **materials, int num_materials)
{
- for (int i = 0; i < num_materials; ++i) {
+ for (int i = 0; i < num_materials; i++) {
if (materials[i] == NULL) {
continue;
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
index 2f6b8c0ba6b..88ebf1c9b50 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_view_layer.cc
@@ -105,7 +105,7 @@ void DepsgraphNodeBuilder::build_view_layer(Scene *scene,
*
* TODO(sergey): Need to go more granular on visibility checks. */
build_object(base_index, base->object, linked_state, true);
- ++base_index;
+ base_index++;
}
}
build_layer_collections(&view_layer->layer_collections);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index c7b545e9feb..61e9b83273b 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -1809,7 +1809,7 @@ void DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part)
particle_settings_init_key, particle_settings_eval_key, "Particle Settings Init Order");
add_relation(particle_settings_reset_key, particle_settings_eval_key, "Particle Settings Reset");
/* Texture slots. */
- for (int mtex_index = 0; mtex_index < MAX_MTEX; ++mtex_index) {
+ for (int mtex_index = 0; mtex_index < MAX_MTEX; mtex_index++) {
MTex *mtex = part->mtex[mtex_index];
if (mtex == NULL || mtex->tex == NULL) {
continue;
@@ -2258,7 +2258,7 @@ void DepsgraphRelationBuilder::build_material(Material *material)
void DepsgraphRelationBuilder::build_materials(Material **materials, int num_materials)
{
- for (int i = 0; i < num_materials; ++i) {
+ for (int i = 0; i < num_materials; i++) {
if (materials[i] == NULL) {
continue;
}
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc
index 3e5e96d30ff..34d2afcfa66 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_transitive.cc
@@ -92,15 +92,15 @@ void deg_graph_transitive_reduction(Depsgraph *graph)
* set/cleared. */
/* TODO: there will be other types in future, so iterators above
* need modifying. */
- ++it_rel;
+ it_rel++;
}
else if (rel->from->custom_flags & OP_REACHABLE) {
rel->unlink();
OBJECT_GUARDED_DELETE(rel, Relation);
- ++num_removed_relations;
+ num_removed_relations++;
}
else {
- ++it_rel;
+ it_rel++;
}
}
}
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
index 9c4a672b805..ee3959a0861 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
@@ -144,7 +144,7 @@ static int deg_debug_node_color_index(const Node *node)
#ifdef COLOR_SCHEME_NODE_TYPE
const int(*pair)[2];
- for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; ++pair) {
+ for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
if ((*pair)[0] == node->type) {
return (*pair)[1];
}
@@ -197,7 +197,7 @@ static void deg_debug_graphviz_legend(const DebugContext &ctx)
#ifdef COLOR_SCHEME_NODE_TYPE
const int(*pair)[2];
- for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; ++pair) {
+ for (pair = deg_debug_node_type_color_map; (*pair)[0] >= 0; pair++) {
DepsNodeFactory *nti = type_get_factory((NodeType)(*pair)[0]);
deg_debug_graphviz_legend_color(
ctx, nti->tname().c_str(), deg_debug_colors_light[(*pair)[1] % deg_debug_max_colors]);
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
index b4cf30685a2..4a668e817fe 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_stats_gnuplot.cc
@@ -85,7 +85,7 @@ string gnuplotify_name(const string &name)
{
string result = "";
const int length = name.length();
- for (int i = 0; i < length; ++i) {
+ for (int i = 0; i < length; i++) {
const char ch = name[i];
if (ch == '_') {
result += "\\\\\\";
diff --git a/source/blender/depsgraph/intern/depsgraph_debug.cc b/source/blender/depsgraph/intern/depsgraph_debug.cc
index 6253d31b8aa..c5a756102ca 100644
--- a/source/blender/depsgraph/intern/depsgraph_debug.cc
+++ b/source/blender/depsgraph/intern/depsgraph_debug.cc
@@ -112,13 +112,13 @@ bool DEG_debug_consistency_check(Depsgraph *graph)
int counter1 = 0;
for (DEG::Relation *tmp_rel : node->outlinks) {
if (tmp_rel == rel) {
- ++counter1;
+ counter1++;
}
}
int counter2 = 0;
for (DEG::Relation *tmp_rel : rel->to->inlinks) {
if (tmp_rel == rel) {
- ++counter2;
+ counter2++;
}
}
if (counter1 != counter2) {
@@ -137,13 +137,13 @@ bool DEG_debug_consistency_check(Depsgraph *graph)
int counter1 = 0;
for (DEG::Relation *tmp_rel : node->inlinks) {
if (tmp_rel == rel) {
- ++counter1;
+ counter1++;
}
}
int counter2 = 0;
for (DEG::Relation *tmp_rel : rel->from->outlinks) {
if (tmp_rel == rel) {
- ++counter2;
+ counter2++;
}
}
if (counter1 != counter2) {
@@ -179,7 +179,7 @@ bool DEG_debug_consistency_check(Depsgraph *graph)
int num_links_pending = 0;
for (DEG::Relation *rel : node->inlinks) {
if (rel->from->type == DEG::NodeType::OPERATION) {
- ++num_links_pending;
+ num_links_pending++;
}
}
if (node->num_links_pending != num_links_pending) {
diff --git a/source/blender/draw/engines/eevee/eevee_bloom.c b/source/blender/draw/engines/eevee/eevee_bloom.c
index 14faa827be5..c6cc336db56 100644
--- a/source/blender/draw/engines/eevee/eevee_bloom.c
+++ b/source/blender/draw/engines/eevee/eevee_bloom.c
@@ -128,7 +128,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
/* Downsample buffers */
copy_v2_v2_int(texsize, blitsize);
- for (int i = 0; i < effects->bloom_iteration_len; ++i) {
+ for (int i = 0; i < effects->bloom_iteration_len; i++) {
texsize[0] /= 2;
texsize[1] /= 2;
@@ -147,7 +147,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
/* Upsample buffers */
copy_v2_v2_int(texsize, blitsize);
- for (int i = 0; i < effects->bloom_iteration_len - 1; ++i) {
+ for (int i = 0; i < effects->bloom_iteration_len - 1; i++) {
texsize[0] /= 2;
texsize[1] /= 2;
@@ -167,7 +167,7 @@ int EEVEE_bloom_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *vedata)
/* Cleanup to release memory */
GPU_FRAMEBUFFER_FREE_SAFE(fbl->bloom_blit_fb);
- for (int i = 0; i < MAX_BLOOM_STEP - 1; ++i) {
+ for (int i = 0; i < MAX_BLOOM_STEP - 1; i++) {
GPU_FRAMEBUFFER_FREE_SAFE(fbl->bloom_down_fb[i]);
GPU_FRAMEBUFFER_FREE_SAFE(fbl->bloom_accum_fb[i]);
}
@@ -288,7 +288,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata)
last = effects->bloom_downsample[0];
- for (int i = 1; i < effects->bloom_iteration_len; ++i) {
+ for (int i = 1; i < effects->bloom_iteration_len; i++) {
copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i - 1]);
effects->unf_source_buffer = last;
@@ -300,7 +300,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata)
}
/* Upsample and accumulate */
- for (int i = effects->bloom_iteration_len - 2; i >= 0; --i) {
+ for (int i = effects->bloom_iteration_len - 2; i >= 0; i--) {
copy_v2_v2(effects->unf_source_texel_size, effects->downsamp_texel_size[i]);
effects->unf_source_buffer = effects->bloom_downsample[i];
effects->unf_base_buffer = last;
@@ -324,7 +324,7 @@ void EEVEE_bloom_draw(EEVEE_Data *vedata)
void EEVEE_bloom_free(void)
{
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
DRW_SHADER_FREE_SAFE(e_data.bloom_blit_sh[i]);
DRW_SHADER_FREE_SAFE(e_data.bloom_downsample_sh[i]);
DRW_SHADER_FREE_SAFE(e_data.bloom_upsample_sh[i]);
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
index 12d70131031..572e38a9395 100644
--- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c
+++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c
@@ -269,7 +269,7 @@ void EEVEE_depth_of_field_draw(EEVEE_Data *vedata)
void EEVEE_depth_of_field_free(void)
{
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
DRW_SHADER_FREE_SAFE(e_data.dof_downsample_sh[i]);
DRW_SHADER_FREE_SAFE(e_data.dof_scatter_sh[i]);
DRW_SHADER_FREE_SAFE(e_data.dof_resolve_sh[i]);
diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c
index 0ca1e0b2858..7df1c299454 100644
--- a/source/blender/draw/engines/eevee/eevee_effects.c
+++ b/source/blender/draw/engines/eevee/eevee_effects.c
@@ -206,7 +206,7 @@ void EEVEE_effects_init(EEVEE_ViewLayerData *sldata,
/**
* Compute Mipmap texel alignment.
*/
- for (int i = 0; i < 10; ++i) {
+ for (int i = 0; i < 10; i++) {
int mip_size[2];
GPU_texture_get_mipmap_size(txl->color, i, mip_size);
common_data->mip_ratio[i][0] = viewport_size[0] / (mip_size[0] * powf(2.0f, i));
diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c
index e32194a11de..5b5bb82ef98 100644
--- a/source/blender/draw/engines/eevee/eevee_lightcache.c
+++ b/source/blender/draw/engines/eevee/eevee_lightcache.c
@@ -188,7 +188,7 @@ static uint eevee_lightcache_memsize_get(LightCache *lcache)
}
if (lcache->cube_tx.data) {
size += MEM_allocN_len(lcache->cube_tx.data);
- for (int mip = 0; mip < lcache->mips_len; ++mip) {
+ for (int mip = 0; mip < lcache->mips_len; mip++) {
size += MEM_allocN_len(lcache->cube_mips[mip].data);
}
}
@@ -199,7 +199,7 @@ static int eevee_lightcache_irradiance_sample_count(LightCache *lcache)
{
int total_irr_samples = 0;
- for (int i = 1; i < lcache->grid_len; ++i) {
+ for (int i = 1; i < lcache->grid_len; i++) {
EEVEE_LightGrid *egrid = lcache->grid_data + i;
total_irr_samples += egrid->resolution[0] * egrid->resolution[1] * egrid->resolution[2];
}
@@ -305,7 +305,7 @@ LightCache *EEVEE_lightcache_create(const int grid_len,
light_cache->cube_mips = MEM_callocN(sizeof(LightCacheTexture) * light_cache->mips_len,
"LightCacheTexture");
- for (int mip = 0; mip < light_cache->mips_len; ++mip) {
+ for (int mip = 0; mip < light_cache->mips_len; mip++) {
GPU_texture_get_mipmap_size(
light_cache->cube_tx.tex, mip + 1, light_cache->cube_mips[mip].tex_size);
}
@@ -346,7 +346,7 @@ void EEVEE_lightcache_load(LightCache *lcache)
NULL);
GPU_texture_bind(lcache->cube_tx.tex, 0);
GPU_texture_mipmap_mode(lcache->cube_tx.tex, true, true);
- for (int mip = 0; mip < lcache->mips_len; ++mip) {
+ for (int mip = 0; mip < lcache->mips_len; mip++) {
GPU_texture_add_mipmap(
lcache->cube_tx.tex, GPU_DATA_10_11_11_REV, mip + 1, lcache->cube_mips[mip].data);
}
@@ -369,7 +369,7 @@ static void eevee_lightbake_readback_reflections(LightCache *lcache)
lcache->cube_tx.data_type = LIGHTCACHETEX_UINT;
lcache->cube_tx.components = 1;
- for (int mip = 0; mip < lcache->mips_len; ++mip) {
+ for (int mip = 0; mip < lcache->mips_len; mip++) {
LightCacheTexture *cube_mip = lcache->cube_mips + mip;
MEM_SAFE_FREE(cube_mip->data);
GPU_texture_get_mipmap_size(lcache->cube_tx.tex, mip + 1, cube_mip->tex_size);
@@ -388,7 +388,7 @@ void EEVEE_lightcache_free(LightCache *lcache)
MEM_SAFE_FREE(lcache->grid_tx.data);
if (lcache->cube_mips) {
- for (int i = 0; i < lcache->mips_len; ++i) {
+ for (int i = 0; i < lcache->mips_len; i++) {
MEM_SAFE_FREE(lcache->cube_mips[i].data);
}
MEM_SAFE_FREE(lcache->cube_mips);
@@ -471,7 +471,7 @@ static void eevee_lightbake_create_render_target(EEVEE_LightBake *lbake, int rt_
lbake->rt_color = DRW_texture_create_cube(
rt_res, GPU_RGBA16F, DRW_TEX_FILTER | DRW_TEX_MIPMAP, NULL);
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
GPU_framebuffer_ensure_config(&lbake->rt_fb[i],
{GPU_ATTACHMENT_TEXTURE_CUBEFACE(lbake->rt_depth, i),
GPU_ATTACHMENT_TEXTURE_CUBEFACE(lbake->rt_color, i)});
@@ -670,7 +670,7 @@ static void eevee_lightbake_delete_resources(EEVEE_LightBake *lbake)
DRW_TEXTURE_FREE_SAFE(lbake->rt_color);
DRW_TEXTURE_FREE_SAFE(lbake->grid_prev);
GPU_FRAMEBUFFER_FREE_SAFE(lbake->store_fb);
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
GPU_FRAMEBUFFER_FREE_SAFE(lbake->rt_fb[i]);
}
@@ -875,10 +875,10 @@ static void compute_cell_id(EEVEE_LightGrid *egrid,
*r_stride = 0;
*r_final_idx = 0;
r_local_cell[0] = r_local_cell[1] = r_local_cell[2] = 0;
- for (int lvl = max_lvl; lvl >= 0; --lvl) {
+ for (int lvl = max_lvl; lvl >= 0; lvl--) {
*r_stride = 1 << lvl;
int prev_stride = *r_stride << 1;
- for (int i = 0; i < cell_count; ++i) {
+ for (int i = 0; i < cell_count; i++) {
*r_final_idx = i;
cell_id_to_grid_loc(egrid, *r_final_idx, r_local_cell);
if (((r_local_cell[0] % *r_stride) == 0) && ((r_local_cell[1] % *r_stride) == 0) &&
@@ -1210,12 +1210,12 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float
/* Render irradiance grids */
if (lcache->flag & LIGHTCACHE_UPDATE_GRID) {
- for (lbake->bounce_curr = 0; lbake->bounce_curr < lbake->bounce_len; ++lbake->bounce_curr) {
+ for (lbake->bounce_curr = 0; lbake->bounce_curr < lbake->bounce_len; lbake->bounce_curr++) {
/* Bypass world, start at 1. */
lbake->probe = lbake->grid_prb + 1;
lbake->grid = lcache->grid_data + 1;
for (lbake->grid_curr = 1; lbake->grid_curr < lbake->grid_len;
- ++lbake->grid_curr, ++lbake->probe, ++lbake->grid) {
+ lbake->grid_curr++, lbake->probe++, lbake->grid++) {
LightProbe *prb = *lbake->probe;
lbake->grid_sample_len = prb->grid_resolution_x * prb->grid_resolution_y *
prb->grid_resolution_z;
@@ -1233,7 +1233,7 @@ void EEVEE_lightbake_job(void *custom_data, short *stop, short *do_update, float
lbake->probe = lbake->cube_prb + 1;
lbake->cube = lcache->cube_data + 1;
for (lbake->cube_offset = 1; lbake->cube_offset < lbake->cube_len;
- ++lbake->cube_offset, ++lbake->probe, ++lbake->cube) {
+ lbake->cube_offset++, lbake->probe++, lbake->cube++) {
lightbake_do_sample(lbake, eevee_lightbake_render_probe_sample);
}
}
diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c
index 2d23359a175..19f3983998e 100644
--- a/source/blender/draw/engines/eevee/eevee_lightprobes.c
+++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c
@@ -410,7 +410,7 @@ void EEVEE_lightprobes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
/* Grid Display */
if (scene_eval->eevee.flag & SCE_EEVEE_SHOW_IRRADIANCE) {
EEVEE_LightGrid *egrid = lcache->grid_data + 1;
- for (int p = 1; p < lcache->grid_len; ++p, egrid++) {
+ for (int p = 1; p < lcache->grid_len; p++, egrid++) {
DRWShadingGroup *shgrp = DRW_shgroup_create(EEVEE_shaders_probe_grid_display_sh_get(),
psl->probe_display);
@@ -471,7 +471,7 @@ static bool eevee_lightprobes_culling_test(Object *ob)
normalize_v3(tmp[2]);
mul_v3_fl(tmp[2], probe->distinf);
- for (int v = 0; v < 8; ++v) {
+ for (int v = 0; v < 8; v++) {
mul_m4_v3(tmp, bbox.vec[v]);
}
const DRWView *default_view = DRW_view_default_get();
@@ -845,7 +845,7 @@ static void render_cubemap(void (*callback)(int face, EEVEE_BakeRenderData *user
}
}
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
DRW_view_set_active(views[i]);
callback(i, user_data);
}
@@ -860,11 +860,11 @@ static void render_reflections(void (*callback)(int face, EEVEE_BakeRenderData *
DRWView *main_view = stl->effects->taa_view;
DRWView **views = stl->g_data->planar_views;
/* Prepare views at the same time for faster culling. */
- for (int i = 0; i < ref_count; ++i) {
+ for (int i = 0; i < ref_count; i++) {
lightbake_planar_ensure_view(&planar_data[i], main_view, &views[i]);
}
- for (int i = 0; i < ref_count; ++i) {
+ for (int i = 0; i < ref_count; i++) {
DRW_view_set_active(views[i]);
callback(i, user_data);
}
@@ -1217,7 +1217,7 @@ static void downsample_planar(void *vedata, int level)
const float *size = DRW_viewport_size_get();
copy_v2_v2(stl->g_data->planar_texel_size, size);
- for (int i = 0; i < level - 1; ++i) {
+ for (int i = 0; i < level - 1; i++) {
stl->g_data->planar_texel_size[0] /= 2.0f;
stl->g_data->planar_texel_size[1] /= 2.0f;
min_ff(floorf(stl->g_data->planar_texel_size[0]), 1.0f);
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index 99bfba0d203..712bcc43f52 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -447,7 +447,7 @@ static void eevee_init_util_texture(void)
texels_layer += 64 * 64;
/* Copy Refraction GGX LUT in layer 5 - 21 */
- for (int j = 0; j < 16; ++j) {
+ for (int j = 0; j < 16; j++) {
for (int i = 0; i < 64 * 64; i++) {
texels_layer[i][0] = btdf_split_sum_ggx[j * 2][i];
texels_layer[i][1] = 0.0; /* UNUSED */
@@ -1457,7 +1457,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
struct GPUMaterial **gpumat_depth_array = BLI_array_alloca(gpumat_array, materials_len);
struct Material **ma_array = BLI_array_alloca(ma_array, materials_len);
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
ma_array[i] = eevee_object_material_get(ob, i);
gpumat_array[i] = NULL;
gpumat_depth_array[i] = NULL;
@@ -1525,7 +1525,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
/* TODO(fclem): Support shadows in sculpt mode. */
}
else if (mat_geom) {
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
if (mat_geom[i] == NULL) {
continue;
}
@@ -1551,7 +1551,7 @@ void EEVEE_materials_cache_populate(EEVEE_Data *vedata,
ADD_SHGROUP_CALL_SAFE(shgrp_depth_clip_array[i], ob, mat_geom[i], oedata);
char *name = auto_layer_names;
- for (int j = 0; j < auto_layer_count; ++j) {
+ for (int j = 0; j < auto_layer_count; j++) {
/* TODO don't add these uniform when not needed (default pass shaders). */
/* FIXME: This is broken, as it overrides any autolayers srgb bool of the previous mesh
* that shares the same material. */
@@ -1728,7 +1728,7 @@ void EEVEE_materials_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedat
void EEVEE_materials_free(void)
{
- for (int i = 0; i < VAR_MAT_MAX; ++i) {
+ for (int i = 0; i < VAR_MAT_MAX; i++) {
DRW_SHADER_FREE_SAFE(e_data.default_lit[i]);
}
MEM_SAFE_FREE(e_data.frag_shader_lib);
@@ -1747,7 +1747,7 @@ void EEVEE_materials_free(void)
void EEVEE_materials_draw_opaque(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_PassList *psl)
{
- for (int i = 0; i < VAR_MAT_MAX; ++i) {
+ for (int i = 0; i < VAR_MAT_MAX; i++) {
if (psl->default_pass[i]) {
DRW_draw_pass(psl->default_pass[i]);
}
diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c
index da957239f42..75e837f140b 100644
--- a/source/blender/draw/engines/eevee/eevee_render.c
+++ b/source/blender/draw/engines/eevee/eevee_render.c
@@ -369,7 +369,7 @@ static void eevee_render_result_z(RenderLayer *rl,
DRW_view_winmat_get(NULL, winmat, false);
/* Convert ogl depth [0..1] to view Z [near..far] */
- for (int i = 0; i < rp->rectx * rp->recty; ++i) {
+ for (int i = 0; i < rp->rectx * rp->recty; i++) {
if (rp->rect[i] == 1.0f) {
rp->rect[i] = 1e10f; /* Background */
}
diff --git a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
index 3d1b64422a4..2daf2388d63 100644
--- a/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
+++ b/source/blender/draw/engines/eevee/eevee_screen_raytrace.c
@@ -338,7 +338,7 @@ void EEVEE_reflection_compute(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v
void EEVEE_screen_raytrace_free(void)
{
- for (int i = 0; i < SSR_MAX_SHADER; ++i) {
+ for (int i = 0; i < SSR_MAX_SHADER; i++) {
DRW_SHADER_FREE_SAFE(e_data.ssr_sh[i]);
}
}
diff --git a/source/blender/draw/engines/eevee/eevee_shadows.c b/source/blender/draw/engines/eevee/eevee_shadows.c
index a709e668f34..284742ae149 100644
--- a/source/blender/draw/engines/eevee/eevee_shadows.c
+++ b/source/blender/draw/engines/eevee/eevee_shadows.c
@@ -70,7 +70,7 @@ void EEVEE_shadows_init(EEVEE_ViewLayerData *sldata)
sldata->light_ubo = DRW_uniformbuffer_create(sizeof(EEVEE_Light) * MAX_LIGHT, NULL);
sldata->shadow_ubo = DRW_uniformbuffer_create(shadow_ubo_size, NULL);
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
sldata->shcasters_buffers[i].bbox = MEM_callocN(
sizeof(EEVEE_BoundBox) * SH_CASTER_ALLOC_CHUNK, __func__);
sldata->shcasters_buffers[i].update = BLI_BITMAP_NEW(SH_CASTER_ALLOC_CHUNK, __func__);
@@ -221,7 +221,7 @@ void EEVEE_shadows_caster_register(EEVEE_ViewLayerData *sldata, Object *ob)
BoundBox *bb = BKE_object_boundbox_get(ob);
float min[3], max[3];
INIT_MINMAX(min, max);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
float vec[3];
copy_v3_v3(vec, bb->vec[i]);
mul_m4_v3(ob->obmat, vec);
@@ -316,7 +316,7 @@ void EEVEE_shadows_update(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata)
EEVEE_BoundBox *bbox = backbuffer->bbox;
BoundSphere *bsphere = linfo->shadow_bounds;
/* Search for deleted shadow casters or if shcaster WAS in shadow radius. */
- for (int i = 0; i < backbuffer->count; ++i) {
+ for (int i = 0; i < backbuffer->count; i++) {
/* If the shadowcaster has been deleted or updated. */
if (BLI_BITMAP_TEST(backbuffer->update, i)) {
for (int j = 0; j < linfo->cube_len; j++) {
diff --git a/source/blender/draw/engines/eevee/eevee_shadows_cascade.c b/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
index d5e038f716c..26f83a3e8e0 100644
--- a/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
+++ b/source/blender/draw/engines/eevee/eevee_shadows_cascade.c
@@ -61,7 +61,7 @@ static void shadow_cascade_random_matrix_set(float mat[4][4], float radius, int
#ifndef DEBUG_SHADOW_DISTRIBUTION
EEVEE_sample_ellipse(sample_ofs, mat[0], mat[1], radius, radius, jitter);
#else
- for (int i = 0; i <= sample_ofs; ++i) {
+ for (int i = 0; i <= sample_ofs; i++) {
EEVEE_sample_ellipse(i, mat[0], mat[1], radius, radius, jitter);
float p[3];
add_v3_v3v3(p, jitter, mat[2]);
@@ -87,7 +87,7 @@ static void frustum_min_bounding_sphere(const float corners[8][3],
/* compute the bounding box */
INIT_MINMAX(minvec, maxvec);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
minmax_v3v3_v3(minvec, maxvec, corners[i]);
}
@@ -98,14 +98,14 @@ static void frustum_min_bounding_sphere(const float corners[8][3],
#else
/* Find averaged center. */
zero_v3(r_center);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
add_v3_v3(r_center, corners[i]);
}
mul_v3_fl(r_center, 1.0f / 8.0f);
/* Search the largest distance from the sphere center. */
*r_radius = 0.0f;
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
float rad = len_squared_v3v3(corners[i], r_center);
if (rad > *r_radius) {
*r_radius = rad;
@@ -218,7 +218,7 @@ static void eevee_shadow_cascade_setup(EEVEE_LightsInfo *linfo,
}
/* init near/far */
- for (int c = 0; c < MAX_CASCADE_NUM; ++c) {
+ for (int c = 0; c < MAX_CASCADE_NUM; c++) {
csm_data->split_start[c] = csm_end;
csm_data->split_end[c] = csm_end;
}
@@ -252,7 +252,7 @@ static void eevee_shadow_cascade_setup(EEVEE_LightsInfo *linfo,
csm_data->split_start[0] = csm_start;
csm_data->split_end[cascade_nbr - 1] = csm_end;
- for (int c = 1; c < cascade_nbr; ++c) {
+ for (int c = 1; c < cascade_nbr; c++) {
/* View Space */
float linear_split = lerp(((float)(c) / (float)cascade_nbr), csm_start, csm_end);
float exp_split = csm_start * powf(csm_end / csm_start, (float)(c) / (float)cascade_nbr);
@@ -301,7 +301,7 @@ static void eevee_shadow_cascade_setup(EEVEE_LightsInfo *linfo,
csm_data->split_start[0] = lerp(cascade_fade, csm_data->split_end[cascade_nbr - 1], prev_split);
/* For each cascade */
- for (int c = 0; c < cascade_nbr; ++c) {
+ for (int c = 0; c < cascade_nbr; c++) {
float(*projmat)[4] = csm_render->projmat[c];
/* Given 8 frustum corners */
float corners[8][3] = {
@@ -318,7 +318,7 @@ static void eevee_shadow_cascade_setup(EEVEE_LightsInfo *linfo,
};
/* Transform them into world space */
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
mul_project_m4_v3(persinv, corners[i]);
}
diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
index 96924efa8bc..e5f89aab4d1 100644
--- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
+++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c
@@ -63,7 +63,7 @@ static void compute_cdf(float (*func)(float x), float cdf[FILTER_CDF_TABLE_SIZE]
{
cdf[0] = 0.0f;
/* Actual CDF evaluation. */
- for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; ++u) {
+ for (int u = 0; u < FILTER_CDF_TABLE_SIZE - 1; u++) {
float x = (float)(u + 1) / (float)(FILTER_CDF_TABLE_SIZE - 1);
cdf[u + 1] = cdf[u] + func(x - 0.5f); /* [-0.5..0.5]. We resize later. */
}
@@ -80,7 +80,7 @@ static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE],
{
for (int u = 0; u < FILTER_CDF_TABLE_SIZE; u++) {
float x = (float)u / (float)(FILTER_CDF_TABLE_SIZE - 1);
- for (int i = 0; i < FILTER_CDF_TABLE_SIZE; ++i) {
+ for (int i = 0; i < FILTER_CDF_TABLE_SIZE; i++) {
if (cdf[i] >= x) {
if (i == FILTER_CDF_TABLE_SIZE - 1) {
invert_cdf[u] = 1.0f;
@@ -123,7 +123,7 @@ static void eevee_create_cdf_table_temporal_sampling(void)
invert_cdf(cdf_table, e_data.inverted_cdf);
/* Scale and offset table. */
- for (int i = 0; i < FILTER_CDF_TABLE_SIZE; ++i) {
+ for (int i = 0; i < FILTER_CDF_TABLE_SIZE; i++) {
e_data.inverted_cdf[i] = (e_data.inverted_cdf[i] - 0.5f) * filter_width;
}
diff --git a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
index 44f22848c2f..598cc3e5183 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_ssr_frag.glsl
@@ -147,7 +147,7 @@ void main()
make_orthonormal_basis(N, T, B); /* Generate tangent space */
/* Planar Reflections */
- for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar; ++i) {
+ for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar; i++) {
PlanarData pd = planars_data[i];
float fade = probe_attenuation_planar(pd, worldPosition, wN, 0.0);
@@ -504,7 +504,7 @@ void main()
/* Find Planar Reflections affecting this pixel */
PlanarData pd;
float planar_index;
- for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar; ++i) {
+ for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar; i++) {
pd = planars_data[i];
float fade = probe_attenuation_planar(pd, worldPosition, N, 0.0);
diff --git a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
index 7edb0053da7..86f53522bc6 100644
--- a/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/effect_translucency_frag.glsl
@@ -141,7 +141,7 @@ void main(void)
rand.xy *= fast_sqrt(rand.z);
vec3 accum = vec3(0.0);
- for (int i = 0; i < MAX_LIGHT && i < laNumLight; ++i) {
+ for (int i = 0; i < MAX_LIGHT && i < laNumLight; i++) {
LightData ld = lights_data[i];
/* Only shadowed light can produce translucency */
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
index 37b02a2130f..296c1581545 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_filter_diffuse_frag.glsl
@@ -64,7 +64,7 @@ void main()
float weight_accum = 0.0;
vec3 sh = vec3(0.0);
- for (int face = 0; face < 6; ++face) {
+ for (int face = 0; face < 6; face++) {
for (float x = halfpix; x < 1.0; x += pixstep) {
for (float y = halfpix; y < 1.0; y += pixstep) {
float weight, coef;
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl
index e10cb5f4999..f8bc1703c66 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_geom.glsl
@@ -37,7 +37,7 @@ void main()
fFace = face[0];
gl_Layer = Layer + fFace;
- for (int v = 0; v < 3; ++v) {
+ for (int v = 0; v < 3; v++) {
gl_Position = vPos[v];
worldPosition = x_axis[fFace] * vPos[v].x + y_axis[fFace] * vPos[v].y + maj_axes[fFace];
#ifdef USE_ATTR
diff --git a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
index 56c05e3c036..ab205b78274 100644
--- a/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lightprobe_lib.glsl
@@ -233,7 +233,7 @@ void fallback_cubemap(vec3 N,
#endif
/* Starts at 1 because 0 is world probe */
- for (int i = 1; i < MAX_PROBE && i < prbNumRenderCube && spec_accum.a < 0.999; ++i) {
+ for (int i = 1; i < MAX_PROBE && i < prbNumRenderCube && spec_accum.a < 0.999; i++) {
float fade = probe_attenuation_cube(i, W);
if (fade > 0.0) {
@@ -262,7 +262,7 @@ vec3 probe_evaluate_grid(GridData gd, vec3 W, vec3 N, vec3 localpos)
vec3 irradiance_accum = vec3(0.0);
/* For each neighbor cells */
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
ivec3 offset = ivec3(i, i >> 1, i >> 2) & ivec3(1);
vec3 cell_cos = clamp(localpos_floored + vec3(offset), vec3(0.0), vec3(gd.g_resolution) - 1.0);
diff --git a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
index f55b42eb148..3774054659d 100644
--- a/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/lit_surface_frag.glsl
@@ -234,7 +234,7 @@ void CLOSURE_NAME(vec3 N
vec3 true_normal = normalize(cross(dFdx(viewPosition), dFdy(viewPosition)));
- for (int i = 0; i < MAX_LIGHT && i < laNumLight; ++i) {
+ for (int i = 0; i < MAX_LIGHT && i < laNumLight; i++) {
LightData ld = lights_data[i];
vec4 l_vector; /* Non-Normalized Light Vector with length in last component. */
@@ -304,7 +304,7 @@ void CLOSURE_NAME(vec3 N
/* Planar Reflections */
/* ---------------------------- */
- for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar && spec_accum.a < 0.999; ++i) {
+ for (int i = 0; i < MAX_PLANAR && i < prbNumPlanar && spec_accum.a < 0.999; i++) {
PlanarData pd = planars_data[i];
/* Fade on geometric normal. */
@@ -380,7 +380,7 @@ void CLOSURE_NAME(vec3 N
# endif
/* Starts at 1 because 0 is world probe */
- for (int i = 1; ACCUM < 0.999 && i < prbNumRenderCube && i < MAX_PROBE; ++i) {
+ for (int i = 1; ACCUM < 0.999 && i < prbNumRenderCube && i < MAX_PROBE; i++) {
float fade = probe_attenuation_cube(i, worldPosition);
if (fade > 0.0) {
@@ -515,7 +515,7 @@ void CLOSURE_NAME(vec3 N
/* Irradiance Grids */
/* ---------------------------- */
/* Start at 1 because 0 is world irradiance */
- for (int i = 1; i < MAX_GRID && i < prbNumRenderGrid && diff_accum.a < 0.999; ++i) {
+ for (int i = 1; i < MAX_GRID && i < prbNumRenderGrid && diff_accum.a < 0.999; i++) {
GridData gd = grids_data[i];
vec3 localpos;
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
index acd1e58ff97..1ae6a258d3d 100644
--- a/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/volumetric_integration_frag.glsl
@@ -39,7 +39,7 @@ void main()
/* Without compute shader and arbitrary write we need to
* accumulate from the beginning of the ray for each cell. */
float integration_end = float(slice);
- for (int i = 0; i < slice; ++i) {
+ for (int i = 0; i < slice; i++) {
ivec3 volume_cell = ivec3(gl_FragCoord.xy, i);
vec3 Lscat = texelFetch(volumeScattering, volume_cell, 0).rgb;
diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl
index d345cd5c808..9621fa1cc0d 100644
--- a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl
+++ b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl
@@ -38,7 +38,7 @@ void main()
phase_function_isotropic();
#ifdef VOLUME_LIGHTING /* Lights */
- for (int i = 0; i < MAX_LIGHT && i < laNumLight; ++i) {
+ for (int i = 0; i < MAX_LIGHT && i < laNumLight; i++) {
LightData ld = lights_data[i];
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
index 0428b0d408c..bd16189db32 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_effect_dof_frag.glsl
@@ -256,7 +256,7 @@ void main()
float coc = decode_coc(texelFetch(inputCocTex, texel, 0).rg);
float max_radius = coc;
vec2 noise = get_random_vector(noiseOffset) * 0.2 * clamp(max_radius * 0.2 - 4.0, 0.0, 1.0);
- for (int i = 0; i < NUM_SAMPLES; ++i) {
+ for (int i = 0; i < NUM_SAMPLES; i++) {
vec2 tc = uv + (noise + samples[i].xy) * invertedViewportSize * max_radius;
/* decode_signed_coc return biggest coc. */
@@ -359,8 +359,8 @@ void main()
vec v[9];
/* Add the pixels which make up our window to the pixel array. */
- for (int dX = -1; dX <= 1; ++dX) {
- for (int dY = -1; dY <= 1; ++dY) {
+ for (int dX = -1; dX <= 1; dX++) {
+ for (int dY = -1; dY <= 1; dY++) {
vec2 offset = vec2(float(dX), float(dY));
/* If a pixel in the window is located at (x+dX, y+dY), put it at index (dX + R)(2R + 1) +
* (dY + R) of the pixel array. This will fill the pixel array, with the top left pixel of
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
index fd06c85747f..4a9b0ae3b7d 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_frag.glsl
@@ -172,7 +172,7 @@ vec4 volume_integration(vec3 ray_ori, vec3 ray_dir, float ray_inc, float ray_max
float noise = fract(dither_mat[tx.x][tx.y] + noiseOfs);
float ray_len = noise * ray_inc;
- for (int i = 0; i < samplesLen && ray_len < ray_max; ++i, ray_len += ray_inc) {
+ for (int i = 0; i < samplesLen && ray_len < ray_max; i++, ray_len += ray_inc) {
vec3 ls_pos = ray_ori + ray_dir * ray_len;
vec3 Lscat;
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c
index c1c9d8b5a96..262ea7110a4 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -652,7 +652,7 @@ void workbench_deferred_engine_free(void)
for (int index = 0; index < MAX_COMPOSITE_SHADERS; index++) {
DRW_SHADER_FREE_SAFE(e_data.composite_sh_cache[index]);
}
- for (int index = 0; index < MAX_CAVITY_SHADERS; ++index) {
+ for (int index = 0; index < MAX_CAVITY_SHADERS; index++) {
DRW_SHADER_FREE_SAFE(e_data.cavity_sh[index]);
}
DRW_SHADER_FREE_SAFE(e_data.ghost_resolve_sh);
@@ -1105,7 +1105,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
if (use_sculpt_pbvh) {
struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len);
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
struct Material *mat = give_current_material(ob, i + 1);
if (mat != NULL && mat->a < 1.0f) {
material = workbench_forward_get_or_create_material_data(
@@ -1127,7 +1127,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
geoms = DRW_cache_object_surface_material_get(
ob, gpumat_array, materials_len, NULL, NULL, NULL);
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
if (geoms != NULL && geoms[i] != NULL) {
Material *mat = give_current_material(ob, i + 1);
if (mat != NULL && mat->a < 1.0f) {
diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c
index 22840a2a756..169b91a6474 100644
--- a/source/blender/draw/engines/workbench/workbench_effect_dof.c
+++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c
@@ -94,9 +94,9 @@ static void workbench_dof_setup_samples(struct GPUUniformBuffer **ubo,
}
float *samp = *data;
- for (int i = 0; i <= KERNEL_RAD; ++i) {
- for (int j = -KERNEL_RAD; j <= KERNEL_RAD; ++j) {
- for (int k = -KERNEL_RAD; k <= KERNEL_RAD; ++k) {
+ for (int i = 0; i <= KERNEL_RAD; i++) {
+ for (int j = -KERNEL_RAD; j <= KERNEL_RAD; j++) {
+ for (int k = -KERNEL_RAD; k <= KERNEL_RAD; k++) {
if (abs(j) > i || abs(k) > i) {
continue;
}
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 824c6e7bd76..1cbc60ef858 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -701,7 +701,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
if (use_sculpt_pbvh) {
struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len);
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
struct Material *mat = give_current_material(ob, i + 1);
material = workbench_forward_get_or_create_material_data(
vedata, ob, mat, NULL, NULL, V3D_SHADING_MATERIAL_COLOR, 0);
@@ -720,7 +720,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
struct GPUBatch **mat_geom = DRW_cache_object_surface_material_get(
ob, gpumat_array, materials_len, NULL, NULL, NULL);
if (mat_geom) {
- for (int i = 0; i < materials_len; ++i) {
+ for (int i = 0; i < materials_len; i++) {
if (mat_geom[i] == NULL) {
continue;
}
diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c
index 1a09498b228..fed6ca680a7 100644
--- a/source/blender/draw/engines/workbench/workbench_studiolight.c
+++ b/source/blender/draw/engines/workbench/workbench_studiolight.c
@@ -77,7 +77,7 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd,
/* Use Geomerics non-linear SH. */
mul_v3_v3fl(wd->spherical_harmonics_coefs[0], sl->spherical_harmonics_coefs[0], M_1_PI);
/* Swizzle to make shader code simpler. */
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
copy_v3_fl3(wd->spherical_harmonics_coefs[i + 1],
-sl->spherical_harmonics_coefs[3][i],
sl->spherical_harmonics_coefs[2][i],
@@ -89,7 +89,7 @@ void studiolight_update_world(WORKBENCH_PrivateData *wpd,
/* Precompute as much as we can. See shader code for derivation. */
float len_r1[3], lr1_r0[3], p[3], a[3];
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 0.5f);
len_r1[i] = len_v3(wd->spherical_harmonics_coefs[i + 1]);
mul_v3_fl(wd->spherical_harmonics_coefs[i + 1], 1.0f / len_r1[i]);
@@ -179,7 +179,7 @@ void studiolight_update_light(WORKBENCH_PrivateData *wpd, const float light_dire
mul_v3_mat3_m4v3(wpd->shadow_near_corners[3], wpd->shadow_inv, frustum_corners.vec[4]);
INIT_MINMAX(wpd->shadow_near_min, wpd->shadow_near_max);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
minmax_v3v3_v3(wpd->shadow_near_min, wpd->shadow_near_max, wpd->shadow_near_corners[i]);
}
@@ -206,7 +206,7 @@ static BoundBox *studiolight_object_shadow_bbox_get(WORKBENCH_PrivateData *wpd,
/* From object space to shadow space */
BoundBox *bbox = BKE_object_boundbox_get(ob);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
float corner[3];
mul_v3_m4v3(corner, tmp_mat, bbox->vec[i]);
minmax_v3v3_v3(oed->shadow_min, oed->shadow_max, corner);
@@ -217,7 +217,7 @@ static BoundBox *studiolight_object_shadow_bbox_get(WORKBENCH_PrivateData *wpd,
/* Get extended AABB in world space. */
BKE_boundbox_init_from_minmax(&oed->shadow_bbox, oed->shadow_min, oed->shadow_max);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
mul_m4_v3(wpd->shadow_mat, oed->shadow_bbox.vec[i]);
}
oed->shadow_bbox_dirty = false;
@@ -243,7 +243,7 @@ float studiolight_object_shadow_distance(WORKBENCH_PrivateData *wpd,
int corners[4] = {0, 3, 4, 7};
float dist = 1e4f, dist_isect;
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
if (isect_ray_plane_v3(shadow_bbox->vec[corners[i]],
wpd->cached_shadow_direction,
wpd->shadow_far_plane,
@@ -291,9 +291,9 @@ bool studiolight_camera_in_object_shadow(WORKBENCH_PrivateData *wpd,
{oed->shadow_max[0], oed->shadow_max[1]},
};
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
float min_dst = FLT_MAX, max_dst = -FLT_MAX;
- for (int j = 0; j < 4; ++j) {
+ for (int j = 0; j < 4; j++) {
float dst = dot_v2v2(wpd->shadow_near_sides[i], pts[j]);
/* Do min max */
if (min_dst > dst) {
diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c
index 1beb02ea3a0..7ae9d90daff 100644
--- a/source/blender/draw/engines/workbench/workbench_volume.c
+++ b/source/blender/draw/engines/workbench/workbench_volume.c
@@ -101,7 +101,7 @@ void workbench_volume_engine_init(void)
void workbench_volume_engine_free(void)
{
- for (int i = 0; i < VOLUME_SH_MAX; ++i) {
+ for (int i = 0; i < VOLUME_SH_MAX; i++) {
DRW_SHADER_FREE_SAFE(e_data.volume_sh[i]);
}
DRW_TEXTURE_FREE_SAFE(e_data.dummy_tex);
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index 520932bc429..54c78fd583b 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -296,15 +296,15 @@ static GPUVertBuf *sphere_wire_vbo(const float rad)
/* a single ring of vertices */
float p[NSEGMENTS][2];
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = rad * cosf(angle);
p[i][1] = rad * sinf(angle);
}
- for (int axis = 0; axis < 3; ++axis) {
- for (int i = 0; i < NSEGMENTS; ++i) {
- for (int j = 0; j < 2; ++j) {
+ for (int axis = 0; axis < 3; axis++) {
+ for (int i = 0; i < NSEGMENTS; i++) {
+ for (int j = 0; j < 2; j++) {
float cv[2], v[3];
cv[0] = p[(i + j) % NSEGMENTS][0];
@@ -352,7 +352,7 @@ GPUBatch *DRW_cache_fullscreen_quad_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, 3);
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
}
@@ -382,7 +382,7 @@ GPUBatch *DRW_cache_quad_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, 4);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, i, pos[i]);
GPU_vertbuf_attr_set(vbo, attr_id.uvs, i, uvs[i]);
}
@@ -437,8 +437,8 @@ GPUBatch *DRW_cache_grid_get(void)
GPU_vertbuf_data_alloc(vbo, 8 * 8 * 2 * 3);
uint v_idx = 0;
- for (int i = 0; i < 8; ++i) {
- for (int j = 0; j < 8; ++j) {
+ for (int i = 0; i < 8; i++) {
+ for (int j = 0; j < 8; j++) {
float pos0[2] = {(float)i / 8.0f, (float)j / 8.0f};
float pos1[2] = {(float)(i + 1) / 8.0f, (float)j / 8.0f};
float pos2[2] = {(float)i / 8.0f, (float)(j + 1) / 8.0f};
@@ -510,7 +510,7 @@ GPUBatch *DRW_cache_cube_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, 36);
- for (int i = 0; i < 36; ++i) {
+ for (int i = 0; i < 36; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
}
@@ -549,7 +549,7 @@ GPUBatch *DRW_cache_empty_cube_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, 24);
- for (int i = 0; i < 24; ++i) {
+ for (int i = 0; i < 24; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, i, verts[indices[i]]);
}
@@ -751,7 +751,7 @@ GPUBatch *DRW_cache_gpencil_axes_get(void)
}
/* draw cube */
- for (int i = 0; i < 24; ++i) {
+ for (int i = 0; i < 24; i++) {
GPU_vertbuf_attr_set(vbo, pos_id, i + 6, verts[indices[i]]);
}
@@ -982,7 +982,7 @@ GPUBatch *DRW_cache_empty_cone_get(void)
if (!SHC.drw_empty_cone) {
/* a single ring of vertices */
float p[NSEGMENTS][2];
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = cosf(angle);
p[i][1] = sinf(angle);
@@ -1000,7 +1000,7 @@ GPUBatch *DRW_cache_empty_cone_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float cv[2], v[3];
cv[0] = p[(i) % NSEGMENTS][0];
cv[1] = p[(i) % NSEGMENTS][1];
@@ -1032,7 +1032,7 @@ GPUBatch *DRW_cache_empty_cylinder_get(void)
if (!SHC.drw_empty_cylinder) {
/* a single ring of vertices */
float p[NSEGMENTS][2];
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = cosf(angle);
p[i][1] = sinf(angle);
@@ -1050,7 +1050,7 @@ GPUBatch *DRW_cache_empty_cylinder_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 6);
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float cv[2], pv[2], v[3];
cv[0] = p[(i) % NSEGMENTS][0];
cv[1] = p[(i) % NSEGMENTS][1];
@@ -1121,7 +1121,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void)
if (!SHC.drw_empty_capsule_cap) {
/* a single ring of vertices */
float p[NSEGMENTS][2];
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = cosf(angle);
p[i][1] = sinf(angle);
@@ -1141,7 +1141,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void)
/* Base circle */
int vidx = 0;
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float v[3] = {0.0f, 0.0f, 0.0f};
copy_v2_v2(v, p[(i) % NSEGMENTS]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
@@ -1149,7 +1149,7 @@ GPUBatch *DRW_cache_empty_capsule_cap_get(void)
GPU_vertbuf_attr_set(vbo, attr_id.pos, vidx++, v);
}
- for (int i = 0; i < NSEGMENTS / 2; ++i) {
+ for (int i = 0; i < NSEGMENTS / 2; i++) {
float v[3] = {0.0f, 0.0f, 0.0f};
int ci = i % NSEGMENTS;
int pi = (i + 1) % NSEGMENTS;
@@ -1690,7 +1690,7 @@ GPUBatch *DRW_cache_light_spot_get(void)
float n[NSEGMENTS][3];
float neg[NSEGMENTS][3];
float half_angle = 2 * M_PI / ((float)NSEGMENTS * 2);
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = cosf(angle);
p[i][1] = sinf(angle);
@@ -1715,7 +1715,7 @@ GPUBatch *DRW_cache_light_spot_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 4);
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float cv[2], v[3];
cv[0] = p[i % NSEGMENTS][0];
cv[1] = p[i % NSEGMENTS][1];
@@ -1757,7 +1757,7 @@ GPUBatch *DRW_cache_light_spot_volume_get(void)
if (!SHC.drw_light_spot_volume) {
/* a single ring of vertices */
float p[NSEGMENTS][2];
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float angle = 2 * M_PI * ((float)i / (float)NSEGMENTS);
p[i][0] = cosf(angle);
p[i][1] = sinf(angle);
@@ -1775,7 +1775,7 @@ GPUBatch *DRW_cache_light_spot_volume_get(void)
GPU_vertbuf_data_alloc(vbo, NSEGMENTS * 3);
uint v_idx = 0;
- for (int i = 0; i < NSEGMENTS; ++i) {
+ for (int i = 0; i < NSEGMENTS; i++) {
float cv[2], v[3];
ARRAY_SET_ITEMS(v, 0.0f, 0.0f, 0.0f);
@@ -1824,7 +1824,7 @@ GPUBatch *DRW_cache_light_spot_square_get(void)
GPU_vertbuf_data_alloc(vbo, 16);
/* piramid sides */
- for (int i = 1; i <= 4; ++i) {
+ for (int i = 1; i <= 4; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[i]);
@@ -1863,7 +1863,7 @@ GPUBatch *DRW_cache_light_spot_square_volume_get(void)
GPU_vertbuf_data_alloc(vbo, 12);
/* piramid sides */
- for (int i = 1; i <= 4; ++i) {
+ for (int i = 1; i <= 4; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[0]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[((i + 1) % 4) + 1]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, p[(i % 4) + 1]);
@@ -1974,7 +1974,7 @@ GPUBatch *DRW_cache_lightprobe_cube_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, (6 + 3) * 2);
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 6]);
}
@@ -2021,7 +2021,7 @@ GPUBatch *DRW_cache_lightprobe_grid_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, (6 * 2 + 3) * 2);
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
float tmp_v1[3], tmp_v2[3], tmp_tr[3];
copy_v3_v3(tmp_v1, v[i]);
copy_v3_v3(tmp_v2, v[(i + 1) % 6]);
@@ -2029,7 +2029,7 @@ GPUBatch *DRW_cache_lightprobe_grid_get(void)
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, tmp_v2);
/* Internal wires. */
- for (int j = 1; j < 2; ++j) {
+ for (int j = 1; j < 2; j++) {
mul_v3_v3fl(tmp_tr, v[(i / 2) * 2 + 1], -0.5f * j);
add_v3_v3v3(tmp_v1, v[i], tmp_tr);
add_v3_v3v3(tmp_v2, v[(i + 1) % 6], tmp_tr);
@@ -2076,7 +2076,7 @@ GPUBatch *DRW_cache_lightprobe_planar_get(void)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, 4 * 2);
- for (int i = 0; i < 4; ++i) {
+ for (int i = 0; i < 4; i++) {
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[i]);
GPU_vertbuf_attr_set(vbo, attr_id.pos, v_idx++, v[(i + 1) % 4]);
}
@@ -2214,7 +2214,7 @@ GPUBatch *DRW_cache_bone_octahedral_get(void)
GPU_vertbuf_data_alloc(vbo, 24);
for (int i = 0; i < 8; i++) {
- for (int j = 0; j < 3; ++j) {
+ for (int j = 0; j < 3; j++) {
GPU_vertbuf_attr_set(vbo, attr_id.nor, v_idx, bone_octahedral_solid_normals[i]);
GPU_vertbuf_attr_set(vbo,
attr_id.snor,
@@ -2710,7 +2710,7 @@ GPUBatch *DRW_cache_bone_stick_get(void)
GPU_indexbuf_init_ex(&elb, GPU_PRIM_TRI_FAN, (CIRCLE_RESOL + 2) * 2 + 6 + 2, vcount);
/* head/tail points */
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
/* center vertex */
copy_v2_fl(pos, 0.0f);
flag = (i == 0) ? POS_HEAD : POS_TAIL;
@@ -2735,7 +2735,7 @@ GPUBatch *DRW_cache_bone_stick_get(void)
/* Bone rectangle */
pos[0] = 0.0f;
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
pos[1] = (i == 0 || i == 3) ? 0.0f : ((i < 3) ? 1.0f : -1.0f);
flag = ((i < 2 || i > 4) ? POS_HEAD : POS_TAIL) | ((i == 0 || i == 3) ? 0 : COL_WIRE) |
COL_BONE | POS_BONE;
@@ -2896,8 +2896,8 @@ GPUBatch *DRW_cache_bone_arrows_get(void)
set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, pos, c);
/* Axis end marker */
- for (int j = 1; j < MARKER_FILL_LAYER + 1; ++j) {
- for (int i = 0; i < MARKER_LEN; ++i) {
+ for (int j = 1; j < MARKER_FILL_LAYER + 1; j++) {
+ for (int i = 0; i < MARKER_LEN; i++) {
float tmp[2];
mul_v2_v2fl(tmp, axis_marker[i], j / (float)MARKER_FILL_LAYER);
set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, tmp, c);
@@ -2924,8 +2924,8 @@ GPUBatch *DRW_cache_bone_arrows_get(void)
/* Axis name shadows */
copy_v3_fl(c, 0.0f);
c[axis] = 0.3f;
- for (int j = 0; j < SHADOW_RES; ++j) {
- for (int i = 0; i < axis_v_len; ++i) {
+ for (int j = 0; j < SHADOW_RES; j++) {
+ for (int i = 0; i < axis_v_len; i++) {
float tmp[2];
add_v2_v2v2(tmp, axis_verts[i], axis_name_shadow[j]);
set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, tmp, c);
@@ -2935,7 +2935,7 @@ GPUBatch *DRW_cache_bone_arrows_get(void)
/* Axis name */
copy_v3_fl(c, 0.1f);
c[axis] = 1.0f;
- for (int i = 0; i < axis_v_len; ++i) {
+ for (int i = 0; i < axis_v_len; i++) {
set_bone_axis_vert(vbo, attr_id.axis, attr_id.pos, attr_id.col, &v, &a, axis_verts[i], c);
}
}
@@ -2990,12 +2990,12 @@ GPUBatch *DRW_cache_bone_dof_sphere_get(void)
GPU_vertbuf_data_alloc(vbo, n * n * 6 * 4);
uint v = 0;
- for (q = 0; q < 4; ++q) {
+ for (q = 0; q < 4; q++) {
pz = 0.0f;
- for (i = 1; i < n; ++i) {
+ for (i = 1; i < n; i++) {
z = staticSine[i];
px = 0.0f;
- for (j = 1; j <= (n - i); ++j) {
+ for (j = 1; j <= (n - i); j++) {
x = staticSine[j];
if (j == n - i) {
set_vert(px, z, q);
@@ -3937,7 +3937,7 @@ GPUBatch *DRW_cache_cursor_get(bool crosshair_lines)
GPU_vertbuf_data_alloc(vbo, vert_len);
int v = 0;
- for (int i = 0; i < segments; ++i) {
+ for (int i = 0; i < segments; i++) {
float angle = (float)(2 * M_PI) * ((float)i / (float)segments);
float x = f10 * cosf(angle);
float y = f10 * sinf(angle);
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c
index 2518cfb399d..48c28496584 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.c
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.c
@@ -523,7 +523,7 @@ static void extract_tris_finish(const MeshRenderData *mr, void *ibo, void *_data
/* HACK Create ibo subranges and assign them to each GPUBatch. */
if (mr->use_final_mesh && mr->cache->surface_per_mat && mr->cache->surface_per_mat[0]) {
BLI_assert(mr->cache->surface_per_mat[0]->elem == ibo);
- for (int i = 0; i < mr->mat_len; ++i) {
+ for (int i = 0; i < mr->mat_len; i++) {
/* Multiply by 3 because these are triangle indices. */
int start = data->tri_mat_start[i] * 3;
int len = data->tri_mat_end[i] * 3 - data->tri_mat_start[i] * 3;
diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c
index 241cd68bc3a..c0cbe3266cb 100644
--- a/source/blender/draw/intern/draw_cache_impl_curve.c
+++ b/source/blender/draw/intern/draw_cache_impl_curve.c
@@ -464,7 +464,7 @@ static void curve_batch_cache_init(Curve *cu)
cache->surf_per_mat = MEM_mallocN(sizeof(*cache->surf_per_mat) * cache->mat_len, __func__);
/* TODO Might be wiser to alloc in one chunk. */
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
cache->surf_per_mat_tris[i] = MEM_callocN(sizeof(GPUIndexBuf), "GPUIndexBuf");
cache->surf_per_mat[i] = MEM_callocN(sizeof(GPUBatch), "GPUBatch");
}
@@ -516,24 +516,24 @@ static void curve_batch_cache_clear(Curve *cu)
return;
}
- for (int i = 0; i < sizeof(cache->ordered) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->ordered) / sizeof(void *); i++) {
GPUVertBuf **vbo = (GPUVertBuf **)&cache->ordered;
GPU_VERTBUF_DISCARD_SAFE(vbo[i]);
}
- for (int i = 0; i < sizeof(cache->edit) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->edit) / sizeof(void *); i++) {
GPUVertBuf **vbo = (GPUVertBuf **)&cache->edit;
GPU_VERTBUF_DISCARD_SAFE(vbo[i]);
}
- for (int i = 0; i < sizeof(cache->ibo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->ibo) / sizeof(void *); i++) {
GPUIndexBuf **ibo = (GPUIndexBuf **)&cache->ibo;
GPU_INDEXBUF_DISCARD_SAFE(ibo[i]);
}
- for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) {
GPUBatch **batch = (GPUBatch **)&cache->batch;
GPU_BATCH_DISCARD_SAFE(batch[i]);
}
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
GPU_INDEXBUF_DISCARD_SAFE(cache->surf_per_mat_tris[i]);
GPU_BATCH_DISCARD_SAFE(cache->surf_per_mat[i]);
}
@@ -891,7 +891,7 @@ GPUBatch **DRW_curve_batch_cache_get_surface_shaded(struct Curve *cu,
curve_cd_calc_used_gpu_layers(&cache->cd_needed, gpumat_array, gpumat_array_len);
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
DRW_batch_request(&cache->surf_per_mat[i]);
}
return cache->surf_per_mat;
@@ -929,7 +929,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob)
/* Verify that all surface batches have needed attribute layers. */
/* TODO(fclem): We could be a bit smarter here and only do it per material. */
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
if ((cache->cd_used & cache->cd_needed) != cache->cd_needed) {
/* We can't discard batches at this point as they have been
* referenced for drawing. Just clear them in place. */
@@ -979,7 +979,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob)
if (DRW_batch_requested(cache->batch.edit_normals, GPU_PRIM_LINES)) {
DRW_vbo_request(cache->batch.edit_normals, &cache->edit.curves_nor);
}
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
if (DRW_batch_requested(cache->surf_per_mat[i], GPU_PRIM_TRIS)) {
if (cache->mat_len > 1) {
DRW_ibo_request(cache->surf_per_mat[i], &cache->surf_per_mat_tris[i]);
@@ -1014,7 +1014,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob)
DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->ibo.edit_verts_points, CU_DATATYPE_OVERLAY);
DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->ibo.edit_lines, CU_DATATYPE_OVERLAY);
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
DRW_ADD_FLAG_FROM_IBO_REQUEST(mr_flag, cache->surf_per_mat_tris[i], CU_DATATYPE_SURFACE);
}
@@ -1080,7 +1080,7 @@ void DRW_curve_batch_cache_create_requested(Object *ob)
#ifdef DEBUG
/* Make sure all requested batches have been setup. */
- for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) {
BLI_assert(!DRW_batch_requested(((GPUBatch **)&cache->batch)[i], 0));
}
#endif
diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c
index 8b3864684b5..01cd2b52ae3 100644
--- a/source/blender/draw/intern/draw_cache_impl_lattice.c
+++ b/source/blender/draw/intern/draw_cache_impl_lattice.c
@@ -420,7 +420,7 @@ static GPUVertBuf *lattice_batch_cache_get_pos(LatticeRenderData *rdata,
cache->pos = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(cache->pos, vert_len);
- for (int i = 0; i < vert_len; ++i) {
+ for (int i = 0; i < vert_len; i++) {
const BPoint *bp = lattice_render_data_vert_bpoint(rdata, i);
GPU_vertbuf_attr_set(cache->pos, attr_id.pos, i, bp->vec);
@@ -516,7 +516,7 @@ static void lattice_batch_cache_create_overlay_batches(Lattice *lt)
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(&format);
GPU_vertbuf_data_alloc(vbo, vert_len);
- for (int i = 0; i < vert_len; ++i) {
+ for (int i = 0; i < vert_len; i++) {
const BPoint *bp = lattice_render_data_vert_bpoint(rdata, i);
char vflag = 0;
diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.c b/source/blender/draw/intern/draw_cache_impl_mesh.c
index 96c677dc184..f0afbe2afe5 100644
--- a/source/blender/draw/intern/draw_cache_impl_mesh.c
+++ b/source/blender/draw/intern/draw_cache_impl_mesh.c
@@ -603,14 +603,14 @@ static void mesh_batch_cache_clear(Mesh *me)
{
GPUVertBuf **vbos = (GPUVertBuf **)&mbufcache->vbo;
GPUIndexBuf **ibos = (GPUIndexBuf **)&mbufcache->ibo;
- for (int i = 0; i < sizeof(mbufcache->vbo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(mbufcache->vbo) / sizeof(void *); i++) {
GPU_VERTBUF_DISCARD_SAFE(vbos[i]);
}
- for (int i = 0; i < sizeof(mbufcache->ibo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(mbufcache->ibo) / sizeof(void *); i++) {
GPU_INDEXBUF_DISCARD_SAFE(ibos[i]);
}
}
- for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) {
GPUBatch **batch = (GPUBatch **)&cache->batch;
GPU_BATCH_DISCARD_SAFE(batch[i]);
}
@@ -756,7 +756,7 @@ GPUBatch **DRW_mesh_batch_cache_get_surface_shaded(Mesh *me,
*auto_layer_is_srgb = cache->auto_layer_is_srgb;
*auto_layer_count = cache->auto_layer_len;
}
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
DRW_batch_request(&cache->surface_per_mat[i]);
}
return cache->surface_per_mat;
@@ -767,7 +767,7 @@ GPUBatch **DRW_mesh_batch_cache_get_surface_texpaint(Mesh *me)
MeshBatchCache *cache = mesh_batch_cache_get(me);
mesh_batch_cache_add_request(cache, MBC_SURF_PER_MAT);
texpaint_request_active_uv(cache, me);
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
DRW_batch_request(&cache->surface_per_mat[i]);
}
return cache->surface_per_mat;
@@ -1054,7 +1054,7 @@ void DRW_mesh_batch_cache_create_requested(
* This is only if the cd_needed changes so it is ok to keep them.*/
if (cache->surface_per_mat[0] && cache->surface_per_mat[0]->elem) {
saved_elem_ranges = MEM_callocN(sizeof(saved_elem_ranges) * cache->mat_len, __func__);
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
saved_elem_ranges[i] = cache->surface_per_mat[i]->elem;
/* Avoid deletion as the batch is owner. */
cache->surface_per_mat[i]->elem = NULL;
@@ -1063,7 +1063,7 @@ void DRW_mesh_batch_cache_create_requested(
}
/* We can't discard batches at this point as they have been
* referenced for drawing. Just clear them in place. */
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
GPU_BATCH_CLEAR_SAFE(cache->surface_per_mat[i]);
}
GPU_BATCH_CLEAR_SAFE(cache->batch.surface);
@@ -1181,7 +1181,7 @@ void DRW_mesh_batch_cache_create_requested(
}
/* Per Material */
- for (int i = 0; i < cache->mat_len; ++i) {
+ for (int i = 0; i < cache->mat_len; i++) {
if (DRW_batch_requested(cache->surface_per_mat[i], GPU_PRIM_TRIS)) {
if (saved_elem_ranges && saved_elem_ranges[i]) {
/* XXX assign old element buffer range (it did not change).*/
@@ -1325,25 +1325,25 @@ void DRW_mesh_batch_cache_create_requested(
#ifdef DEBUG
check:
/* Make sure all requested batches have been setup. */
- for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->batch) / sizeof(void *); i++) {
BLI_assert(!DRW_batch_requested(((GPUBatch **)&cache->batch)[i], 0));
}
- for (int i = 0; i < sizeof(cache->final.vbo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->final.vbo) / sizeof(void *); i++) {
BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->final.vbo)[i]));
}
- for (int i = 0; i < sizeof(cache->final.ibo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->final.ibo) / sizeof(void *); i++) {
BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->final.ibo)[i]));
}
- for (int i = 0; i < sizeof(cache->cage.vbo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->cage.vbo) / sizeof(void *); i++) {
BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->cage.vbo)[i]));
}
- for (int i = 0; i < sizeof(cache->cage.ibo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->cage.ibo) / sizeof(void *); i++) {
BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->cage.ibo)[i]));
}
- for (int i = 0; i < sizeof(cache->uv_cage.vbo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->uv_cage.vbo) / sizeof(void *); i++) {
BLI_assert(!DRW_vbo_requested(((GPUVertBuf **)&cache->uv_cage.vbo)[i]));
}
- for (int i = 0; i < sizeof(cache->uv_cage.ibo) / sizeof(void *); ++i) {
+ for (int i = 0; i < sizeof(cache->uv_cage.ibo) / sizeof(void *); i++) {
BLI_assert(!DRW_ibo_requested(((GPUIndexBuf **)&cache->uv_cage.ibo)[i]));
}
#endif
diff --git a/source/blender/draw/intern/draw_cache_impl_metaball.c b/source/blender/draw/intern/draw_cache_impl_metaball.c
index 60f15338412..e3bfcbde3ef 100644
--- a/source/blender/draw/intern/draw_cache_impl_metaball.c
+++ b/source/blender/draw/intern/draw_cache_impl_metaball.c
@@ -212,7 +212,7 @@ GPUBatch **DRW_metaball_batch_cache_get_surface_shaded(Object *ob,
cache->shaded_triangles = MEM_callocN(sizeof(*cache->shaded_triangles) * cache->mat_len,
__func__);
cache->shaded_triangles[0] = DRW_metaball_batch_cache_get_triangles_with_normals(ob);
- for (int i = 1; i < cache->mat_len; ++i) {
+ for (int i = 1; i < cache->mat_len; i++) {
cache->shaded_triangles[i] = NULL;
}
}
diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c
index 6cd03d14bfd..3afdd77b6a7 100644
--- a/source/blender/draw/intern/draw_cache_impl_particles.c
+++ b/source/blender/draw/intern/draw_cache_impl_particles.c
@@ -190,18 +190,18 @@ static void particle_batch_cache_clear_hair(ParticleHairCache *hair_cache)
DRW_TEXTURE_FREE_SAFE(hair_cache->strand_tex);
DRW_TEXTURE_FREE_SAFE(hair_cache->strand_seg_tex);
- for (int i = 0; i < MAX_MTFACE; ++i) {
+ for (int i = 0; i < MAX_MTFACE; i++) {
GPU_VERTBUF_DISCARD_SAFE(hair_cache->proc_uv_buf[i]);
DRW_TEXTURE_FREE_SAFE(hair_cache->uv_tex[i]);
}
- for (int i = 0; i < MAX_MCOL; ++i) {
+ for (int i = 0; i < MAX_MCOL; i++) {
GPU_VERTBUF_DISCARD_SAFE(hair_cache->proc_col_buf[i]);
DRW_TEXTURE_FREE_SAFE(hair_cache->col_tex[i]);
}
- for (int i = 0; i < MAX_HAIR_SUBDIV; ++i) {
+ for (int i = 0; i < MAX_HAIR_SUBDIV; i++) {
GPU_VERTBUF_DISCARD_SAFE(hair_cache->final[i].proc_buf);
DRW_TEXTURE_FREE_SAFE(hair_cache->final[i].proc_tex);
- for (int j = 0; j < MAX_THICKRES; ++j) {
+ for (int j = 0; j < MAX_THICKRES; j++) {
GPU_BATCH_DISCARD_SAFE(hair_cache->final[i].proc_hairs[j]);
}
}
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index 096e1c2aeca..8e0f713add6 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -296,13 +296,13 @@ static struct {
void DRW_globals_free(void)
{
struct GPUVertFormat **format = &g_formats.instance_screenspace;
- for (int i = 0; i < sizeof(g_formats) / sizeof(void *); ++i, ++format) {
+ for (int i = 0; i < sizeof(g_formats) / sizeof(void *); i++, format++) {
MEM_SAFE_FREE(*format);
}
for (int j = 0; j < GPU_SHADER_CFG_LEN; j++) {
struct GPUShader **shader = &g_shaders[j].shape_outline;
- for (int i = 0; i < sizeof(g_shaders[j]) / sizeof(void *); ++i, ++shader) {
+ for (int i = 0; i < sizeof(g_shaders[j]) / sizeof(void *); i++, shader++) {
DRW_SHADER_FREE_SAFE(*shader);
}
}
diff --git a/source/blender/draw/intern/draw_debug.c b/source/blender/draw/intern/draw_debug.c
index 9681ffd9d3d..6b05bb07c0f 100644
--- a/source/blender/draw/intern/draw_debug.c
+++ b/source/blender/draw/intern/draw_debug.c
@@ -63,7 +63,7 @@ void DRW_debug_polygon_v3(const float (*v)[3], const int vert_len, const float c
{
BLI_assert(vert_len > 1);
- for (int i = 0; i < vert_len; ++i) {
+ for (int i = 0; i < vert_len; i++) {
DRW_debug_line_v3v3(v[i], v[(i + 1) % vert_len], color);
}
}
@@ -117,7 +117,7 @@ void DRW_debug_m4_as_bbox(const float m[4][4], const float color[4], const bool
}
BKE_boundbox_init_from_minmax(&bb, min, max);
- for (int i = 0; i < 8; ++i) {
+ for (int i = 0; i < 8; i++) {
mul_project_m4_v3(project_matrix, bb.vec[i]);
}
DRW_debug_bbox(&bb, color);
diff --git a/source/blender/draw/intern/draw_hair.c b/source/blender/draw/intern/draw_hair.c
index 44ed01c47aa..f77243ca9f1 100644
--- a/source/blender/draw/intern/draw_hair.c
+++ b/source/blender/draw/intern/draw_hair.c
@@ -151,13 +151,13 @@ static DRWShadingGroup *drw_shgroup_create_hair_procedural_ex(Object *object,
}
/* TODO optimize this. Only bind the ones GPUMaterial needs. */
- for (int i = 0; i < hair_cache->num_uv_layers; ++i) {
- for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->uv_layer_names[i][n][0] != '\0'; ++n) {
+ for (int i = 0; i < hair_cache->num_uv_layers; i++) {
+ for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->uv_layer_names[i][n][0] != '\0'; n++) {
DRW_shgroup_uniform_texture(shgrp, hair_cache->uv_layer_names[i][n], hair_cache->uv_tex[i]);
}
}
- for (int i = 0; i < hair_cache->num_col_layers; ++i) {
- for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->col_layer_names[i][n][0] != '\0'; ++n) {
+ for (int i = 0; i < hair_cache->num_col_layers; i++) {
+ for (int n = 0; n < MAX_LAYER_NAME_CT && hair_cache->col_layer_names[i][n][0] != '\0'; n++) {
DRW_shgroup_uniform_texture(
shgrp, hair_cache->col_layer_names[i][n], hair_cache->col_tex[i]);
}
@@ -323,7 +323,7 @@ void DRW_hair_update(void)
void DRW_hair_free(void)
{
- for (int i = 0; i < PART_REFINE_MAX_SHADER; ++i) {
+ for (int i = 0; i < PART_REFINE_MAX_SHADER; i++) {
DRW_SHADER_FREE_SAFE(g_refine_shaders[i]);
}
}
diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c
index 8f26cc72a02..69756203d66 100644
--- a/source/blender/draw/intern/draw_instance_data.c
+++ b/source/blender/draw/intern/draw_instance_data.c
@@ -298,7 +298,7 @@ void DRW_instance_data_list_free(DRWInstanceDataList *idatalist)
{
DRWInstanceData *idata, *next_idata;
- for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) {
+ for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) {
for (idata = idatalist->idata_head[i]; idata; idata = next_idata) {
next_idata = idata->next;
DRW_instance_data_free(idata);
@@ -319,7 +319,7 @@ void DRW_instance_data_list_reset(DRWInstanceDataList *idatalist)
{
DRWInstanceData *idata;
- for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) {
+ for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) {
for (idata = idatalist->idata_head[i]; idata; idata = idata->next) {
idata->used = false;
}
@@ -331,7 +331,7 @@ void DRW_instance_data_list_free_unused(DRWInstanceDataList *idatalist)
DRWInstanceData *idata, *next_idata;
/* Remove unused data blocks and sanitize each list. */
- for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) {
+ for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) {
idatalist->idata_tail[i] = NULL;
for (idata = idatalist->idata_head[i]; idata; idata = next_idata) {
next_idata = idata->next;
@@ -360,7 +360,7 @@ void DRW_instance_data_list_resize(DRWInstanceDataList *idatalist)
{
DRWInstanceData *idata;
- for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; ++i) {
+ for (int i = 0; i < MAX_INSTANCE_DATA_SIZE; i++) {
for (idata = idatalist->idata_head[i]; idata; idata = idata->next) {
BLI_mempool_clear_ex(idata->mempool, BLI_mempool_len(idata->mempool));
}
diff --git a/source/blender/draw/intern/draw_manager_data.c b/source/blender/draw/intern/draw_manager_data.c
index 8b7cb9c1dad..cd174e899d4 100644
--- a/source/blender/draw/intern/draw_manager_data.c
+++ b/source/blender/draw/intern/draw_manager_data.c
@@ -787,7 +787,7 @@ void DRW_buffer_add_entry_array(DRWCallBuffer *callbuf, const void *attr[], uint
GPU_vertbuf_data_resize(buf, count + DRW_BUFFER_VERTS_CHUNK);
}
- for (int i = 0; i < attr_len; ++i) {
+ for (int i = 0; i < attr_len; i++) {
GPU_vertbuf_attr_set(buf, i, count, attr[i]);
}
@@ -939,7 +939,7 @@ GPUVertFormat *DRW_shgroup_instance_format_array(const DRWInstanceAttrFormat att
{
GPUVertFormat *format = MEM_callocN(sizeof(GPUVertFormat), "GPUVertFormat");
- for (int i = 0; i < arraysize; ++i) {
+ for (int i = 0; i < arraysize; i++) {
GPU_vertformat_attr_add(format,
attrs[i].name,
(attrs[i].type == DRW_ATTR_INT) ? GPU_COMP_I32 : GPU_COMP_F32,
diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index 0d19a257cfa..9732f36e293 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -301,12 +301,12 @@ void drw_state_set(DRWState state)
int test;
if ((test = CHANGED_TO(DRW_STATE_CLIP_PLANES))) {
if (test == 1) {
- for (int i = 0; i < DST.view_active->clip_planes_len; ++i) {
+ for (int i = 0; i < DST.view_active->clip_planes_len; i++) {
glEnable(GL_CLIP_DISTANCE0 + i);
}
}
else {
- for (int i = 0; i < MAX_CLIP_PLANES; ++i) {
+ for (int i = 0; i < MAX_CLIP_PLANES; i++) {
glDisable(GL_CLIP_DISTANCE0 + i);
}
}
@@ -771,7 +771,7 @@ static bool ubo_bindings_validate(DRWShadingGroup *shgroup)
glGetIntegerv(GL_CURRENT_PROGRAM, &program);
glGetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &active_blocks);
- for (uint i = 0; i < active_blocks; ++i) {
+ for (uint i = 0; i < active_blocks; i++) {
int binding = 0;
int buffer = 0;
diff --git a/source/blender/draw/intern/draw_manager_profiling.c b/source/blender/draw/intern/draw_manager_profiling.c
index bab69cf7a57..76382132230 100644
--- a/source/blender/draw/intern/draw_manager_profiling.c
+++ b/source/blender/draw/intern/draw_manager_profiling.c
@@ -63,7 +63,7 @@ static struct DRWTimerPool {
void DRW_stats_free(void)
{
if (DTP.timers != NULL) {
- for (int i = 0; i < DTP.timer_count; ++i) {
+ for (int i = 0; i < DTP.timer_count; i++) {
DRWTimer *timer = &DTP.timers[i];
glDeleteQueries(2, timer->query);
}
@@ -169,7 +169,7 @@ void DRW_stats_reset(void)
GLuint64 lvl_time[MAX_NESTED_TIMER] = {0};
/* Swap queries for the next frame and sum up each lvl time. */
- for (int i = DTP.timer_increment - 1; i >= 0; --i) {
+ for (int i = DTP.timer_increment - 1; i >= 0; i--) {
DRWTimer *timer = &DTP.timers[i];
SWAP(GLuint, timer->query[0], timer->query[1]);
@@ -323,7 +323,7 @@ void DRW_stats_draw(const rcti *rect)
BLI_strncpy(stat_string, "GPU Render Timings", sizeof(stat_string));
draw_stat(rect, 0, v++, stat_string, sizeof(stat_string));
- for (int i = 0; i < DTP.timer_increment; ++i) {
+ for (int i = 0; i < DTP.timer_increment; i++) {
double time_ms, time_percent;
DRWTimer *timer = &DTP.timers[i];
DRWTimer *timer_parent = (timer->lvl > 0) ? &DTP.timers[lvl_index[timer->lvl - 1]] : NULL;
diff --git a/source/blender/draw/modes/edit_armature_mode.c b/source/blender/draw/modes/edit_armature_mode.c
index dfe5a4b7a2f..20195b7d9f9 100644
--- a/source/blender/draw/modes/edit_armature_mode.c
+++ b/source/blender/draw/modes/edit_armature_mode.c
@@ -74,7 +74,7 @@ static void EDIT_ARMATURE_cache_init(void *vedata)
}
stl->g_data->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE);
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
/* Solid bones */
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK;
psl->bone_solid[i] = DRW_pass_create("Bone Solid Pass", state | DRW_STATE_WRITE_DEPTH);
diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c
index 716372560db..663624aa050 100644
--- a/source/blender/draw/modes/object_mode.c
+++ b/source/blender/draw/modes/object_mode.c
@@ -1517,7 +1517,7 @@ static void OBJECT_cache_init(void *vedata)
psl->camera_images_front = DRW_pass_create("Camera Images Front", state);
}
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
OBJECT_ShadingGroupList *sgl = (i == 1) ? &stl->g_data->sgl_ghost : &stl->g_data->sgl;
/* Solid bones */
@@ -1540,7 +1540,7 @@ static void OBJECT_cache_init(void *vedata)
sgl->bone_axes = psl->bone_axes[i] = DRW_pass_create("Bone Axes Pass", state);
}
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
OBJECT_ShadingGroupList *sgl = (i == 1) ? &stl->g_data->sgl_ghost : &stl->g_data->sgl;
/* Non Meshes Pass (Camera, empties, lights ...) */
@@ -2982,7 +2982,7 @@ static void DRW_shgroup_lightprobe(OBJECT_Shaders *sh_data,
{0.0, 0.0, 0.0, 1.0}},
};
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
float clipmat[4][4];
normalize_m4_m4(clipmat, ob->obmat);
mul_m4_m4m4(clipmat, clipmat, cubefacemat[i]);
diff --git a/source/blender/draw/modes/pose_mode.c b/source/blender/draw/modes/pose_mode.c
index 3a5c87688fe..91e4e2335de 100644
--- a/source/blender/draw/modes/pose_mode.c
+++ b/source/blender/draw/modes/pose_mode.c
@@ -127,7 +127,7 @@ static void POSE_cache_init(void *vedata)
POSE_PrivateData *ppd = stl->g_data;
ppd->transparent_bones = (draw_ctx->v3d->shading.type == OB_WIRE);
- for (int i = 0; i < 2; ++i) {
+ for (int i = 0; i < 2; i++) {
/* Solid bones */
DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_CULL_BACK;
psl->bone_solid[i] = DRW_pass_create("Bone Solid Pass", state | DRW_STATE_WRITE_DEPTH);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 7ab50afe3a1..40b2706cc75 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -442,7 +442,7 @@ static float normalization_factor_get(Scene *scene, FCurve *fcu, short flag, flo
}
else {
float step_size = (bezt->vec[1][0] - prev_bezt->vec[1][0]) / resol;
- for (int j = 0; j <= resol; ++j) {
+ for (int j = 0; j <= resol; j++) {
float eval_time = prev_bezt->vec[1][0] + step_size * j;
float eval_value = evaluate_fcurve_only_curve(fcu, eval_time);
max_coord = max_ff(max_coord, eval_value);
diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c
index 08de699a70b..c772590ed21 100644
--- a/source/blender/editors/armature/armature_skinning.c
+++ b/source/blender/editors/armature/armature_skinning.c
@@ -234,7 +234,7 @@ static void envelope_bone_weighting(Object *ob,
iflip = (dgroupflip) ? mesh_get_x_mirror_vert(ob, NULL, i, use_topology) : -1;
/* for each skinnable bone */
- for (j = 0; j < numbones; ++j) {
+ for (j = 0; j < numbones; j++) {
if (!selected[j]) {
continue;
}
@@ -346,7 +346,7 @@ static void add_verts_to_dgroups(ReportList *reports,
tip = MEM_callocN(numbones * sizeof(float) * 3, "tip");
selected = MEM_callocN(numbones * sizeof(int), "selected");
- for (j = 0; j < numbones; ++j) {
+ for (j = 0; j < numbones; j++) {
bone = bonelist[j];
dgroup = dgrouplist[j];
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index d7650db546d..7e878d0f905 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -692,7 +692,7 @@ static void calc_shapeKeys(Object *obedit, ListBase *newnurbs)
if (oldbezt) {
int j;
- for (j = 0; j < 3; ++j) {
+ for (j = 0; j < 3; j++) {
sub_v3_v3v3(ofs[i], bezt->vec[j], oldbezt->vec[j]);
i++;
}
diff --git a/source/blender/editors/gizmo_library/gizmo_draw_utils.c b/source/blender/editors/gizmo_library/gizmo_draw_utils.c
index f1d8c1ac6b0..7aef097d036 100644
--- a/source/blender/editors/gizmo_library/gizmo_draw_utils.c
+++ b/source/blender/editors/gizmo_library/gizmo_draw_utils.c
@@ -66,7 +66,7 @@ void wm_gizmo_geometryinfo_draw(const GizmoGeomInfo *info,
/* Elements */
GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, info->ntris, info->nverts);
- for (int i = 0; i < info->ntris; ++i) {
+ for (int i = 0; i < info->ntris; i++) {
const unsigned short *idx = &info->indices[i * 3];
GPU_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]);
}
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index b7a0812c5f2..551e25a5986 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -2220,8 +2220,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion *UNUSED(ar),
/* Do stipple cross with geometry */
immBegin(GPU_PRIM_LINES, 7 * 2 * 2);
float pos_sel[8] = {-10.0f, -7.0f, -4.0f, -1.0f, 2.0f, 5.0f, 8.0f, 11.0f};
- for (int axe = 0; axe < 2; ++axe) {
- for (int i = 0; i < 7; ++i) {
+ for (int axe = 0; axe < 2; axe++) {
+ for (int i = 0; i < 7; i++) {
float x1 = pos_sel[i] * (1 - axe);
float y1 = pos_sel[i] * axe;
float x2 = pos_sel[i + 1] * (1 - axe);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index e6fc1a50d6d..242a1204a6c 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -4871,7 +4871,7 @@ static void handle_layer_buttons(bContext *C, void *arg1, void *arg2)
/* Normally clicking only selects one layer */
RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, cur, true);
- for (i = 0; i < tot; ++i) {
+ for (i = 0; i < tot; i++) {
if (i != cur) {
RNA_property_boolean_set_index(&but->rnapoin, but->rnaprop, i, false);
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index a7e473eb6e4..d3d95401851 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -467,7 +467,7 @@ static void roundbox_batch_add_tria(GPUVertBufRaw *vflag_step, int tria, uint32_
const int tria_num =
ELEM(tria, ROUNDBOX_TRIA_CHECK, ROUNDBOX_TRIA_HOLD_ACTION_ARROW, ROUNDBOX_TRIA_MENU) ? 1 : 2;
/* for each tria */
- for (int t = 0; t < tria_num; ++t) {
+ for (int t = 0; t < tria_num; t++) {
for (int j = 0; j < WIDGET_AA_JITTER; j++) {
/* restart */
set_roundbox_vertex_data(vflag_step, last_data);
@@ -1152,7 +1152,7 @@ static void widget_draw_vertex_buffer(uint pos,
uint totvert)
{
immBegin(mode, totvert);
- for (int i = 0; i < totvert; ++i) {
+ for (int i = 0; i < totvert; i++) {
if (quads_col) {
immAttr4ubv(col, quads_col[i]);
}
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 50cc42866fe..4bfff5f02cf 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1365,7 +1365,7 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR);
immBeginAtMost(GPU_PRIM_LINES, vertex_count);
- for (int level = 0; level < totlevels; ++level) {
+ for (int level = 0; level < totlevels; level++) {
UI_GetThemeColorShade3ubv(colorid, offset, grid_line_color);
int i = (int)(v2d->cur.xmin / lstep);
@@ -1374,7 +1374,7 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
}
float start = i * lstep;
- for (; start < v2d->cur.xmax; start += lstep, ++i) {
+ for (; start < v2d->cur.xmax; start += lstep, i++) {
if (i == 0 || (level < totlevels - 1 && i % level_size == 0)) {
continue;
}
@@ -1391,7 +1391,7 @@ void UI_view2d_multi_grid_draw(View2D *v2d, int colorid, float step, int level_s
}
start = i * lstep;
- for (; start < v2d->cur.ymax; start += lstep, ++i) {
+ for (; start < v2d->cur.ymax; start += lstep, i++) {
if (i == 0 || (level < totlevels - 1 && i % level_size == 0)) {
continue;
}
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c
index 2f3e73f32d5..aac4da12658 100644
--- a/source/blender/editors/io/io_alembic.c
+++ b/source/blender/editors/io/io_alembic.c
@@ -576,7 +576,7 @@ static int get_sequence_len(char *filename, int *ofs)
(*ofs) = frame_curr;
while (cache_frame && (cache_frame->framenr == frame_curr)) {
- ++frame_curr;
+ frame_curr++;
cache_frame = cache_frame->next;
}
diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c
index 683e6d8a2b0..4624611419e 100644
--- a/source/blender/editors/mask/mask_add.c
+++ b/source/blender/editors/mask/mask_add.c
@@ -230,7 +230,7 @@ static void setup_vertex_point(Mask *mask,
int point_index = reference_point - spline->points;
int delta = new_point == spline->points ? 1 : -1;
int i = 0;
- for (i = 0; i < spline->tot_point - 1; ++i) {
+ for (i = 0; i < spline->tot_point - 1; i++) {
MaskSplinePoint *current_point;
point_index += delta;
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index c00223a3c49..594fae51fde 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -391,7 +391,7 @@ static void mask_draw_array(unsigned int pos,
unsigned int vertex_len)
{
immBegin(prim_type, vertex_len);
- for (unsigned int i = 0; i < vertex_len; ++i) {
+ for (unsigned int i = 0; i < vertex_len; i++) {
immVertex2fv(pos, points[i]);
}
immEnd();
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 2a8b306b085..9b5342fc797 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -711,7 +711,7 @@ static int apply_objects_internal(bContext *C,
return OPERATOR_CANCELLED;
}
- for (int object_index = 0; object_index < num_objects; ++object_index) {
+ for (int object_index = 0; object_index < num_objects; object_index++) {
Object *ob = objects[object_index];
/* calculate rotation/scale matrix */
@@ -1086,7 +1086,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
/* reset flags */
- for (int object_index = 0; object_index < num_objects; ++object_index) {
+ for (int object_index = 0; object_index < num_objects; object_index++) {
Object *ob = objects[object_index];
ob->flag &= ~OB_DONE;
@@ -1106,7 +1106,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
}
}
- for (int object_index = 0; object_index < num_objects; ++object_index) {
+ for (int object_index = 0; object_index < num_objects; object_index++) {
Object *ob = objects[object_index];
if ((ob->flag & OB_DONE) == 0) {
@@ -1411,7 +1411,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
//{
/* use existing context looper */
- for (int other_object_index = 0; other_object_index < num_objects; ++other_object_index) {
+ for (int other_object_index = 0; other_object_index < num_objects; other_object_index++) {
Object *ob_other = objects[other_object_index];
if ((ob_other->flag & OB_DONE) == 0 &&
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index 68506c8addb..848e5675fec 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -5438,7 +5438,7 @@ static float calculate_average_length(PTCacheEdit *edit)
LOOP_SELECTED_POINTS
{
total_length += calculate_point_length(point);
- ++num_selected;
+ num_selected++;
}
if (num_selected == 0) {
return 0.0f;
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index fbaf02b7b3f..12eb433a3dd 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -1116,7 +1116,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
tmp_psys = MEM_mallocN(sizeof(ParticleSystem *) * totpsys, "temporary particle system array");
- for (psys_from = PSYS_FROM_FIRST, i = 0; psys_from; psys_from = PSYS_FROM_NEXT(psys_from), ++i) {
+ for (psys_from = PSYS_FROM_FIRST, i = 0; psys_from; psys_from = PSYS_FROM_NEXT(psys_from), i++) {
psys = BKE_object_copy_particlesystem(psys_from, 0);
tmp_psys[i] = psys;
@@ -1168,7 +1168,7 @@ static bool copy_particle_systems_to_object(const bContext *C,
* the remapping otherwise makes final_dm invalid!
*/
for (psys = psys_start, psys_from = PSYS_FROM_FIRST, i = 0; psys;
- psys = psys->next, psys_from = PSYS_FROM_NEXT(psys_from), ++i) {
+ psys = psys->next, psys_from = PSYS_FROM_NEXT(psys_from), i++) {
float(*from_mat)[4], (*to_mat)[4];
switch (space) {
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c
index b6601807443..3e001ef25b5 100644
--- a/source/blender/editors/render/render_preview.c
+++ b/source/blender/editors/render/render_preview.c
@@ -1296,7 +1296,7 @@ static void icon_preview_endjob(void *customdata)
int i;
/* signal to gpu texture */
- for (i = 0; i < NUM_ICON_SIZES; ++i) {
+ for (i = 0; i < NUM_ICON_SIZES; i++) {
if (prv_img->gputexture[i]) {
GPU_texture_free(prv_img->gputexture[i]);
prv_img->gputexture[i] = NULL;
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index 1124070486f..db744df02e7 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -273,8 +273,8 @@ static GPUBatch *batch_screen_edges_get(int *corner_len)
GPU_vertbuf_data_alloc(vbo, CORNER_RESOLUTION * 2 * 4 + 2);
uint vidx = 0;
- for (int corner = 0; corner < 4; ++corner) {
- for (int c = 0; c < CORNER_RESOLUTION; ++c) {
+ for (int corner = 0; corner < 4; corner++) {
+ for (int c = 0; c < CORNER_RESOLUTION; c++) {
do_vert_pair(vbo, pos, &vidx, corner, c);
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index d872356a083..a000da57383 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -1116,7 +1116,7 @@ static void cursor_draw_tiling_preview(const uint gpuattr,
const float *step = sd->paint.tile_offset;
copy_v3_v3(orgLoc, true_location);
- for (dim = 0; dim < 3; ++dim) {
+ for (dim = 0; dim < 3; dim++) {
if ((sd->paint.symmetry_flags & (PAINT_TILE_X << dim)) && step[dim] > 0) {
start[dim] = (bbMin[dim] - orgLoc[dim] - radius) / step[dim];
end[dim] = (bbMax[dim] - orgLoc[dim] + radius) / step[dim];
@@ -1153,7 +1153,7 @@ static void cursor_draw_point_with_symmetry(const uint gpuattr,
const char symm = sd->paint.symmetry_flags & PAINT_SYMM_AXIS_ALL;
float location[3], symm_rot_mat[4][4];
- for (int i = 0; i <= symm; ++i) {
+ for (int i = 0; i <= symm; i++) {
if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
/* Axis Symmetry */
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index 74212058fc7..0e8d4d75360 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -305,7 +305,7 @@ bool ED_sculpt_mask_box_select(struct bContext *C, ViewContext *vc, const rcti *
sculpt_undo_push_begin("Mask box fill");
- for (symmpass = 0; symmpass <= symm; ++symmpass) {
+ for (symmpass = 0; symmpass <= symm; symmpass++) {
if (symmpass == 0 || (symm & symmpass && (symm != 5 || symmpass != 3) &&
(symm != 6 || (symmpass != 3 && symmpass != 5)))) {
int j = 0;
@@ -491,7 +491,7 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
sculpt_undo_push_begin("Mask lasso fill");
- for (symmpass = 0; symmpass <= symm; ++symmpass) {
+ for (symmpass = 0; symmpass <= symm; symmpass++) {
if ((symmpass == 0) || (symm & symmpass && (symm != 5 || symmpass != 3) &&
(symm != 6 || (symmpass != 3 && symmpass != 5)))) {
int j = 0;
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c
index 4b9d9a2cc01..6919536043f 100644
--- a/source/blender/editors/sculpt_paint/paint_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_utils.c
@@ -101,9 +101,9 @@ bool paint_convert_bb_to_rect(rcti *rect,
ED_view3d_ob_project_mat_get(rv3d, ob, projection_mat);
- for (i = 0; i < 2; ++i) {
- for (j = 0; j < 2; ++j) {
- for (k = 0; k < 2; ++k) {
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 2; j++) {
+ for (k = 0; k < 2; k++) {
float vec[3], proj[2];
int proj_i[2];
vec[0] = i ? bb_min[0] : bb_max[0];
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5aa913ad006..f252dae69fc 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -994,7 +994,7 @@ static float calc_radial_symmetry_feather(Sculpt *sd,
float overlap;
overlap = 0;
- for (i = 1; i < sd->radial_symm[axis - 'X']; ++i) {
+ for (i = 1; i < sd->radial_symm[axis - 'X']; i++) {
const float angle = 2 * M_PI * i / sd->radial_symm[axis - 'X'];
overlap += calc_overlap(cache, symm, axis, angle);
}
@@ -1541,7 +1541,7 @@ bool sculpt_search_sphere_cb(PBVHNode *node, void *data_v)
BKE_pbvh_node_get_BB(node, bb_min, bb_max);
}
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; i++) {
if (bb_min[i] > center[i]) {
nearest[i] = bb_min[i];
}
@@ -1583,7 +1583,7 @@ static void sculpt_clip(Sculpt *sd, SculptSession *ss, float co[3], const float
{
int i;
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; i++) {
if (sd->flags & (SCULPT_LOCK_X << i)) {
continue;
}
@@ -2363,7 +2363,7 @@ static void smooth(Sculpt *sd,
return;
}
- for (iteration = 0; iteration <= count; ++iteration) {
+ for (iteration = 0; iteration <= count; iteration++) {
const float strength = (iteration != count) ? 1.0f : last;
SculptThreadedTaskData data = {
@@ -2426,7 +2426,7 @@ static void bmesh_topology_rake(
const int count = iterations * bstrength + 1;
const float factor = iterations * bstrength / count;
- for (iteration = 0; iteration <= count; ++iteration) {
+ for (iteration = 0; iteration <= count; iteration++) {
SculptThreadedTaskData data = {
.sd = sd,
@@ -4587,7 +4587,7 @@ static void do_radial_symmetry(Sculpt *sd,
SculptSession *ss = ob->sculpt;
int i;
- for (i = 1; i < sd->radial_symm[axis - 'X']; ++i) {
+ for (i = 1; i < sd->radial_symm[axis - 'X']; i++) {
const float angle = 2 * M_PI * i / sd->radial_symm[axis - 'X'];
ss->cache->radial_symmetry_pass = i;
sculpt_cache_calc_brushdata_symm(ss->cache, symm, axis, angle);
@@ -4627,7 +4627,7 @@ static void do_symmetrical_brush_actions(Sculpt *sd,
/* symm is a bit combination of XYZ -
* 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
- for (i = 0; i <= symm; ++i) {
+ for (i = 0; i <= symm; i++) {
if (i == 0 || (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
cache->mirror_symmetry_pass = i;
cache->radial_symmetry_pass = 0;
@@ -4759,7 +4759,7 @@ static void sculpt_init_mirror_clipping(Object *ob, SculptSession *ss)
if (mmd->flag & MOD_MIR_CLIPPING) {
/* check each axis for mirroring */
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; i++) {
if (mmd->flag & (MOD_MIR_AXIS_X << i)) {
/* enable sculpt clipping */
ss->cache->flag |= CLIP_X << i;
@@ -4921,7 +4921,7 @@ static void sculpt_update_cache_invariants(
memcpy(ss->layer_co, ss->deform_cos, ss->totvert);
}
else {
- for (i = 0; i < ss->totvert; ++i) {
+ for (i = 0; i < ss->totvert; i++) {
copy_v3_v3(ss->layer_co[i], ss->mvert[i].co);
}
}
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index 9939351ee45..c6061cb6f58 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -239,7 +239,7 @@ static bool file_is_any_selected(struct FileList *files)
int i;
/* Is any file selected ? */
- for (i = 0; i < numfiles; ++i) {
+ for (i = 0; i < numfiles; i++) {
if (filelist_entry_select_index_get(files, i, CHECK_ALL)) {
return true;
}
@@ -1744,7 +1744,7 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w
/* check if we are editing a name */
int edit_idx = -1;
- for (i = 0; i < numfiles; ++i) {
+ for (i = 0; i < numfiles; i++) {
if (filelist_entry_select_index_get(sfile->files, i, CHECK_ALL) &
(FILE_SEL_EDITING | FILE_SEL_HIGHLIGHTED)) {
edit_idx = i;
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 1a7608ba291..27cccf6bab1 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -895,7 +895,7 @@ void filelist_free_icons(void)
BLI_assert(G.background == false);
- for (i = 0; i < SPECIAL_IMG_MAX; ++i) {
+ for (i = 0; i < SPECIAL_IMG_MAX; i++) {
IMB_freeImBuf(gSpecialFileImages[i]);
gSpecialFileImages[i] = NULL;
}
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index d683c9d5c98..be8ebc18c2c 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -631,7 +631,7 @@ static void file_attribute_columns_widths(const FileSelectParams *params, FileLa
const bool small_size = SMALL_SIZE_CHECK(params->thumbnail_size);
const int pad = small_size ? 0 : ATTRIBUTE_COLUMN_PADDING * 2;
- for (int i = 0; i < ATTRIBUTE_COLUMN_MAX; ++i) {
+ for (int i = 0; i < ATTRIBUTE_COLUMN_MAX; i++) {
layout->attribute_columns[i].width = 0;
}
@@ -895,7 +895,7 @@ int autocomplete_file(struct bContext *C, char *str, void *UNUSED(arg_v))
int nentries = filelist_files_ensure(sfile->files);
int i;
- for (i = 0; i < nentries; ++i) {
+ for (i = 0; i < nentries; i++) {
FileDirEntry *file = filelist_file(sfile->files, i);
UI_autocomplete_update_name(autocpl, file->relpath);
}
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index b50c37baae6..c7a139a8b24 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -404,7 +404,7 @@ void fsmenu_write_file(struct FSMenu *fsmenu, const char *filename)
fprintf(fp, "[Recent]\n");
for (fsm_iter = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT);
fsm_iter && (nwritten < FSMENU_RECENT_MAX);
- fsm_iter = fsm_iter->next, ++nwritten) {
+ fsm_iter = fsm_iter->next, nwritten++) {
if (fsm_iter->path && fsm_iter->save) {
fsmenu_entry_generate_name(fsm_iter, fsm_name, sizeof(fsm_name));
if (fsm_iter->name[0] && !STREQ(fsm_iter->name, fsm_name)) {
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index c0980a1d2e9..23d452412ea 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -3126,12 +3126,12 @@ static void node_template_properties_update(bNodeType *ntype)
bNodeSocketTemplate *stemp;
if (ntype->inputs) {
- for (stemp = ntype->inputs; stemp->type >= 0; ++stemp) {
+ for (stemp = ntype->inputs; stemp->type >= 0; stemp++) {
node_socket_template_properties_update(ntype, stemp);
}
}
if (ntype->outputs) {
- for (stemp = ntype->outputs; stemp->type >= 0; ++stemp) {
+ for (stemp = ntype->outputs; stemp->type >= 0; stemp++) {
node_socket_template_properties_update(ntype, stemp);
}
}
@@ -3752,7 +3752,7 @@ static void nodelink_batch_init(void)
GPU_vertbuf_data_alloc(vbo, vcount);
int v = 0;
- for (int k = 0; k < 2; ++k) {
+ for (int k = 0; k < 2; k++) {
unsigned char uv[2] = {0, 0};
float pos[2] = {0.0f, 0.0f};
float exp[2] = {0.0f, 1.0f};
@@ -3763,7 +3763,7 @@ static void nodelink_batch_init(void)
}
/* curve strip */
- for (int i = 0; i < LINK_RESOL; ++i) {
+ for (int i = 0; i < LINK_RESOL; i++) {
uv[0] = 255 * (i / (float)(LINK_RESOL - 1));
uv[1] = 0;
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
@@ -3779,7 +3779,7 @@ static void nodelink_batch_init(void)
copy_v2_v2(exp, arrow_expand_axis[0]);
set_nodelink_vertex(vbo, uv_id, pos_id, expand_id, v++, uv, pos, exp);
/* arrow */
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
uv[1] = 0;
copy_v2_v2(pos, arrow_verts[i]);
copy_v2_v2(exp, arrow_expand_axis[i]);
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 6dc2182b684..e5cb15c1f79 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -261,7 +261,7 @@ void ED_node_sort(bNodeTree *ntree)
do {
/* setup first_b pointer */
- for (b = 0; b < k && first_b; ++b) {
+ for (b = 0; b < k && first_b; b++) {
first_b = first_b->next;
}
/* all batches merged? */
@@ -289,7 +289,7 @@ void ED_node_sort(bNodeTree *ntree)
/* setup first pointers for next batch */
first_b = node_b;
- for (; b < k; ++b) {
+ for (; b < k; b++) {
/* all nodes sorted? */
if (first_b == NULL) {
break;
@@ -970,7 +970,7 @@ void node_draw_sockets(View2D *v2d,
continue;
}
if (select_all || (sock->flag & SELECT)) {
- ++selected_input_len;
+ selected_input_len++;
continue;
}
@@ -995,7 +995,7 @@ void node_draw_sockets(View2D *v2d,
continue;
}
if (select_all || (sock->flag & SELECT)) {
- ++selected_output_len;
+ selected_output_len++;
continue;
}
@@ -1732,11 +1732,11 @@ void drawnodespace(const bContext *C, ARegion *ar)
depth = 0;
while (path->prev && depth < max_depth) {
path = path->prev;
- ++depth;
+ depth++;
}
/* parent node trees in the background */
- for (curdepth = depth; curdepth > 0; path = path->next, --curdepth) {
+ for (curdepth = depth; curdepth > 0; path = path->next, curdepth--) {
ntree = path->nodetree;
if (ntree) {
snode_setup_v2d(snode, ar, path->view_center);
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index 3fd03bac874..588fc4d4307 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -298,7 +298,7 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
tlink->fromsock,
link->tonode->new_node,
link->tosock->new_sock);
- ++num_external_links;
+ num_external_links++;
}
}
@@ -331,7 +331,7 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
tlink->fromsock->new_sock,
link->tonode,
link->tosock);
- ++num_internal_links;
+ num_internal_links++;
}
}
}
@@ -695,7 +695,7 @@ static int node_get_selected_minmax(bNodeTree *ntree, bNode *gnode, float *min,
if (node_group_make_use_node(node, gnode)) {
nodeToView(node, 0.0f, 0.0f, &loc[0], &loc[1]);
minmax_v2v2_v2(min, max, loc);
- ++totselect;
+ totselect++;
}
}
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index cf52ca8489f..eef3f85319c 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -572,10 +572,10 @@ static int node_count_links(bNodeTree *ntree, bNodeSocket *sock)
int count = 0;
for (link = ntree->links.first; link; link = link->next) {
if (link->fromsock == sock) {
- ++count;
+ count++;
}
if (link->tosock == sock) {
- ++count;
+ count++;
}
}
return count;
@@ -599,7 +599,7 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link)
if (from_count > from->limit) {
nodeRemLink(ntree, tlink);
tlink = NULL;
- --from_count;
+ from_count--;
}
}
@@ -607,7 +607,7 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeLink *link)
if (to_count > to->limit) {
nodeRemLink(ntree, tlink);
tlink = NULL;
- --to_count;
+ to_count--;
}
}
}
@@ -1567,7 +1567,7 @@ static bNodeSocket *socket_best_match(ListBase *sockets)
}
/* try all types, starting from 'highest' (i.e. colors, vectors, values) */
- for (type = maxtype; type >= 0; --type) {
+ for (type = maxtype; type >= 0; type--) {
for (sock = sockets->first; sock; sock = sock->next) {
if (!nodeSocketIsHidden(sock) && type == sock->type) {
return sock;
@@ -1576,7 +1576,7 @@ static bNodeSocket *socket_best_match(ListBase *sockets)
}
/* no visible sockets, unhide first of highest type */
- for (type = maxtype; type >= 0; --type) {
+ for (type = maxtype; type >= 0; type--) {
for (sock = sockets->first; sock; sock = sock->next) {
if (type == sock->type) {
sock->flag &= ~SOCK_HIDDEN;
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index 423dec13c69..c6994dab72d 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -342,7 +342,7 @@ static void ui_node_link_items(NodeLinkArg *arg,
ListBase *lb = (in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs);
bNodeSocket *stemp;
int index;
- for (stemp = lb->first, index = 0; stemp; stemp = stemp->next, ++index, ++i) {
+ for (stemp = lb->first, index = 0; stemp; stemp = stemp->next, index++, i++) {
NodeLinkItem *item = &items[i];
item->socket_index = index;
@@ -363,15 +363,15 @@ static void ui_node_link_items(NodeLinkArg *arg,
bNodeSocketTemplate *stemp;
int i;
- for (stemp = socket_templates; stemp && stemp->type != -1; ++stemp) {
- ++totitems;
+ for (stemp = socket_templates; stemp && stemp->type != -1; stemp++) {
+ totitems++;
}
if (totitems > 0) {
items = MEM_callocN(sizeof(NodeLinkItem) * totitems, "ui node link items");
i = 0;
- for (stemp = socket_templates; stemp && stemp->type != -1; ++stemp, ++i) {
+ for (stemp = socket_templates; stemp && stemp->type != -1; stemp++, i++) {
NodeLinkItem *item = &items[i];
item->socket_index = i;
@@ -506,13 +506,13 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
ui_node_link_items(arg, SOCK_OUT, &items, &totitems);
- for (i = 0; i < totitems; ++i) {
+ for (i = 0; i < totitems; i++) {
if (ui_compatible_sockets(items[i].socket_type, sock->type)) {
num++;
}
}
- for (i = 0; i < totitems; ++i) {
+ for (i = 0; i < totitems; i++) {
if (!ui_compatible_sockets(items[i].socket_type, sock->type)) {
continue;
}
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 7183512a5bc..e114c3dbc05 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -158,7 +158,7 @@ bNodeTree *ED_node_tree_get(SpaceNode *snode, int level)
{
bNodeTreePath *path;
int i;
- for (path = snode->treepath.last, i = 0; path; path = path->prev, ++i) {
+ for (path = snode->treepath.last, i = 0; path; path = path->prev, i++) {
if (i == level) {
return path->nodetree;
}
@@ -171,7 +171,7 @@ int ED_node_tree_path_length(SpaceNode *snode)
bNodeTreePath *path;
int length = 0;
int i;
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
length += strlen(path->node_name);
if (i > 0) {
length += 1; /* for separator char */
@@ -186,7 +186,7 @@ void ED_node_tree_path_get(SpaceNode *snode, char *value)
int i;
value[0] = '\0';
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
if (i == 0) {
strcpy(value, path->node_name);
value += strlen(path->node_name);
@@ -204,7 +204,7 @@ void ED_node_tree_path_get_fixedbuf(SpaceNode *snode, char *value, int max_lengt
int size, i;
value[0] = '\0';
- for (path = snode->treepath.first, i = 0; path; path = path->next, ++i) {
+ for (path = snode->treepath.first, i = 0; path; path = path->next, i++) {
if (i == 0) {
size = BLI_strncpy_rlen(value, path->node_name, max_length);
}
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index b412a72cce1..eeaf9e7546b 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -96,7 +96,7 @@ void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], un
circball_array_fill(verts, cent, rad, tmat);
immBegin(GPU_PRIM_LINE_LOOP, CIRCLE_RESOL);
- for (int i = 0; i < CIRCLE_RESOL; ++i) {
+ for (int i = 0; i < CIRCLE_RESOL; i++) {
immVertex3fv(pos, verts[i]);
}
immEnd();
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 7cd38c95a7b..aafd36a5bb8 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1089,7 +1089,7 @@ static void draw_rotation_guide(const RegionView3D *rv3d)
color[3] = 63; /* somewhat faint */
immAttr4ubv(col, color);
float angle = 0.0f;
- for (int i = 0; i < ROT_AXIS_DETAIL; ++i, angle += step) {
+ for (int i = 0; i < ROT_AXIS_DETAIL; i++, angle += step) {
float p[3] = {s * cosf(angle), s * sinf(angle), 0.0f};
if (!upright) {
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index e0f4d1cf465..dac420ff2e4 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -670,7 +670,7 @@ static int undo_history_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSE
}
if (item[i].identifier) {
uiItemIntO(column, item[i].name, item[i].icon, op->type->idname, "item", item[i].value);
- ++c;
+ c++;
add_col = true;
}
}
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 76c3a6d6c4a..5a8301fae67 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -1808,7 +1808,7 @@ static void stitch_draw(const bContext *UNUSED(C), ARegion *UNUSED(ar), void *ar
GPU_vertbuf_attr_set(
vbo_line, pos_id, line_idx++, &stitch_preview->preview_polys[index + 2]);
- for (j = 1; j < stitch_preview->uvs_per_polygon[i] - 1; ++j) {
+ for (j = 1; j < stitch_preview->uvs_per_polygon[i] - 1; j++) {
GPU_vertbuf_attr_set(vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index]);
GPU_vertbuf_attr_set(
vbo, pos_id, tri_idx++, &stitch_preview->preview_polys[index + (j + 0) * 2]);
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
index 112dfc2e9dc..e391adde829 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c
@@ -126,7 +126,7 @@ static void generateStrokes(GpencilModifierData *md,
int i;
/* check each axis for mirroring */
- for (int xi = 0; xi < 3; ++xi) {
+ for (int xi = 0; xi < 3; xi++) {
if (mmd->flag & (GP_MIRROR_AXIS_X << xi)) {
/* count strokes to avoid infinite loop after adding new strokes to tail of listbase */
@@ -208,7 +208,7 @@ static int getDuplicationFactor(GpencilModifierData *md)
MirrorGpencilModifierData *mmd = (MirrorGpencilModifierData *)md;
int factor = 1;
/* create a duplication for each axis */
- for (int xi = 0; xi < 3; ++xi) {
+ for (int xi = 0; xi < 3; xi++) {
if (mmd->flag & (GP_MIRROR_AXIS_X << xi)) {
factor++;
}
diff --git a/source/blender/gpu/intern/gpu_attr_binding.c b/source/blender/gpu/intern/gpu_attr_binding.c
index 802b15a0c4e..6cb60884620 100644
--- a/source/blender/gpu/intern/gpu_attr_binding.c
+++ b/source/blender/gpu/intern/gpu_attr_binding.c
@@ -67,9 +67,9 @@ void get_attr_locations(const GPUVertFormat *format,
{
AttrBinding_clear(binding);
- for (uint a_idx = 0; a_idx < format->attr_len; ++a_idx) {
+ for (uint a_idx = 0; a_idx < format->attr_len; a_idx++) {
const GPUVertAttr *a = &format->attrs[a_idx];
- for (uint n_idx = 0; n_idx < a->name_len; ++n_idx) {
+ for (uint n_idx = 0; n_idx < a->name_len; n_idx++) {
const char *name = GPU_vertformat_attr_name_get(format, a, n_idx);
const GPUShaderInput *input = GPU_shaderinterface_attr(shaderface, name);
#if TRUST_NO_ONE
diff --git a/source/blender/gpu/intern/gpu_batch.c b/source/blender/gpu/intern/gpu_batch.c
index 583551e3e58..e0c0aea576c 100644
--- a/source/blender/gpu/intern/gpu_batch.c
+++ b/source/blender/gpu/intern/gpu_batch.c
@@ -48,7 +48,7 @@ void GPU_batch_vao_cache_clear(GPUBatch *batch)
return;
}
if (batch->is_dynamic_vao_count) {
- for (int i = 0; i < batch->dynamic_vaos.count; ++i) {
+ for (int i = 0; i < batch->dynamic_vaos.count; i++) {
if (batch->dynamic_vaos.vao_ids[i]) {
GPU_vao_free(batch->dynamic_vaos.vao_ids[i], batch->context);
}
@@ -61,7 +61,7 @@ void GPU_batch_vao_cache_clear(GPUBatch *batch)
MEM_freeN(batch->dynamic_vaos.vao_ids);
}
else {
- for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; ++i) {
+ for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; i++) {
if (batch->static_vaos.vao_ids[i]) {
GPU_vao_free(batch->static_vaos.vao_ids[i], batch->context);
}
@@ -72,7 +72,7 @@ void GPU_batch_vao_cache_clear(GPUBatch *batch)
}
}
batch->is_dynamic_vao_count = false;
- for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; ++i) {
+ for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; i++) {
batch->static_vaos.vao_ids[i] = 0;
batch->static_vaos.interfaces[i] = NULL;
}
@@ -98,7 +98,7 @@ void GPU_batch_init_ex(
#endif
batch->verts[0] = verts;
- for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; ++v) {
+ for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; v++) {
batch->verts[v] = NULL;
}
batch->inst = NULL;
@@ -116,7 +116,7 @@ void GPU_batch_copy(GPUBatch *batch_dst, GPUBatch *batch_src)
GPU_batch_init_ex(batch_dst, GPU_PRIM_POINTS, batch_src->verts[0], batch_src->elem, 0);
batch_dst->gl_prim_type = batch_src->gl_prim_type;
- for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; ++v) {
+ for (int v = 1; v < GPU_BATCH_VBO_MAX_LEN; v++) {
batch_dst->verts[v] = batch_src->verts[v];
}
}
@@ -130,7 +130,7 @@ void GPU_batch_clear(GPUBatch *batch)
GPU_vertbuf_discard(batch->inst);
}
if ((batch->owns_flag & ~GPU_BATCH_OWNS_INDEX) != 0) {
- for (int v = 0; v < GPU_BATCH_VBO_MAX_LEN; ++v) {
+ for (int v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) {
if (batch->verts[v] == NULL) {
break;
}
@@ -207,7 +207,7 @@ int GPU_batch_vertbuf_add_ex(GPUBatch *batch, GPUVertBuf *verts, bool own_vbo)
/* redo the bindings */
GPU_batch_vao_cache_clear(batch);
- for (uint v = 0; v < GPU_BATCH_VBO_MAX_LEN; ++v) {
+ for (uint v = 0; v < GPU_BATCH_VBO_MAX_LEN; v++) {
if (batch->verts[v] == NULL) {
#if TRUST_NO_ONE
/* for now all VertexBuffers must have same vertex_len */
@@ -233,14 +233,14 @@ static GLuint batch_vao_get(GPUBatch *batch)
{
/* Search through cache */
if (batch->is_dynamic_vao_count) {
- for (int i = 0; i < batch->dynamic_vaos.count; ++i) {
+ for (int i = 0; i < batch->dynamic_vaos.count; i++) {
if (batch->dynamic_vaos.interfaces[i] == batch->interface) {
return batch->dynamic_vaos.vao_ids[i];
}
}
}
else {
- for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; ++i) {
+ for (int i = 0; i < GPU_BATCH_VAO_STATIC_LEN; i++) {
if (batch->static_vaos.interfaces[i] == batch->interface) {
return batch->static_vaos.vao_ids[i];
}
@@ -265,7 +265,7 @@ static GLuint batch_vao_get(GPUBatch *batch)
GLuint new_vao = 0;
if (!batch->is_dynamic_vao_count) {
int i; /* find first unused slot */
- for (i = 0; i < GPU_BATCH_VAO_STATIC_LEN; ++i) {
+ for (i = 0; i < GPU_BATCH_VAO_STATIC_LEN; i++) {
if (batch->static_vaos.vao_ids[i] == 0) {
break;
}
@@ -279,7 +279,7 @@ static GLuint batch_vao_get(GPUBatch *batch)
/* Not enough place switch to dynamic. */
batch->is_dynamic_vao_count = true;
/* Erase previous entries, they will be added back if drawn again. */
- for (int j = 0; j < GPU_BATCH_VAO_STATIC_LEN; ++j) {
+ for (int j = 0; j < GPU_BATCH_VAO_STATIC_LEN; j++) {
GPU_shaderinterface_remove_batch_ref(
(GPUShaderInterface *)batch->static_vaos.interfaces[j], batch);
GPU_vao_free(batch->static_vaos.vao_ids[j], batch->context);
@@ -295,7 +295,7 @@ static GLuint batch_vao_get(GPUBatch *batch)
if (batch->is_dynamic_vao_count) {
int i; /* find first unused slot */
- for (i = 0; i < batch->dynamic_vaos.count; ++i) {
+ for (i = 0; i < batch->dynamic_vaos.count; i++) {
if (batch->dynamic_vaos.vao_ids[i] == 0) {
break;
}
@@ -351,7 +351,7 @@ void GPU_batch_program_set(GPUBatch *batch, uint32_t program, const GPUShaderInt
void gpu_batch_remove_interface_ref(GPUBatch *batch, const GPUShaderInterface *interface)
{
if (batch->is_dynamic_vao_count) {
- for (int i = 0; i < batch->dynamic_vaos.count; ++i) {
+ for (int i = 0; i < batch->dynamic_vaos.count; i++) {
if (batch->dynamic_vaos.interfaces[i] == interface) {
GPU_vao_free(batch->dynamic_vaos.vao_ids[i], batch->context);
batch->dynamic_vaos.vao_ids[i] = 0;
@@ -362,7 +362,7 @@ void gpu_batch_remove_interface_ref(GPUBatch *batch, const GPUShaderInterface *i
}
else {
int i;
- for (i = 0; i < GPU_BATCH_VAO_STATIC_LEN; ++i) {
+ for (i = 0; i < GPU_BATCH_VAO_STATIC_LEN; i++) {
if (batch->static_vaos.interfaces[i] == interface) {
GPU_vao_free(batch->static_vaos.vao_ids[i], batch->context);
batch->static_vaos.vao_ids[i] = 0;
@@ -386,7 +386,7 @@ static void create_bindings(GPUVertBuf *verts,
GPU_vertbuf_use(verts);
- for (uint a_idx = 0; a_idx < attr_len; ++a_idx) {
+ for (uint a_idx = 0; a_idx < attr_len; a_idx++) {
const GPUVertAttr *a = &format->attrs[a_idx];
if (format->deinterleaved) {
@@ -399,7 +399,7 @@ static void create_bindings(GPUVertBuf *verts,
const GLvoid *pointer = (const GLubyte *)0 + offset + v_first * stride;
- for (uint n_idx = 0; n_idx < a->name_len; ++n_idx) {
+ for (uint n_idx = 0; n_idx < a->name_len; n_idx++) {
const char *name = GPU_vertformat_attr_name_get(format, a, n_idx);
const GPUShaderInput *input = GPU_shaderinterface_attr(interface, name);
@@ -412,7 +412,7 @@ static void create_bindings(GPUVertBuf *verts,
assert(a->fetch_mode == GPU_FETCH_FLOAT);
assert(a->gl_comp_type == GL_FLOAT);
#endif
- for (int i = 0; i < a->comp_len / 4; ++i) {
+ for (int i = 0; i < a->comp_len / 4; i++) {
glEnableVertexAttribArray(input->location + i);
glVertexAttribDivisor(input->location + i, (use_instancing) ? 1 : 0);
glVertexAttribPointer(input->location + i,
@@ -449,7 +449,7 @@ static void create_bindings(GPUVertBuf *verts,
static void batch_update_program_bindings(GPUBatch *batch, uint v_first)
{
/* Reverse order so first vbos have more prevalence (in term of attrib override). */
- for (int v = GPU_BATCH_VBO_MAX_LEN - 1; v > -1; --v) {
+ for (int v = GPU_BATCH_VBO_MAX_LEN - 1; v > -1; v--) {
if (batch->verts[v] != NULL) {
create_bindings(batch->verts[v], batch->interface, (batch->inst) ? 0 : v_first, false);
}
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c
index 6eb8c80c58e..2b7d3fb082a 100644
--- a/source/blender/gpu/intern/gpu_buffers.c
+++ b/source/blender/gpu/intern/gpu_buffers.c
@@ -204,7 +204,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers,
* copies are made for flat shading because normals
* shouldn't be shared. */
if (buffers->smooth) {
- for (uint i = 0; i < totvert; ++i) {
+ for (uint i = 0; i < totvert; i++) {
const MVert *v = &mvert[vert_indices[i]];
GPU_vertbuf_attr_set(buffers->vert_buf, g_vbo_id.pos, i, v->co);
GPU_vertbuf_attr_set(buffers->vert_buf, g_vbo_id.nor, i, v->no);
@@ -319,7 +319,7 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3],
buffers->show_mask = false;
/* Count the number of visible triangles */
- for (i = 0, tottri = 0; i < face_indices_len; ++i) {
+ for (i = 0, tottri = 0; i < face_indices_len; i++) {
const MLoopTri *lt = &looptri[face_indices[i]];
if (!paint_is_face_hidden(lt, mvert, mloop)) {
tottri++;
@@ -352,7 +352,7 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3],
GPU_indexbuf_init(&elb, GPU_PRIM_TRIS, tottri, INT_MAX);
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, tottri * 3, INT_MAX);
- for (i = 0; i < face_indices_len; ++i) {
+ for (i = 0; i < face_indices_len; i++) {
const MLoopTri *lt = &looptri[face_indices[i]];
/* Skip hidden faces */
@@ -376,7 +376,7 @@ GPU_PBVH_Buffers *GPU_pbvh_mesh_buffers_build(const int (*face_vert_indices)[3],
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, tottri * 3, INT_MAX);
int vert_idx = 0;
- for (i = 0; i < face_indices_len; ++i) {
+ for (i = 0; i < face_indices_len; i++) {
const MLoopTri *lt = &looptri[face_indices[i]];
/* Skip hidden faces */
@@ -431,8 +431,8 @@ static void gpu_pbvh_grid_fill_index_buffers(
BLI_bitmap *gh = buffers->grid_hidden[grid_indices[i]];
- for (int j = 0; j < gridsize - 1; ++j) {
- for (int k = 0; k < gridsize - 1; ++k) {
+ for (int j = 0; j < gridsize - 1; j++) {
+ for (int k = 0; k < gridsize - 1; k++) {
/* Skip hidden grid face */
if (gh && paint_is_grid_face_hidden(gh, gridsize, k, j)) {
continue;
@@ -589,7 +589,7 @@ void GPU_pbvh_grid_buffers_update(GPU_PBVH_Buffers *buffers,
GPU_indexbuf_init(&elb_lines, GPU_PRIM_LINES, totgrid * key->grid_area * 2, vert_count);
}
- for (i = 0; i < totgrid; ++i) {
+ for (i = 0; i < totgrid; i++) {
CCGElem *grid = grids[grid_indices[i]];
int vbo_index = vbo_index_offset;
diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c
index 5a2b2b254a7..8b68bcd5889 100644
--- a/source/blender/gpu/intern/gpu_codegen.c
+++ b/source/blender/gpu/intern/gpu_codegen.c
@@ -2129,7 +2129,7 @@ static int count_active_texture_sampler(GPUShader *shader, char *source)
}
/* Catch duplicates. */
bool is_duplicate = false;
- for (int i = 0; i < sampler_len; ++i) {
+ for (int i = 0; i < sampler_len; i++) {
if (samplers_id[i] == id) {
is_duplicate = true;
}
diff --git a/source/blender/gpu/intern/gpu_draw.c b/source/blender/gpu/intern/gpu_draw.c
index 859b1e4a10d..94028d706df 100644
--- a/source/blender/gpu/intern/gpu_draw.c
+++ b/source/blender/gpu/intern/gpu_draw.c
@@ -794,7 +794,7 @@ bool GPU_upload_dxt_texture(ImBuf *ibuf, bool use_srgb)
}
blocksize = (ibuf->dds_data.fourcc == FOURCC_DXT1) ? 8 : 16;
- for (i = 0; i < ibuf->dds_data.nummipmaps && (width || height); ++i) {
+ for (i = 0; i < ibuf->dds_data.nummipmaps && (width || height); i++) {
if (width == 0) {
width = 1;
}
diff --git a/source/blender/gpu/intern/gpu_element.c b/source/blender/gpu/intern/gpu_element.c
index 3f3f246d6d9..166a6236893 100644
--- a/source/blender/gpu/intern/gpu_element.c
+++ b/source/blender/gpu/intern/gpu_element.c
@@ -269,7 +269,7 @@ static uint index_range(const uint values[], uint value_len, uint *min_out, uint
}
uint min_value = RESTART_INDEX;
uint max_value = 0;
- for (uint i = 0; i < value_len; ++i) {
+ for (uint i = 0; i < value_len; i++) {
const uint value = values[i];
if (value == RESTART_INDEX) {
continue;
@@ -307,13 +307,13 @@ static void squeeze_indices_short(GPUIndexBufBuilder *builder,
if (max_index >= 0xFFFF) {
elem->base_index = min_index;
- for (uint i = 0; i < index_len; ++i) {
+ for (uint i = 0; i < index_len; i++) {
data[i] = (values[i] == RESTART_INDEX) ? 0xFFFF : (GLushort)(values[i] - min_index);
}
}
else {
elem->base_index = 0;
- for (uint i = 0; i < index_len; ++i) {
+ for (uint i = 0; i < index_len; i++) {
data[i] = (GLushort)(values[i]);
}
}
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index 2930b6d13cc..45b4b2adc64 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -332,7 +332,7 @@ void GPU_framebuffer_config_array(GPUFrameBuffer *fb, const GPUAttachment *confi
}
int slot = 0;
- for (int i = 1; i < config_len; ++i, ++slot) {
+ for (int i = 1; i < config_len; i++, slot++) {
if (config[i].tex != NULL) {
BLI_assert(GPU_texture_depth(config[i].tex) == false);
gpu_framebuffer_texture_attach_ex(fb, config[i].tex, slot, config[i].layer, config[i].mip);
@@ -386,7 +386,7 @@ static void gpu_framebuffer_update_attachments(GPUFrameBuffer *fb)
BLI_assert(GPU_framebuffer_active_get() == fb);
/* Update attachments */
- for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; ++type) {
+ for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; type++) {
if (type >= GPU_FB_COLOR_ATTACHMENT0) {
if (fb->attachments[type].tex) {
@@ -757,7 +757,7 @@ void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb,
current_dim[0] = max_ii(current_dim[0] / 2, 1);
current_dim[1] = max_ii(current_dim[1] / 2, 1);
- for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; ++type) {
+ for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; type++) {
if (fb->attachments[type].tex != NULL) {
/* Some Intel HDXXX have issue with rendering to a mipmap that is below
* the texture GL_TEXTURE_MAX_LEVEL. So even if it not correct, in this case
@@ -786,7 +786,7 @@ void GPU_framebuffer_recursive_downsample(GPUFrameBuffer *fb,
}
}
- for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; ++type) {
+ for (GPUAttachmentType type = 0; type < GPU_FB_MAX_ATTACHEMENT; type++) {
if (fb->attachments[type].tex != NULL) {
/* reset mipmap level range */
GPUTexture *tex = fb->attachments[type].tex;
diff --git a/source/blender/gpu/intern/gpu_immediate.c b/source/blender/gpu/intern/gpu_immediate.c
index 938deadaa13..bed7ab25bb9 100644
--- a/source/blender/gpu/intern/gpu_immediate.c
+++ b/source/blender/gpu/intern/gpu_immediate.c
@@ -308,7 +308,7 @@ static void immDrawSetup(void)
/* Enable/Disable vertex attributes as needed. */
if (imm.attr_binding.enabled_bits != imm.prev_enabled_attr_bits) {
- for (uint loc = 0; loc < GPU_VERT_ATTR_MAX_LEN; ++loc) {
+ for (uint loc = 0; loc < GPU_VERT_ATTR_MAX_LEN; loc++) {
bool is_enabled = imm.attr_binding.enabled_bits & (1 << loc);
bool was_enabled = imm.prev_enabled_attr_bits & (1 << loc);
@@ -325,7 +325,7 @@ static void immDrawSetup(void)
const uint stride = imm.vertex_format.stride;
- for (uint a_idx = 0; a_idx < imm.vertex_format.attr_len; ++a_idx) {
+ for (uint a_idx = 0; a_idx < imm.vertex_format.attr_len; a_idx++) {
const GPUVertAttr *a = &imm.vertex_format.attrs[a_idx];
const uint offset = imm.buffer_offset + a->offset;
@@ -650,7 +650,7 @@ static void immEndVertex(void) /* and move on to the next vertex */
#if TRUST_NO_ONE
assert(imm.vertex_idx > 0); /* first vertex must have all attributes specified */
#endif
- for (uint a_idx = 0; a_idx < imm.vertex_format.attr_len; ++a_idx) {
+ for (uint a_idx = 0; a_idx < imm.vertex_format.attr_len; a_idx++) {
if ((imm.unassigned_attr_bits >> a_idx) & 1) {
const GPUVertAttr *a = &imm.vertex_format.attrs[a_idx];
diff --git a/source/blender/gpu/intern/gpu_immediate_util.c b/source/blender/gpu/intern/gpu_immediate_util.c
index ca0c2506750..59ceeade725 100644
--- a/source/blender/gpu/intern/gpu_immediate_util.c
+++ b/source/blender/gpu/intern/gpu_immediate_util.c
@@ -167,7 +167,7 @@ static void imm_draw_circle(GPUPrimType prim_type,
int nsegments)
{
immBegin(prim_type, nsegments);
- for (int i = 0; i < nsegments; ++i) {
+ for (int i = 0; i < nsegments; i++) {
const float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
immVertex2f(shdr_pos, x + (rad_x * cosf(angle)), y + (rad_y * sinf(angle)));
}
@@ -229,7 +229,7 @@ static void imm_draw_circle_partial(GPUPrimType prim_type,
const float angle_end = -(DEG2RADF(sweep) - angle_start);
nsegments += 1;
immBegin(prim_type, nsegments);
- for (int i = 0; i < nsegments; ++i) {
+ for (int i = 0; i < nsegments; i++) {
const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
const float angle_sin = sinf(angle);
const float angle_cos = cosf(angle);
@@ -263,7 +263,7 @@ static void imm_draw_disk_partial(GPUPrimType prim_type,
const float angle_end = -(DEG2RADF(sweep) - angle_start);
nsegments += 1;
immBegin(prim_type, nsegments * 2);
- for (int i = 0; i < nsegments; ++i) {
+ for (int i = 0; i < nsegments; i++) {
const float angle = interpf(angle_start, angle_end, ((float)i / (float)(nsegments - 1)));
const float angle_sin = sinf(angle);
const float angle_cos = cosf(angle);
@@ -305,7 +305,7 @@ static void imm_draw_circle_3D(
GPUPrimType prim_type, uint pos, float x, float y, float rad, int nsegments)
{
immBegin(prim_type, nsegments);
- for (int i = 0; i < nsegments; ++i) {
+ for (int i = 0; i < nsegments; i++) {
float angle = (float)(2 * M_PI) * ((float)i / (float)nsegments);
immVertex3f(pos, x + rad * cosf(angle), y + rad * sinf(angle), 0.0f);
}
@@ -422,7 +422,7 @@ void imm_draw_cylinder_fill_normal_3d(
uint pos, uint nor, float base, float top, float height, int slices, int stacks)
{
immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
- for (int i = 0; i < slices; ++i) {
+ for (int i = 0; i < slices; i++) {
const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
const float cos1 = cosf(angle1);
@@ -430,7 +430,7 @@ void imm_draw_cylinder_fill_normal_3d(
const float cos2 = cosf(angle2);
const float sin2 = sinf(angle2);
- for (int j = 0; j < stacks; ++j) {
+ for (int j = 0; j < stacks; j++) {
float fac1 = (float)j / (float)stacks;
float fac2 = (float)(j + 1) / (float)stacks;
float r1 = base * (1.f - fac1) + top * fac1;
@@ -478,7 +478,7 @@ void imm_draw_cylinder_wire_3d(
uint pos, float base, float top, float height, int slices, int stacks)
{
immBegin(GPU_PRIM_LINES, 6 * slices * stacks);
- for (int i = 0; i < slices; ++i) {
+ for (int i = 0; i < slices; i++) {
const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
const float cos1 = cosf(angle1);
@@ -486,7 +486,7 @@ void imm_draw_cylinder_wire_3d(
const float cos2 = cosf(angle2);
const float sin2 = sinf(angle2);
- for (int j = 0; j < stacks; ++j) {
+ for (int j = 0; j < stacks; j++) {
float fac1 = (float)j / (float)stacks;
float fac2 = (float)(j + 1) / (float)stacks;
float r1 = base * (1.f - fac1) + top * fac1;
@@ -516,7 +516,7 @@ void imm_draw_cylinder_fill_3d(
uint pos, float base, float top, float height, int slices, int stacks)
{
immBegin(GPU_PRIM_TRIS, 6 * slices * stacks);
- for (int i = 0; i < slices; ++i) {
+ for (int i = 0; i < slices; i++) {
const float angle1 = (float)(2 * M_PI) * ((float)i / (float)slices);
const float angle2 = (float)(2 * M_PI) * ((float)(i + 1) / (float)slices);
const float cos1 = cosf(angle1);
@@ -524,7 +524,7 @@ void imm_draw_cylinder_fill_3d(
const float cos2 = cosf(angle2);
const float sin2 = sinf(angle2);
- for (int j = 0; j < stacks; ++j) {
+ for (int j = 0; j < stacks; j++) {
float fac1 = (float)j / (float)stacks;
float fac2 = (float)(j + 1) / (float)stacks;
float r1 = base * (1.f - fac1) + top * fac1;
diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c
index 05d991105c0..7e254d802f0 100644
--- a/source/blender/gpu/intern/gpu_material.c
+++ b/source/blender/gpu/intern/gpu_material.c
@@ -333,7 +333,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne
const float step = range / INTEGRAL_RESOLUTION;
float integral = 0.0f;
- for (int i = 0; i < INTEGRAL_RESOLUTION; ++i) {
+ for (int i = 0; i < INTEGRAL_RESOLUTION; i++) {
float x = x0 + range * ((float)i + 0.5f) / (float)INTEGRAL_RESOLUTION;
float y = eval_profile(x, falloff_type, sharpness, param);
integral += y * step;
@@ -414,7 +414,7 @@ static void compute_sss_kernel(
sum[2] += kd->kernel[i][2];
}
- for (int i = 0; i < 3; ++i) {
+ for (int i = 0; i < 3; i++) {
if (sum[i] > 0.0f) {
/* Normalize */
for (int j = 0; j < sample_len; j++) {
@@ -450,7 +450,7 @@ static void compute_sss_translucence_kernel(const GPUSssKernelData *kd,
*output = (float *)texels;
/* Last texel should be black, hence the - 1. */
- for (int i = 0; i < resolution - 1; ++i) {
+ for (int i = 0; i < resolution - 1; i++) {
/* Distance from surface. */
float d = kd->max_radius * ((float)i + 0.00001f) / ((float)resolution);
diff --git a/source/blender/gpu/intern/gpu_shader_interface.c b/source/blender/gpu/intern/gpu_shader_interface.c
index f205ef31ed2..083c5bf2b60 100644
--- a/source/blender/gpu/intern/gpu_shader_interface.c
+++ b/source/blender/gpu/intern/gpu_shader_interface.c
@@ -149,7 +149,7 @@ GPU_INLINE const GPUShaderInput *buckets_lookup(
GPU_INLINE void buckets_free(GPUShaderInput *buckets[GPU_NUM_SHADERINTERFACE_BUCKETS])
{
- for (uint bucket_index = 0; bucket_index < GPU_NUM_SHADERINTERFACE_BUCKETS; ++bucket_index) {
+ for (uint bucket_index = 0; bucket_index < GPU_NUM_SHADERINTERFACE_BUCKETS; bucket_index++) {
GPUShaderInput *input = buckets[bucket_index];
while (input != NULL) {
GPUShaderInput *input_next = input->next;
@@ -164,7 +164,7 @@ static bool setup_builtin_uniform(GPUShaderInput *input, const char *name)
/* TODO: reject DOUBLE, IMAGE, ATOMIC_COUNTER gl_types */
/* detect built-in uniforms (name must match) */
- for (GPUUniformBuiltin u = GPU_UNIFORM_NONE + 1; u < GPU_UNIFORM_CUSTOM; ++u) {
+ for (GPUUniformBuiltin u = GPU_UNIFORM_NONE + 1; u < GPU_UNIFORM_CUSTOM; u++) {
const char *builtin_name = BuiltinUniform_name(u);
if (match(name, builtin_name)) {
input->builtin_type = u;
@@ -236,7 +236,7 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t program)
shaderface->name_buffer = MEM_mallocN(name_buffer_len, "name_buffer");
/* Attributes */
- for (uint32_t i = 0; i < attr_len; ++i) {
+ for (uint32_t i = 0; i < attr_len; i++) {
GPUShaderInput *input = MEM_mallocN(sizeof(GPUShaderInput), "GPUShaderInput Attr");
GLsizei remaining_buffer = name_buffer_len - shaderface->name_buffer_offset;
char *name = shaderface->name_buffer + shaderface->name_buffer_offset;
@@ -264,7 +264,7 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t program)
#endif
}
/* Uniform Blocks */
- for (uint32_t i = 0; i < ubo_len; ++i) {
+ for (uint32_t i = 0; i < ubo_len; i++) {
GPUShaderInput *input = MEM_mallocN(sizeof(GPUShaderInput), "GPUShaderInput UBO");
GLsizei remaining_buffer = name_buffer_len - shaderface->name_buffer_offset;
char *name = shaderface->name_buffer + shaderface->name_buffer_offset;
@@ -283,7 +283,7 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t program)
#endif
}
/* Builtin Uniforms */
- for (GPUUniformBuiltin u = GPU_UNIFORM_NONE + 1; u < GPU_UNIFORM_CUSTOM; ++u) {
+ for (GPUUniformBuiltin u = GPU_UNIFORM_NONE + 1; u < GPU_UNIFORM_CUSTOM; u++) {
const char *builtin_name = BuiltinUniform_name(u);
if (glGetUniformLocation(program, builtin_name) != -1) {
add_uniform((GPUShaderInterface *)shaderface, builtin_name);
@@ -306,7 +306,7 @@ void GPU_shaderinterface_discard(GPUShaderInterface *shaderface)
/* Free memory used by name_buffer. */
MEM_freeN(shaderface->name_buffer);
/* Remove this interface from all linked Batches vao cache. */
- for (int i = 0; i < shaderface->batches_len; ++i) {
+ for (int i = 0; i < shaderface->batches_len; i++) {
if (shaderface->batches[i] != NULL) {
gpu_batch_remove_interface_ref(shaderface->batches[i], shaderface);
}
@@ -374,7 +374,7 @@ const GPUShaderInput *GPU_shaderinterface_attr(const GPUShaderInterface *shaderf
void GPU_shaderinterface_add_batch_ref(GPUShaderInterface *shaderface, GPUBatch *batch)
{
int i; /* find first unused slot */
- for (i = 0; i < shaderface->batches_len; ++i) {
+ for (i = 0; i < shaderface->batches_len; i++) {
if (shaderface->batches[i] == NULL) {
break;
}
@@ -391,7 +391,7 @@ void GPU_shaderinterface_add_batch_ref(GPUShaderInterface *shaderface, GPUBatch
void GPU_shaderinterface_remove_batch_ref(GPUShaderInterface *shaderface, GPUBatch *batch)
{
- for (int i = 0; i < shaderface->batches_len; ++i) {
+ for (int i = 0; i < shaderface->batches_len; i++) {
if (shaderface->batches[i] == batch) {
shaderface->batches[i] = NULL;
break; /* cannot have duplicates */
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 955b11036ef..a54d90f37f5 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1471,7 +1471,7 @@ void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat gpu_data_format, int mipl
if (GPU_texture_cube(tex)) {
int cube_face_size = buf_size / 6;
- for (int i = 0; i < 6; ++i) {
+ for (int i = 0; i < 6; i++) {
glGetTexImage(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
miplvl,
data_format,
@@ -1540,7 +1540,7 @@ void GPU_texture_bind(GPUTexture *tex, int number)
}
if ((G.debug & G_DEBUG)) {
- for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; ++i) {
+ for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; i++) {
if (tex->fb[i] && GPU_framebuffer_bound(tex->fb[i])) {
fprintf(stderr,
"Feedback loop warning!: Attempting to bind "
@@ -1603,7 +1603,7 @@ void GPU_texture_generate_mipmap(GPUTexture *tex)
* GPU_framebuffer_recursive_downsample(). */
int levels = 1 + floor(log2(max_ii(tex->w, tex->h)));
eGPUDataFormat data_format = gpu_get_data_format_from_tex_format(tex->format);
- for (int i = 1; i < levels; ++i) {
+ for (int i = 1; i < levels; i++) {
GPU_texture_add_mipmap(tex, data_format, i, NULL);
}
glBindTexture(tex->target, tex->bindcode);
@@ -1712,7 +1712,7 @@ void GPU_texture_free(GPUTexture *tex)
}
if (tex->refcount == 0) {
- for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; ++i) {
+ for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; i++) {
if (tex->fb[i] != NULL) {
GPU_framebuffer_texture_detach_slot(tex->fb[i], tex, tex->fb_attachment[i]);
}
@@ -1806,7 +1806,7 @@ int GPU_texture_opengl_bindcode(const GPUTexture *tex)
void GPU_texture_attach_framebuffer(GPUTexture *tex, GPUFrameBuffer *fb, int attachment)
{
- for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; ++i) {
+ for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; i++) {
if (tex->fb[i] == NULL) {
tex->fb[i] = fb;
tex->fb_attachment[i] = attachment;
@@ -1820,7 +1820,7 @@ void GPU_texture_attach_framebuffer(GPUTexture *tex, GPUFrameBuffer *fb, int att
/* Return previous attachment point */
int GPU_texture_detach_framebuffer(GPUTexture *tex, GPUFrameBuffer *fb)
{
- for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; ++i) {
+ for (int i = 0; i < GPU_TEX_MAX_FBO_ATTACHED; i++) {
if (tex->fb[i] == fb) {
tex->fb[i] = NULL;
return tex->fb_attachment[i];
diff --git a/source/blender/gpu/intern/gpu_vertex_buffer.c b/source/blender/gpu/intern/gpu_vertex_buffer.c
index 2f854fe03ea..eecbcb9ec94 100644
--- a/source/blender/gpu/intern/gpu_vertex_buffer.c
+++ b/source/blender/gpu/intern/gpu_vertex_buffer.c
@@ -214,7 +214,7 @@ void GPU_vertbuf_attr_fill_stride(GPUVertBuf *verts, uint a_idx, uint stride, co
}
else {
/* we must copy it per vertex */
- for (uint v = 0; v < vertex_len; ++v) {
+ for (uint v = 0; v < vertex_len; v++) {
memcpy((GLubyte *)verts->data + a->offset + v * format->stride,
(const GLubyte *)data + v * stride,
a->sz);
diff --git a/source/blender/gpu/intern/gpu_vertex_format.c b/source/blender/gpu/intern/gpu_vertex_format.c
index 66e5e254734..65573b71c76 100644
--- a/source/blender/gpu/intern/gpu_vertex_format.c
+++ b/source/blender/gpu/intern/gpu_vertex_format.c
@@ -126,7 +126,7 @@ static uchar copy_attr_name(GPUVertFormat *format, const char *name)
uint available = GPU_VERT_ATTR_NAMES_BUF_LEN - name_offset;
bool terminated = false;
- for (uint i = 0; i < available; ++i) {
+ for (uint i = 0; i < available; i++) {
const char c = name[i];
name_copy[i] = c;
if (c == '\0') {
@@ -303,10 +303,10 @@ uint padding(uint offset, uint alignment)
static void show_pack(uint a_idx, uint sz, uint pad)
{
const char c = 'A' + a_idx;
- for (uint i = 0; i < pad; ++i) {
+ for (uint i = 0; i < pad; i++) {
putchar('-');
}
- for (uint i = 0; i < sz; ++i) {
+ for (uint i = 0; i < sz; i++) {
putchar(c);
}
}
@@ -330,7 +330,7 @@ void VertexFormat_pack(GPUVertFormat *format)
show_pack(0, a0->sz, 0);
#endif
- for (uint a_idx = 1; a_idx < format->attr_len; ++a_idx) {
+ for (uint a_idx = 1; a_idx < format->attr_len; a_idx++) {
GPUVertAttr *a = &format->attrs[a_idx];
uint mid_padding = padding(offset, attr_align(a));
offset += mid_padding;
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index e3c13b0ec14..d886ae638e3 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -303,7 +303,7 @@ GPUTexture *GPU_viewport_texture_pool_query(
(GPU_texture_width(tmp_tex->texture) == width) &&
(GPU_texture_height(tmp_tex->texture) == height)) {
/* Search if the engine is not already using this texture */
- for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; ++i) {
+ for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; i++) {
if (tmp_tex->user[i] == engine) {
break;
}
@@ -339,7 +339,7 @@ static void gpu_viewport_texture_pool_clear_users(GPUViewport *viewport)
for (ViewportTempTexture *tmp_tex = viewport->tex_pool.first; tmp_tex; tmp_tex = tmp_tex_next) {
tmp_tex_next = tmp_tex->next;
bool no_user = true;
- for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; ++i) {
+ for (int i = 0; i < MAX_ENGINE_BUFFER_SHARING; i++) {
if (tmp_tex->user[i] != NULL) {
tmp_tex->user[i] = NULL;
no_user = false;
diff --git a/source/blender/gpu/shaders/gpu_shader_geometry.glsl b/source/blender/gpu/shaders/gpu_shader_geometry.glsl
index f62040589e5..3b4e2e17ccc 100644
--- a/source/blender/gpu/shaders/gpu_shader_geometry.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_geometry.glsl
@@ -24,7 +24,7 @@ uniform int osd_fvar_count;
{ \
vec2 v[4]; \
int primOffset = (gl_PrimitiveID + PrimitiveIdBase) * 4; \
- for (int i = 0; i < 4; ++i) { \
+ for (int i = 0; i < 4; i++) { \
int index = (primOffset + i) * osd_fvar_count + fvarOffset; \
v[i] = vec2(texelFetch(FVarDataBuffer, index).s, texelFetch(FVarDataBuffer, index + 1).s); \
} \
diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp
index 2ceedca59f7..1ac9cd2223a 100644
--- a/source/blender/ikplugin/intern/itasc_plugin.cpp
+++ b/source/blender/ikplugin/intern/itasc_plugin.cpp
@@ -201,7 +201,7 @@ struct IK_Scene {
if (scene) {
delete scene;
}
- for (std::vector<IK_Target *>::iterator it = targets.begin(); it != targets.end(); ++it) {
+ for (std::vector<IK_Target *>::iterator it = targets.begin(); it != targets.end(); it++) {
delete (*it);
}
targets.clear();
@@ -795,7 +795,7 @@ static void copypose_error(const iTaSC::ConstraintValues *values,
if (iktarget->controlType & iTaSC::CopyPose::CTL_POSITION) {
// update error
- for (i = 0, error = 0.0, value = values->values; i < values->number; ++i, ++value) {
+ for (i = 0, error = 0.0, value = values->values; i < values->number; i++, value++) {
error += KDL::sqr(value->y - value->yd);
}
iktarget->blenderConstraint->lin_error = (float)KDL::sqrt(error);
@@ -803,7 +803,7 @@ static void copypose_error(const iTaSC::ConstraintValues *values,
}
if (iktarget->controlType & iTaSC::CopyPose::CTL_ROTATION) {
// update error
- for (i = 0, error = 0.0, value = values->values; i < values->number; ++i, ++value) {
+ for (i = 0, error = 0.0, value = values->values; i < values->number; i++, value++) {
error += KDL::sqr(value->y - value->yd);
}
iktarget->blenderConstraint->rot_error = (float)KDL::sqrt(error);
@@ -966,7 +966,7 @@ static int convert_channels(struct Depsgraph *depsgraph,
int a, flag, njoint;
njoint = 0;
- for (a = 0, ikchan = ikscene->channels; a < ikscene->numchan; ++a, ++ikchan) {
+ for (a = 0, ikchan = ikscene->channels; a < ikscene->numchan; a++, ikchan++) {
pchan = tree->pchan[a];
ikchan->pchan = pchan;
ikchan->parent = (a > 0) ? tree->parent[a] : -1;
@@ -1106,7 +1106,7 @@ static void convert_pose(IK_Scene *ikscene)
rot = ikscene->jointArray(0);
for (joint = a = 0, ikchan = ikscene->channels;
a < ikscene->numchan && joint < ikscene->numjoint;
- ++a, ++ikchan) {
+ a++, ikchan++) {
pchan = ikchan->pchan;
bone = pchan->bone;
@@ -1149,7 +1149,7 @@ static void BKE_pose_rest(IK_Scene *ikscene)
rot = ikscene->jointArray(0);
for (joint = a = 0, ikchan = ikscene->channels;
a < ikscene->numchan && joint < ikscene->numjoint;
- ++a, ++ikchan) {
+ a++, ikchan++) {
pchan = ikchan->pchan;
bone = pchan->bone;
@@ -1234,7 +1234,7 @@ static IK_Scene *convert_tree(
BKE_pose_rest(ikscene);
rot = ikscene->jointArray(0);
- for (a = 0, ikchan = ikscene->channels; a < tree->totchannel; ++a, ++ikchan) {
+ for (a = 0, ikchan = ikscene->channels; a < tree->totchannel; a++, ikchan++) {
pchan = ikchan->pchan;
bone = pchan->bone;
@@ -1728,7 +1728,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
int i;
IK_Channel *ikchan;
if (ikparam->flag & ITASC_SIMULATION) {
- for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ++ikchan) {
+ for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ikchan++) {
// In simulation mode we don't allow external constraint to change our bones,
// mark the channel done also tell Blender that this channel is part of IK tree.
// Cleared on each BKE_pose_where_is()
@@ -1738,7 +1738,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
}
else {
// in animation mode, we must get the bone position from action and constraints
- for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ++ikchan) {
+ for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ikchan++) {
if (!(ikchan->pchan->flag & POSE_DONE)) {
BKE_pose_where_is_bone(depsgraph, blscene, ikscene->blArmature, ikchan->pchan, ctime, 1);
}
@@ -1749,7 +1749,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
}
}
// only run execute the scene if at least one of our target is enabled
- for (i = ikscene->targets.size(); i > 0; --i) {
+ for (i = ikscene->targets.size(); i > 0; i--) {
IK_Target *iktarget = ikscene->targets[i - 1];
if (!(iktarget->blenderConstraint->flag & CONSTRAINT_OFF)) {
break;
@@ -1816,7 +1816,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
}
}
// compute constraint error
- for (i = ikscene->targets.size(); i > 0; --i) {
+ for (i = ikscene->targets.size(); i > 0; i--) {
IK_Target *iktarget = ikscene->targets[i - 1];
if (!(iktarget->blenderConstraint->flag & CONSTRAINT_OFF) && iktarget->constraint) {
unsigned int nvalues;
@@ -1840,7 +1840,7 @@ static void execute_scene(struct Depsgraph *depsgraph,
float scale;
float length;
float yaxis[3];
- for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; ++i, ++ikchan) {
+ for (i = 0, ikchan = ikscene->channels; i < ikscene->numchan; i++, ikchan++) {
if (i == 0) {
if (!arm->getRelativeFrame(frame, ikchan->tail)) {
break;
diff --git a/source/blender/imbuf/intern/dds/FlipDXT.cpp b/source/blender/imbuf/intern/dds/FlipDXT.cpp
index cf228cea3ea..bfd19f40493 100644
--- a/source/blender/imbuf/intern/dds/FlipDXT.cpp
+++ b/source/blender/imbuf/intern/dds/FlipDXT.cpp
@@ -208,7 +208,7 @@ int FlipDXTCImage(
unsigned int mip_width = width;
unsigned int mip_height = height;
- for (unsigned int i = 0; i < levels; ++i) {
+ for (unsigned int i = 0; i < levels; i++) {
unsigned int blocks_per_row = (mip_width + 3) / 4;
unsigned int blocks_per_col = (mip_height + 3) / 4;
unsigned int blocks = blocks_per_row * blocks_per_col;
@@ -219,13 +219,13 @@ int FlipDXTCImage(
}
else if (mip_height == 2) {
// flip the first 2 lines in each block.
- for (unsigned int i = 0; i < blocks_per_row; ++i) {
+ for (unsigned int i = 0; i < blocks_per_row; i++) {
half_block_function(data + i * block_bytes);
}
}
else {
// flip each block.
- for (unsigned int i = 0; i < blocks; ++i) {
+ for (unsigned int i = 0; i < blocks; i++) {
full_block_function(data + i * block_bytes);
}
@@ -235,7 +235,7 @@ int FlipDXTCImage(
unsigned int row_bytes = block_bytes * blocks_per_row;
uint8_t *temp_line = new uint8_t[row_bytes];
- for (unsigned int y = 0; y < blocks_per_col / 2; ++y) {
+ for (unsigned int y = 0; y < blocks_per_col / 2; y++) {
uint8_t *line1 = data + y * row_bytes;
uint8_t *line2 = data + (blocks_per_col - y - 1) * row_bytes;
diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c
index dd31dafd148..66e0a681f8f 100644
--- a/source/blender/imbuf/intern/indexer.c
+++ b/source/blender/imbuf/intern/indexer.c
@@ -1150,7 +1150,7 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim,
/* Don't generate the same file twice! */
if (file_list) {
- for (i = 0; i < IMB_PROXY_MAX_SLOT; ++i) {
+ for (i = 0; i < IMB_PROXY_MAX_SLOT; i++) {
IMB_Proxy_Size proxy_size = proxy_sizes[i];
if (proxy_size & proxy_sizes_to_build) {
char filename[FILE_MAX];
@@ -1172,7 +1172,7 @@ IndexBuildContext *IMB_anim_index_rebuild_context(struct anim *anim,
IMB_Proxy_Size built_proxies = IMB_anim_proxy_get_existing(anim);
if (built_proxies != 0) {
- for (i = 0; i < IMB_PROXY_MAX_SLOT; ++i) {
+ for (i = 0; i < IMB_PROXY_MAX_SLOT; i++) {
IMB_Proxy_Size proxy_size = proxy_sizes[i];
if (proxy_size & built_proxies) {
char filename[FILE_MAX];
@@ -1345,7 +1345,7 @@ IMB_Proxy_Size IMB_anim_proxy_get_existing(struct anim *anim)
const int num_proxy_sizes = IMB_PROXY_MAX_SLOT;
IMB_Proxy_Size existing = 0;
int i;
- for (i = 0; i < num_proxy_sizes; ++i) {
+ for (i = 0; i < num_proxy_sizes; i++) {
IMB_Proxy_Size proxy_size = proxy_sizes[i];
char filename[FILE_MAX];
get_proxy_filename(anim, proxy_size, filename, false);
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index f18eb2f7303..41db874c2b2 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -718,7 +718,7 @@ void IMB_exr_add_view(void *handle, const char *name)
static int imb_exr_get_multiView_id(StringVector &views, const std::string &name)
{
int count = 0;
- for (StringVector::const_iterator i = views.begin(); count < views.size(); ++i) {
+ for (StringVector::const_iterator i = views.begin(); count < views.size(); i++) {
if (name == *i) {
return count;
}
@@ -736,7 +736,7 @@ static void imb_exr_get_views(MultiPartInputFile &file, StringVector &views)
if (exr_has_multipart_file(file) == false) {
if (exr_has_multiview(file)) {
StringVector sv = multiView(file.header(0));
- for (StringVector::const_iterator i = sv.begin(); i != sv.end(); ++i) {
+ for (StringVector::const_iterator i = sv.begin(); i != sv.end(); i++) {
views.push_back(*i);
}
}
@@ -1118,7 +1118,7 @@ void IMB_exr_write_channels(void *handle)
if (echan->use_half_float) {
float *rect = echan->rect;
half *cur = current_rect_half;
- for (size_t i = 0; i < num_pixels; ++i, ++cur) {
+ for (size_t i = 0; i < num_pixels; i++, cur++) {
*cur = rect[i * echan->xstride];
}
half *rect_to_write = current_rect_half + (data->height - 1L) * data->width;
@@ -1686,7 +1686,7 @@ static void exr_print_filecontents(MultiPartInputFile &file)
const StringVector views = multiView(file.header(0));
printf("OpenEXR-load: MultiView file\n");
printf("OpenEXR-load: Default view: %s\n", defaultViewName(views).c_str());
- for (StringVector::const_iterator i = views.begin(); i != views.end(); ++i) {
+ for (StringVector::const_iterator i = views.begin(); i != views.end(); i++) {
printf("OpenEXR-load: Found view %s\n", (*i).c_str());
}
}
@@ -1701,7 +1701,7 @@ static void exr_print_filecontents(MultiPartInputFile &file)
for (int j = 0; j < numparts; j++) {
const ChannelList &channels = file.header(j).channels();
- for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) {
+ for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) {
const Channel &channel = i.channel();
printf("OpenEXR-load: Found channel %s of type %d\n", i.name(), channel.type);
}
@@ -1713,7 +1713,7 @@ static const char *exr_rgba_channelname(MultiPartInputFile &file, const char *ch
{
const ChannelList &channels = file.header(0).channels();
- for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) {
+ for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); i++) {
/* const Channel &channel = i.channel(); */ /* Not used yet */
const char *str = i.name();
int len = strlen(str);
@@ -2013,7 +2013,7 @@ struct ImBuf *imb_load_openexr(const unsigned char *mem,
if (!has_rgb && has_luma) {
size_t a;
if (exr_has_chroma(*file)) {
- for (a = 0; a < (size_t)ibuf->x * ibuf->y; ++a) {
+ for (a = 0; a < (size_t)ibuf->x * ibuf->y; a++) {
float *color = ibuf->rect_float + a * 4;
ycc_to_rgb(color[0] * 255.0f,
color[1] * 255.0f,
@@ -2025,7 +2025,7 @@ struct ImBuf *imb_load_openexr(const unsigned char *mem,
}
}
else {
- for (a = 0; a < (size_t)ibuf->x * ibuf->y; ++a) {
+ for (a = 0; a < (size_t)ibuf->x * ibuf->y; a++) {
float *color = ibuf->rect_float + a * 4;
color[1] = color[2] = color[0];
}
diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c
index f7b7df52e46..b1077a6ae91 100644
--- a/source/blender/imbuf/intern/targa.c
+++ b/source/blender/imbuf/intern/targa.c
@@ -748,7 +748,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem,
if (cmap) {
/* apply color map */
rect = ibuf->rect;
- for (size = ibuf->x * ibuf->y; size > 0; --size, ++rect) {
+ for (size = ibuf->x * ibuf->y; size > 0; size--, rect++) {
int cmap_index = *rect;
if (cmap_index >= 0 && cmap_index < cmap_max) {
*rect = cmap[cmap_index];
@@ -761,7 +761,7 @@ ImBuf *imb_loadtarga(const unsigned char *mem,
if (tga.pixsize == 16) {
unsigned int col;
rect = ibuf->rect;
- for (size = ibuf->x * ibuf->y; size > 0; --size, ++rect) {
+ for (size = ibuf->x * ibuf->y; size > 0; size--, rect++) {
col = *rect;
cp = (uchar *)rect;
mem = (uchar *)&col;
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index 7587b486118..0598f4807ec 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -266,7 +266,7 @@ int rna_node_tree_type_to_enum(bNodeTreeType *typeinfo)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_TREE_TYPES_END;
return result;
@@ -280,7 +280,7 @@ int rna_node_tree_idname_to_enum(const char *idname)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_TREE_TYPES_END;
return result;
@@ -295,7 +295,7 @@ bNodeTreeType *rna_node_tree_type_from_enum(int value)
result = nt;
break;
}
- ++i;
+ i++;
}
NODE_TREE_TYPES_END;
return result;
@@ -311,7 +311,7 @@ const EnumPropertyItem *rna_node_tree_type_itemf(void *data,
NODE_TREE_TYPES_BEGIN (nt) {
if (poll && !poll(data, nt)) {
- ++i;
+ i++;
continue;
}
@@ -323,7 +323,7 @@ const EnumPropertyItem *rna_node_tree_type_itemf(void *data,
RNA_enum_item_add(&item, &totitem, &tmp);
- ++i;
+ i++;
}
NODE_TREE_TYPES_END;
@@ -346,7 +346,7 @@ int rna_node_type_to_enum(bNodeType *typeinfo)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_TYPES_END;
return result;
@@ -360,7 +360,7 @@ int rna_node_idname_to_enum(const char *idname)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_TYPES_END;
return result;
@@ -375,7 +375,7 @@ bNodeType *rna_node_type_from_enum(int value)
result = ntype;
break;
}
- ++i;
+ i++;
}
NODE_TYPES_END;
return result;
@@ -391,7 +391,7 @@ const EnumPropertyItem *rna_node_type_itemf(void *data,
NODE_TYPES_BEGIN (ntype) {
if (poll && !poll(data, ntype)) {
- ++i;
+ i++;
continue;
}
@@ -403,7 +403,7 @@ const EnumPropertyItem *rna_node_type_itemf(void *data,
RNA_enum_item_add(&item, &totitem, &tmp);
- ++i;
+ i++;
}
NODE_TYPES_END;
@@ -426,7 +426,7 @@ int rna_node_socket_type_to_enum(bNodeSocketType *typeinfo)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_SOCKET_TYPES_END;
return result;
@@ -440,7 +440,7 @@ int rna_node_socket_idname_to_enum(const char *idname)
result = i;
break;
}
- ++i;
+ i++;
}
NODE_SOCKET_TYPES_END;
return result;
@@ -455,7 +455,7 @@ bNodeSocketType *rna_node_socket_type_from_enum(int value)
result = stype;
break;
}
- ++i;
+ i++;
}
NODE_SOCKET_TYPES_END;
return result;
@@ -472,7 +472,7 @@ const EnumPropertyItem *rna_node_socket_type_itemf(void *data,
NODE_SOCKET_TYPES_BEGIN (stype) {
if (poll && !poll(data, stype)) {
- ++i;
+ i++;
continue;
}
@@ -485,7 +485,7 @@ const EnumPropertyItem *rna_node_socket_type_itemf(void *data,
RNA_enum_item_add(&item, &totitem, &tmp);
- ++i;
+ i++;
}
NODE_SOCKET_TYPES_END;
@@ -2652,8 +2652,8 @@ static PointerRNA rna_NodeInternal_input_template(StructRNA *srna, int index)
bNodeSocketTemplate *stemp = ntype->inputs;
int i = 0;
while (i < index && stemp->type >= 0) {
- ++i;
- ++stemp;
+ i++;
+ stemp++;
}
if (i == index && stemp->type >= 0) {
PointerRNA ptr;
@@ -2671,8 +2671,8 @@ static PointerRNA rna_NodeInternal_output_template(StructRNA *srna, int index)
bNodeSocketTemplate *stemp = ntype->outputs;
int i = 0;
while (i < index && stemp->type >= 0) {
- ++i;
- ++stemp;
+ i++;
+ stemp++;
}
if (i == index && stemp->type >= 0) {
PointerRNA ptr;
diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c
index 1a541f9fc5a..f11e4e4d77a 100644
--- a/source/blender/modifiers/intern/MOD_skin.c
+++ b/source/blender/modifiers/intern/MOD_skin.c
@@ -1518,7 +1518,7 @@ static void skin_update_merged_vertices(SkinNode *skin_nodes, int totvert)
{
int v;
- for (v = 0; v < totvert; ++v) {
+ for (v = 0; v < totvert; v++) {
SkinNode *sn = &skin_nodes[v];
int i, j;
@@ -1566,7 +1566,7 @@ static void skin_output_end_nodes(SkinOutput *so, SkinNode *skin_nodes, int totv
{
int v;
- for (v = 0; v < totvert; ++v) {
+ for (v = 0; v < totvert; v++) {
SkinNode *sn = &skin_nodes[v];
/* Assuming here just two frames */
if (sn->flag & SEAM_FRAME) {
@@ -1769,7 +1769,7 @@ static BMesh *build_skin(SkinNode *skin_nodes,
skin_merge_close_frame_verts(skin_nodes, totvert, emap, medge);
/* Write out all frame vertices to the mesh */
- for (v = 0; v < totvert; ++v) {
+ for (v = 0; v < totvert; v++) {
if (skin_nodes[v].totframe) {
output_frames(so.bm, &skin_nodes[v], input_dvert ? &input_dvert[v] : NULL);
}
diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c
index e7acbd3e32e..98497a76668 100644
--- a/source/blender/modifiers/intern/MOD_util.c
+++ b/source/blender/modifiers/intern/MOD_util.c
@@ -108,7 +108,7 @@ void MOD_get_texture_coords(MappingInfoModifierData *dmd,
mloop_uv = CustomData_get_layer_named(&mesh->ldata, CD_MLOOPUV, uvname);
/* verts are given the UV from the first face that uses them */
- for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
+ for (i = 0, mp = mpoly; i < numPolys; i++, mp++) {
unsigned int fidx = mp->totloop - 1;
do {
@@ -135,7 +135,7 @@ void MOD_get_texture_coords(MappingInfoModifierData *dmd,
}
MVert *mv = mesh->mvert;
- for (i = 0; i < numVerts; ++i, ++mv, ++r_texco) {
+ for (i = 0; i < numVerts; i++, mv++, r_texco++) {
switch (texmapping) {
case MOD_DISP_MAP_LOCAL:
copy_v3_v3(*r_texco, cos != NULL ? *cos : mv->co);
diff --git a/source/blender/modifiers/intern/MOD_uvproject.c b/source/blender/modifiers/intern/MOD_uvproject.c
index 5f1eae0297a..b31e0832123 100644
--- a/source/blender/modifiers/intern/MOD_uvproject.c
+++ b/source/blender/modifiers/intern/MOD_uvproject.c
@@ -68,7 +68,7 @@ static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk,
UVProjectModifierData *umd = (UVProjectModifierData *)md;
int i;
- for (i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; ++i) {
+ for (i = 0; i < MOD_UVPROJECT_MAXPROJECTORS; i++) {
walk(userData, ob, &umd->projectors[i], IDWALK_CB_NOP);
}
}
@@ -86,7 +86,7 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte
{
UVProjectModifierData *umd = (UVProjectModifierData *)md;
bool do_add_own_transform = false;
- for (int i = 0; i < umd->num_projectors; ++i) {
+ for (int i = 0; i < umd->num_projectors; i++) {
if (umd->projectors[i] != NULL) {
DEG_add_object_relation(
ctx->node, umd->projectors[i], DEG_OB_COMP_TRANSFORM, "UV Project Modifier");
@@ -124,7 +124,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
float scay = umd->scaley ? umd->scaley : 1.0f;
int free_uci = 0;
- for (i = 0; i < umd->num_projectors; ++i) {
+ for (i = 0; i < umd->num_projectors; i++) {
if (umd->projectors[i] != NULL) {
projectors[num_projectors++].ob = umd->projectors[i];
}
@@ -144,7 +144,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
CustomData_validate_layer_name(&mesh->ldata, CD_MLOOPUV, umd->uvlayer_name, uvname);
/* calculate a projection matrix and normal for each projector */
- for (i = 0; i < num_projectors; ++i) {
+ for (i = 0; i < num_projectors; i++) {
float tmpmat[4][4];
float offsetmat[4][4];
Camera *cam = NULL;
@@ -207,13 +207,13 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
coords = BKE_mesh_vert_coords_alloc(mesh, &numVerts);
/* convert coords to world space */
- for (i = 0, co = coords; i < numVerts; ++i, ++co) {
+ for (i = 0, co = coords; i < numVerts; i++, co++) {
mul_m4_v3(ob->obmat, *co);
}
/* if only one projector, project coords to UVs */
if (num_projectors == 1 && projectors[0].uci == NULL) {
- for (i = 0, co = coords; i < numVerts; ++i, ++co) {
+ for (i = 0, co = coords; i < numVerts; i++, co++) {
mul_project_m4_v3(projectors[0].projmat, *co);
}
}
@@ -222,7 +222,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
mloop = mesh->mloop;
/* apply coords as UVs */
- for (i = 0, mp = mpoly; i < numPolys; ++i, ++mp) {
+ for (i = 0, mp = mpoly; i < numPolys; i++, mp++) {
if (num_projectors == 1) {
if (projectors[0].uci) {
unsigned int fidx = mp->totloop - 1;
@@ -259,7 +259,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
best_dot = dot_v3v3(projectors[0].normal, face_no);
best_projector = &projectors[0];
- for (j = 1; j < num_projectors; ++j) {
+ for (j = 1; j < num_projectors; j++) {
float tmp_dot = dot_v3v3(projectors[j].normal, face_no);
if (tmp_dot > best_dot) {
best_dot = tmp_dot;
@@ -290,7 +290,7 @@ static Mesh *uvprojectModifier_do(UVProjectModifierData *umd,
if (free_uci) {
int j;
- for (j = 0; j < num_projectors; ++j) {
+ for (j = 0; j < num_projectors; j++) {
if (projectors[j].uci) {
MEM_freeN(projectors[j].uci);
}
diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c
index 486d5c90bef..4ff07b21ef4 100644
--- a/source/blender/modifiers/intern/MOD_weightvg_util.c
+++ b/source/blender/modifiers/intern/MOD_weightvg_util.c
@@ -76,7 +76,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
}
/* Map each weight (vertex) to its new value, accordingly to the chosen mode. */
- for (i = 0; i < num; ++i) {
+ for (i = 0; i < num; i++) {
float fac = new_w[i];
/* Code borrowed from the warp modifier. */
@@ -164,7 +164,7 @@ void weightvg_do_mask(const ModifierEvalContext *ctx,
MOD_init_texture(&t_map, ctx);
/* For each weight (vertex), make the mix between org and new weights. */
- for (i = 0; i < num; ++i) {
+ for (i = 0; i < num; i++) {
int idx = indices ? indices[i] : i;
TexResult texres;
float hsv[3]; /* For HSV color space. */
diff --git a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
index db0689df775..27cf050c658 100644
--- a/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
+++ b/source/blender/nodes/composite/nodes/node_composite_colorbalance.c
@@ -46,7 +46,7 @@ void ntreeCompositColorBalanceSyncFromLGG(bNodeTree *UNUSED(ntree), bNode *node)
NodeColorBalance *n = node->storage;
int c;
- for (c = 0; c < 3; ++c) {
+ for (c = 0; c < 3; c++) {
n->slope[c] = (2.0f - n->lift[c]) * n->gain[c];
n->offset[c] = (n->lift[c] - 1.0f) * n->gain[c];
n->power[c] = (n->gamma[c] != 0.0f) ? 1.0f / n->gamma[c] : 1000000.0f;
@@ -58,7 +58,7 @@ void ntreeCompositColorBalanceSyncFromCDL(bNodeTree *UNUSED(ntree), bNode *node)
NodeColorBalance *n = node->storage;
int c;
- for (c = 0; c < 3; ++c) {
+ for (c = 0; c < 3; c++) {
float d = n->slope[c] + n->offset[c];
n->lift[c] = (d != 0.0f ? n->slope[c] + 2.0f * n->offset[c] / d : 0.0f);
n->gain[c] = d;
diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
index dcd8589cfdd..cbae2c412ea 100644
--- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
+++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.c
@@ -60,7 +60,7 @@ static void cryptomatte_add(NodeCryptomatte *n, float f)
while (start < end) {
/* Ignore leading whitespace. */
while (start < end && n->matte_id[start] == ' ') {
- ++start;
+ start++;
}
/* Find the next separator. */
@@ -139,7 +139,7 @@ static void cryptomatte_remove(NodeCryptomatte *n, float f)
bool skip = false;
/* Ignore leading whitespace or commas. */
while (start < end && ((n->matte_id[start] == ' ') || (n->matte_id[start] == ','))) {
- ++start;
+ start++;
}
/* Find the next separator. */
diff --git a/source/blender/nodes/intern/node_exec.c b/source/blender/nodes/intern/node_exec.c
index 24376e39f3d..85c408c40bb 100644
--- a/source/blender/nodes/intern/node_exec.c
+++ b/source/blender/nodes/intern/node_exec.c
@@ -183,7 +183,7 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,
/* set stack indices */
index = 0;
- for (n = 0; n < totnodes; ++n) {
+ for (n = 0; n < totnodes; n++) {
node = nodelist[n];
node->stack_index = index;
@@ -213,12 +213,12 @@ bNodeTreeExec *ntree_exec_begin(bNodeExecContext *context,
exec->stack = MEM_callocN(exec->stacksize * sizeof(bNodeStack), "bNodeStack");
/* all non-const results are considered inputs */
- for (n = 0; n < exec->stacksize; ++n) {
+ for (n = 0; n < exec->stacksize; n++) {
exec->stack[n].hasinput = 1;
}
/* prepare all nodes for execution */
- for (n = 0, nodeexec = exec->nodeexec; n < totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < totnodes; n++, nodeexec++) {
node = nodeexec->node = nodelist[n];
nodeexec->freeexecfunc = node->typeinfo->freeexecfunc;
@@ -265,7 +265,7 @@ void ntree_exec_end(bNodeTreeExec *exec)
MEM_freeN(exec->stack);
}
- for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
if (nodeexec->freeexecfunc) {
nodeexec->freeexecfunc(nodeexec->data.data);
}
@@ -317,7 +317,7 @@ bool ntreeExecThreadNodes(bNodeTreeExec *exec, bNodeThreadStack *nts, void *call
/* nodes are presorted, so exec is in order of list */
- for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
node = nodeexec->node;
if (node->need_exec) {
node_get_stack(node, nts->stack, nsin, nsout);
diff --git a/source/blender/nodes/intern/node_util.c b/source/blender/nodes/intern/node_util.c
index 0d7f19fb67a..455da4b3881 100644
--- a/source/blender/nodes/intern/node_util.c
+++ b/source/blender/nodes/intern/node_util.c
@@ -130,7 +130,7 @@ static bool node_link_socket_match(bNodeSocket *a, bNodeSocket *b)
*/
int prefix_len = 0;
char *ca = a->name, *cb = b->name;
- for (; *ca != '\0' && *cb != '\0'; ++ca, ++cb) {
+ for (; *ca != '\0' && *cb != '\0'; ca++, cb++) {
/* end of common prefix? */
if (*ca != *cb) {
/* prefix delimited by non-alphabetic char */
@@ -139,7 +139,7 @@ static bool node_link_socket_match(bNodeSocket *a, bNodeSocket *b)
}
break;
}
- ++prefix_len;
+ prefix_len++;
}
return prefix_len > 0;
}
@@ -150,10 +150,10 @@ static int node_count_links(bNodeTree *ntree, bNodeSocket *sock)
int count = 0;
for (link = ntree->links.first; link; link = link->next) {
if (link->fromsock == sock) {
- ++count;
+ count++;
}
if (link->tosock == sock) {
- ++count;
+ count++;
}
}
return count;
@@ -321,7 +321,7 @@ static bNodeSocket *select_internal_link_input(bNode *node, bNodeSocket *output)
int sel_priority = -1;
bool sel_is_linked = false;
- for (input = node->inputs.first, i = 0; input; input = input->next, ++i) {
+ for (input = node->inputs.first, i = 0; input; input = input->next, i++) {
int priority = node_datatype_priority(input->type, output->type);
bool is_linked = (input->link != NULL);
bool preferred;
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index a21ed6aa4cc..9caa76377fd 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -235,7 +235,7 @@ static bNode *ntree_shader_relink_output_from_group(bNodeTree *ntree,
/* Create output sockets to plug output connection to. */
i = 0;
- for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, ++i) {
+ for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, i++) {
group_surface_sockets[i] = ntreeAddSocketInterface(
group_ntree, SOCK_OUT, sock->typeinfo->idname, sock->name);
}
@@ -264,7 +264,7 @@ static bNode *ntree_shader_relink_output_from_group(bNodeTree *ntree,
new_output_node->custom1 = target;
i = 0;
- for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, ++i) {
+ for (bNodeSocket *sock = sh_output_node->inputs.first; sock; sock = sock->next, i++) {
if (sock->link != NULL) {
/* Link the shader output node incoming link to the group output sockets */
bNodeSocket *group_output_node_surface_input_sock = nodeFindSocket(
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index cf58846a051..9615c6f01e0 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -231,7 +231,7 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node
stack = exec->stack;
- for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; ++n, ++nodeexec) {
+ for (n = 0, nodeexec = exec->nodeexec; n < exec->totnodes; n++, nodeexec++) {
node = nodeexec->node;
do_it = false;
diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c
index 10f6aadbc5f..257caabcabf 100644
--- a/source/blender/nodes/shader/nodes/node_shader_common.c
+++ b/source/blender/nodes/shader/nodes/node_shader_common.c
@@ -98,7 +98,7 @@ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack)
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_INPUT) {
- for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) {
ns = node_get_socket_stack(gstack, sock);
if (ns) {
copy_stack(ns, in[a]);
@@ -120,7 +120,7 @@ static void group_move_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstac
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) {
- for (sock = node->inputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) {
ns = node_get_socket_stack(gstack, sock);
if (ns) {
move_stack(out[a], ns);
@@ -174,7 +174,7 @@ static void group_gpu_copy_inputs(bNode *gnode, GPUNodeStack *in, bNodeStack *gs
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_INPUT) {
- for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) {
ns = node_get_socket_stack(gstack, sock);
if (ns) {
/* convert the external gpu stack back to internal node stack data */
@@ -197,7 +197,7 @@ static void group_gpu_move_outputs(bNode *gnode, GPUNodeStack *out, bNodeStack *
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) {
- for (sock = node->inputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) {
ns = node_get_socket_stack(gstack, sock);
if (ns) {
/* convert the node stack data result back to gpu stack */
diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.c b/source/blender/nodes/shader/nodes/node_shader_curves.c
index baf86951fe0..f5c89e6ba41 100644
--- a/source/blender/nodes/shader/nodes/node_shader_curves.c
+++ b/source/blender/nodes/shader/nodes/node_shader_curves.c
@@ -141,7 +141,7 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat,
float ext_rgba[4][4];
float range_rgba[4];
- for (int a = 0; a < CM_TOT; ++a) {
+ for (int a = 0; a < CM_TOT; a++) {
const CurveMap *cm = &cumap->cm[a];
ext_rgba[a][0] = cm->mintable;
ext_rgba[a][2] = cm->maxtable;
diff --git a/source/blender/nodes/texture/nodes/node_texture_common.c b/source/blender/nodes/texture/nodes/node_texture_common.c
index b8435d3a352..a505bed2458 100644
--- a/source/blender/nodes/texture/nodes/node_texture_common.c
+++ b/source/blender/nodes/texture/nodes/node_texture_common.c
@@ -84,7 +84,7 @@ static void group_copy_inputs(bNode *gnode, bNodeStack **in, bNodeStack *gstack)
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_INPUT) {
- for (sock = node->outputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->outputs.first, a = 0; sock; sock = sock->next, a++) {
if (in[a]) { /* shouldn't need to check this [#36694] */
ns = node_get_socket_stack(gstack, sock);
if (ns) {
@@ -108,7 +108,7 @@ static void group_copy_outputs(bNode *gnode, bNodeStack **out, bNodeStack *gstac
for (node = ngroup->nodes.first; node; node = node->next) {
if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) {
- for (sock = node->inputs.first, a = 0; sock; sock = sock->next, ++a) {
+ for (sock = node->inputs.first, a = 0; sock; sock = sock->next, a++) {
if (out[a]) { /* shouldn't need to check this [#36694] */
ns = node_get_socket_stack(gstack, sock);
if (ns) {
diff --git a/source/blender/physics/intern/BPH_mass_spring.cpp b/source/blender/physics/intern/BPH_mass_spring.cpp
index ce0dc1b49e0..c057e74b72b 100644
--- a/source/blender/physics/intern/BPH_mass_spring.cpp
+++ b/source/blender/physics/intern/BPH_mass_spring.cpp
@@ -231,9 +231,9 @@ static void cloth_setup_constraints(ClothModifierData *clmd,
verts[v].impulse_count = 0;
}
- for (i = 0; i < totcolliders; ++i) {
+ for (i = 0; i < totcolliders; i++) {
ColliderContacts *ct = &contacts[i];
- for (j = 0; j < ct->totcollisions; ++j) {
+ for (j = 0; j < ct->totcollisions; j++) {
CollPair *collpair = &ct->collisions[j];
// float restitution = (1.0f - clmd->coll_parms->damping) * (1.0f - ct->ob->pd->pdef_sbdamp);
float restitution = 0.0f;
@@ -867,8 +867,8 @@ static void cloth_continuum_step(ClothModifierData *clmd, float dt)
clmd->hair_grid_min[(axis + 2) % 3];
BKE_sim_debug_data_clear_category(clmd->debug_data, "grid velocity");
- for (j = 0; j < size; ++j) {
- for (i = 0; i < size; ++i) {
+ for (j = 0; j < size; j++) {
+ for (i = 0; i < size; i++) {
float x[3], v[3], gvel[3], gvel_smooth[3], gdensity;
madd_v3_v3v3fl(x, offset, a, (float)i / (float)(size - 1));
diff --git a/source/blender/physics/intern/ConstrainedConjugateGradient.h b/source/blender/physics/intern/ConstrainedConjugateGradient.h
index 56151b714a6..c924490f97d 100644
--- a/source/blender/physics/intern/ConstrainedConjugateGradient.h
+++ b/source/blender/physics/intern/ConstrainedConjugateGradient.h
@@ -283,7 +283,7 @@ class ConstrainedConjugateGradient
m_iterations = Base::maxIterations();
m_error = Base::m_tolerance;
- for (int j = 0; j < b.cols(); ++j) {
+ for (int j = 0; j < b.cols(); j++) {
m_iterations = Base::maxIterations();
m_error = Base::m_tolerance;
diff --git a/source/blender/physics/intern/eigen_utils.h b/source/blender/physics/intern/eigen_utils.h
index 273b13e096a..2b50da0d190 100644
--- a/source/blender/physics/intern/eigen_utils.h
+++ b/source/blender/physics/intern/eigen_utils.h
@@ -54,14 +54,14 @@ class Vector3 : public Eigen::Vector3f {
Vector3(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
+ for (int k = 0; k < 3; k++) {
coeffRef(k) = v[k];
}
}
Vector3 &operator=(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
+ for (int k = 0; k < 3; k++) {
coeffRef(k) = v[k];
}
return *this;
@@ -86,8 +86,8 @@ class Matrix3 : public Eigen::Matrix3f {
Matrix3(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
coeffRef(l, k) = v[k][l];
}
}
@@ -95,8 +95,8 @@ class Matrix3 : public Eigen::Matrix3f {
Matrix3 &operator=(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
coeffRef(l, k) = v[k][l];
}
}
@@ -170,8 +170,8 @@ struct lMatrix3fCtor {
{
i *= 3;
j *= 3;
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
m_trips.push_back(Triplet(i + k, j + l, m.coeff(l, k)));
}
}
@@ -181,8 +181,8 @@ struct lMatrix3fCtor {
{
i *= 3;
j *= 3;
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
m_trips.push_back(Triplet(i + k, j + l, -m.coeff(l, k)));
}
}
@@ -205,7 +205,7 @@ using Eigen::ComputationInfo;
BLI_INLINE void print_lvector(const lVector3f &v)
{
- for (int i = 0; i < v.rows(); ++i) {
+ for (int i = 0; i < v.rows(); i++) {
if (i > 0 && i % 3 == 0) {
printf("\n");
}
@@ -216,12 +216,12 @@ BLI_INLINE void print_lvector(const lVector3f &v)
BLI_INLINE void print_lmatrix(const lMatrix &m)
{
- for (int j = 0; j < m.rows(); ++j) {
+ for (int j = 0; j < m.rows(); j++) {
if (j > 0 && j % 3 == 0) {
printf("\n");
}
- for (int i = 0; i < m.cols(); ++i) {
+ for (int i = 0; i < m.cols(); i++) {
if (i > 0 && i % 3 == 0) {
printf(" ");
}
diff --git a/source/blender/physics/intern/hair_volume.cpp b/source/blender/physics/intern/hair_volume.cpp
index 33c65a0cf95..88913eef7df 100644
--- a/source/blender/physics/intern/hair_volume.cpp
+++ b/source/blender/physics/intern/hair_volume.cpp
@@ -160,7 +160,7 @@ BLI_INLINE void hair_grid_interpolate(const HairGridVert *grid,
if (velocity) {
int k;
- for (k = 0; k < 3; ++k) {
+ for (k = 0; k < 3; k++) {
velocity[k] = muvw[2] *
(muvw[1] * (muvw[0] * data[0].velocity[k] + uvw[0] * data[1].velocity[k]) +
uvw[1] * (muvw[0] * data[2].velocity[k] + uvw[0] * data[3].velocity[k])) +
@@ -172,7 +172,7 @@ BLI_INLINE void hair_grid_interpolate(const HairGridVert *grid,
if (vel_smooth) {
int k;
- for (k = 0; k < 3; ++k) {
+ for (k = 0; k < 3; k++) {
vel_smooth[k] = muvw[2] * (muvw[1] * (muvw[0] * data[0].velocity_smooth[k] +
uvw[0] * data[1].velocity_smooth[k]) +
uvw[1] * (muvw[0] * data[2].velocity_smooth[k] +
@@ -297,7 +297,7 @@ void BPH_hair_volume_grid_clear(HairGrid *grid)
{
const int size = hair_grid_size(grid->res);
int i;
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
zero_v3(grid->verts[i].velocity);
zero_v3(grid->verts[i].velocity_smooth);
grid->verts[i].density = 0.0f;
@@ -321,7 +321,7 @@ BLI_INLINE float weights_sum(const float weights[8])
{
float totweight = 0.0f;
int i;
- for (i = 0; i < 8; ++i) {
+ for (i = 0; i < 8; i++) {
totweight += weights[i];
}
return totweight;
@@ -377,9 +377,9 @@ void BPH_hair_volume_add_vertex(HairGrid *grid, const float x[3], const float v[
offset = hair_grid_weights(res, grid->gmin, grid->inv_cellsize, x, weights);
- for (di = 0; di < 2; ++di) {
- for (dj = 0; dj < 2; ++dj) {
- for (dk = 0; dk < 2; ++dk) {
+ for (di = 0; di < 2; di++) {
+ for (dj = 0; dj < 2; dj++) {
+ for (dk = 0; dk < 2; dk++) {
int voffset = offset + di + (dj + dk * res[1]) * res[0];
int iw = di + dj * 2 + dk * 4;
@@ -465,12 +465,12 @@ BLI_INLINE void hair_volume_add_segment_2D(HairGrid *grid,
HairGridVert *vert_j = vert + jmin * stride_j;
float loc_j[3] = {loc[0], loc[1], loc[2]};
loc_j[axis_j] += (float)jmin;
- for (j = jmin; j <= jmax; ++j, vert_j += stride_j, loc_j[axis_j] += 1.0f) {
+ for (j = jmin; j <= jmax; j++, vert_j += stride_j, loc_j[axis_j] += 1.0f) {
HairGridVert *vert_k = vert_j + kmin * stride_k;
float loc_k[3] = {loc_j[0], loc_j[1], loc_j[2]};
loc_k[axis_k] += (float)kmin;
- for (k = kmin; k <= kmax; ++k, vert_k += stride_k, loc_k[axis_k] += 1.0f) {
+ for (k = kmin; k <= kmax; k++, vert_k += stride_k, loc_k[axis_k] += 1.0f) {
hair_volume_eval_grid_vertex(vert_k, loc_k, radius, dist_scale, x2, v2, x3, v3);
@@ -553,7 +553,7 @@ void BPH_hair_volume_add_segment(HairGrid *grid,
int j0, k0, j0_prev, k0_prev;
int i;
- for (i = imin; i <= imax; ++i) {
+ for (i = imin; i <= imax; i++) {
float shift1, shift2; /* fraction of a full cell shift [0.0, 1.0) */
int jmin, jmax, kmin, kmax;
@@ -657,7 +657,7 @@ void BPH_hair_volume_add_segment(HairGrid *grid,
int s;
- for (s = 0; s < num_samples; ++s) {
+ for (s = 0; s < num_samples; s++) {
float x[3], v[3];
int i, j, k;
@@ -672,9 +672,9 @@ void BPH_hair_volume_add_segment(HairGrid *grid,
int kmin = max_ii(floor_int(x[2]) - 2, 0);
int kmax = min_ii(floor_int(x[2]) + 2, res[2] - 1);
- for (k = kmin; k <= kmax; ++k) {
- for (j = jmin; j <= jmax; ++j) {
- for (i = imin; i <= imax; ++i) {
+ for (k = kmin; k <= kmax; k++) {
+ for (j = jmin; j <= jmax; j++) {
+ for (i = imin; i <= imax; i++) {
float loc[3] = {(float)i, (float)j, (float)k};
HairGridVert *vert = grid->verts + i * stride[0] + j * stride[1] + k * stride[2];
@@ -761,9 +761,9 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
/* Calculate divergence */
lVector B(num_cellsA);
- for (k = 0; k < resA[2]; ++k) {
- for (j = 0; j < resA[1]; ++j) {
- for (i = 0; i < resA[0]; ++i) {
+ for (k = 0; k < resA[2]; k++) {
+ for (j = 0; j < resA[1]; j++) {
+ for (i = 0; i < resA[0]; i++) {
int u = i * strideA0 + j * strideA1 + k * strideA2;
bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 ||
MARGIN_k1;
@@ -855,9 +855,9 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
*/
A.reserve(Eigen::VectorXi::Constant(num_cellsA, 7));
- for (k = 0; k < resA[2]; ++k) {
- for (j = 0; j < resA[1]; ++j) {
- for (i = 0; i < resA[0]; ++i) {
+ for (k = 0; k < resA[2]; k++) {
+ for (j = 0; j < resA[1]; j++) {
+ for (i = 0; i < resA[0]; i++) {
int u = i * strideA0 + j * strideA1 + k * strideA2;
bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 ||
MARGIN_k1;
@@ -897,11 +897,11 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
/*int liquid_neighbors = neighbors_lo + neighbors_hi;*/
non_solid_neighbors = 6;
- for (n = 0; n < neighbors_lo; ++n) {
+ for (n = 0; n < neighbors_lo; n++) {
A.insert(neighbor_lo_index[n], u) = -1.0f;
}
A.insert(u, u) = (float)non_solid_neighbors;
- for (n = 0; n < neighbors_hi; ++n) {
+ for (n = 0; n < neighbors_hi; n++) {
A.insert(neighbor_hi_index[n], u) = -1.0f;
}
}
@@ -922,9 +922,9 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
if (cg.info() == Eigen::Success) {
/* Calculate velocity = grad(p) */
- for (k = 0; k < resA[2]; ++k) {
- for (j = 0; j < resA[1]; ++j) {
- for (i = 0; i < resA[0]; ++i) {
+ for (k = 0; k < resA[2]; k++) {
+ for (j = 0; j < resA[1]; j++) {
+ for (i = 0; i < resA[0]; i++) {
int u = i * strideA0 + j * strideA1 + k * strideA2;
bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 ||
MARGIN_k1;
@@ -965,9 +965,9 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
int slice = (offset - grid->gmin[axis]) / grid->cellsize;
- for (k = 0; k < resA[2]; ++k) {
- for (j = 0; j < resA[1]; ++j) {
- for (i = 0; i < resA[0]; ++i) {
+ for (k = 0; k < resA[2]; k++) {
+ for (j = 0; j < resA[1]; j++) {
+ for (i = 0; i < resA[0]; i++) {
int u = i * strideA0 + j * strideA1 + k * strideA2;
bool is_margin = MARGIN_i0 || MARGIN_i1 || MARGIN_j0 || MARGIN_j1 || MARGIN_k0 ||
MARGIN_k1;
@@ -1034,7 +1034,7 @@ bool BPH_hair_volume_solve_divergence(HairGrid *grid,
}
else {
/* Clear result in case of error */
- for (i = 0, vert = grid->verts; i < num_cells; ++i, ++vert) {
+ for (i = 0, vert = grid->verts; i < num_cells; i++, vert++) {
zero_v3(vert->velocity_smooth);
}
@@ -1066,9 +1066,9 @@ BLI_INLINE void hair_volume_filter_box_convolute(
kernel_offset = minp + (minq + minr * res) * res;
kernel_dq = res;
kernel_dr = res * res;
- for (r = minr; r <= maxr; ++r) {
- for (q = minq; q <= maxq; ++q) {
- for (p = minp; p <= maxp; ++p) {
+ for (r = minr; r <= maxr; r++) {
+ for (q = minq; q <= maxq; q++) {
+ for (p = minp; p <= maxp; p++) {
madd_v3_v3fl(vel_smooth, verts[kernel_offset].velocity, invD);
@@ -1096,20 +1096,20 @@ void BPH_hair_volume_vertex_grid_filter_box(HairVertexGrid *grid, int kernel_siz
invD = 1.0f / (float)(tot * tot * tot);
/* clear values for convolution */
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
zero_v3(grid->verts[i].velocity_smooth);
}
- for (i = 0; i < grid->res; ++i) {
- for (j = 0; j < grid->res; ++j) {
- for (k = 0; k < grid->res; ++k) {
+ for (i = 0; i < grid->res; i++) {
+ for (j = 0; j < grid->res; j++) {
+ for (k = 0; k < grid->res; k++) {
hair_volume_filter_box_convolute(grid, invD, kernel_sizev, i, j, k);
}
}
}
/* apply as new velocity */
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
copy_v3_v3(grid->verts[i].velocity, grid->verts[i].velocity_smooth);
}
}
@@ -1134,7 +1134,7 @@ HairGrid *BPH_hair_volume_create_vertex_grid(float cellsize,
scale = 1.0f / cellsize;
sub_v3_v3v3(extent, gmax, gmin);
- for (i = 0; i < 3; ++i) {
+ for (i = 0; i < 3; i++) {
resmin[i] = floor_int(gmin[i] * scale);
resmax[i] = floor_int(gmax[i] * scale) + 1;
@@ -1221,7 +1221,7 @@ static HairGridVert *hair_volume_create_collision_grid(ClothModifierData *clmd,
collgrid = MEM_mallocN(sizeof(HairGridVert) * size, "hair collider voxel data");
/* initialize grid */
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
zero_v3(collgrid[i].velocity);
collgrid[i].density = 0.0f;
}
@@ -1247,9 +1247,9 @@ static HairGridVert *hair_volume_create_collision_grid(ClothModifierData *clmd,
sub_v3_v3v3(vel, loc1->co, loc0->co);
- for (di = 0; di < 2; ++di) {
- for (dj = 0; dj < 2; ++dj) {
- for (dk = 0; dk < 2; ++dk) {
+ for (di = 0; di < 2; di++) {
+ for (dj = 0; dj < 2; dj++) {
+ for (dk = 0; dk < 2; dk++) {
int voffset = offset + di + (dj + dk * res) * res;
int iw = di + dj * 2 + dk * 4;
diff --git a/source/blender/physics/intern/implicit_blender.c b/source/blender/physics/intern/implicit_blender.c
index c2eb7b465e1..d8b3f647591 100644
--- a/source/blender/physics/intern/implicit_blender.c
+++ b/source/blender/physics/intern/implicit_blender.c
@@ -300,7 +300,7 @@ static void print_sparse_matrix(fmatrix3x3 *m)
static void print_lvector(lfVector *v, int numverts)
{
int i;
- for (i = 0; i < numverts; ++i) {
+ for (i = 0; i < numverts; i++) {
if (i > 0) {
printf("\n");
}
@@ -320,12 +320,12 @@ static void print_bfmatrix(fmatrix3x3 *m)
float *t = MEM_callocN(sizeof(float) * size * size, "bfmatrix");
int q, i, j;
- for (q = 0; q < tot; ++q) {
+ for (q = 0; q < tot; q++) {
int k = 3 * m[q].r;
int l = 3 * m[q].c;
- for (j = 0; j < 3; ++j) {
- for (i = 0; i < 3; ++i) {
+ for (j = 0; j < 3; j++) {
+ for (i = 0; i < 3; i++) {
// if (t[k + i + (l + j) * size] != 0.0f) {
// printf("warning: overwriting value at %d, %d\n", m[q].r, m[q].c);
// }
@@ -340,12 +340,12 @@ static void print_bfmatrix(fmatrix3x3 *m)
}
}
- for (j = 0; j < size; ++j) {
+ for (j = 0; j < size; j++) {
if (j > 0 && j % 3 == 0) {
printf("\n");
}
- for (i = 0; i < size; ++i) {
+ for (i = 0; i < size; i++) {
if (i > 0 && i % 3 == 0) {
printf(" ");
}
@@ -560,7 +560,7 @@ DO_INLINE fmatrix3x3 *create_bfmatrix(unsigned int verts, unsigned int springs)
temp[0].scount = springs;
/* vertex part of the matrix is diagonal blocks */
- for (i = 0; i < verts; ++i) {
+ for (i = 0; i < verts; i++) {
init_fmatrix(temp + i, i, i);
}
@@ -1289,7 +1289,7 @@ static int BPH_mass_spring_add_block(Implicit_Data *data, int v1, int v2)
void BPH_mass_spring_clear_constraints(Implicit_Data *data)
{
int i, numverts = data->S[0].vcount;
- for (i = 0; i < numverts; ++i) {
+ for (i = 0; i < numverts; i++) {
unit_m3(data->S[i].m);
zero_v3(data->z[i]);
}
@@ -2001,7 +2001,7 @@ BLI_INLINE void spring_hairbend_estimate_dfdx(Implicit_Data *data,
/* XXX TODO offset targets to account for position dependency */
- for (a = 0; a < 3; ++a) {
+ for (a = 0; a < 3; a++) {
spring_hairbend_forces(
data, i, j, k, goal, stiffness, damping, q, dvec_pos[a], dvec_null[a], f);
copy_v3_v3(dfdx[a], f);
@@ -2010,7 +2010,7 @@ BLI_INLINE void spring_hairbend_estimate_dfdx(Implicit_Data *data,
data, i, j, k, goal, stiffness, damping, q, dvec_neg[a], dvec_null[a], f);
sub_v3_v3(dfdx[a], f);
- for (b = 0; b < 3; ++b) {
+ for (b = 0; b < 3; b++) {
dfdx[a][b] /= delta;
}
}
@@ -2040,7 +2040,7 @@ BLI_INLINE void spring_hairbend_estimate_dfdv(Implicit_Data *data,
/* XXX TODO offset targets to account for position dependency */
- for (a = 0; a < 3; ++a) {
+ for (a = 0; a < 3; a++) {
spring_hairbend_forces(
data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_pos[a], f);
copy_v3_v3(dfdv[a], f);
@@ -2049,7 +2049,7 @@ BLI_INLINE void spring_hairbend_estimate_dfdv(Implicit_Data *data,
data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_neg[a], f);
sub_v3_v3(dfdv[a], f);
- for (b = 0; b < 3; ++b) {
+ for (b = 0; b < 3; b++) {
dfdv[a][b] /= delta;
}
}
diff --git a/source/blender/physics/intern/implicit_eigen.cpp b/source/blender/physics/intern/implicit_eigen.cpp
index 277b62fba7c..9e1c03638d7 100644
--- a/source/blender/physics/intern/implicit_eigen.cpp
+++ b/source/blender/physics/intern/implicit_eigen.cpp
@@ -98,14 +98,14 @@ class fVector : public Eigen::Vector3f {
fVector(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
+ for (int k = 0; k < 3; k++) {
coeffRef(k) = v[k];
}
}
fVector &operator=(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
+ for (int k = 0; k < 3; k++) {
coeffRef(k) = v[k];
}
return *this;
@@ -130,8 +130,8 @@ class fMatrix : public Eigen::Matrix3f {
fMatrix(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
coeffRef(l, k) = v[k][l];
}
}
@@ -139,8 +139,8 @@ class fMatrix : public Eigen::Matrix3f {
fMatrix &operator=(const ctype &v)
{
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
coeffRef(l, k) = v[k][l];
}
}
@@ -212,8 +212,8 @@ struct lMatrixCtor {
{
i *= 3;
j *= 3;
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
m_trips.push_back(Triplet(i + k, j + l, m.coeff(l, k)));
}
}
@@ -223,8 +223,8 @@ struct lMatrixCtor {
{
i *= 3;
j *= 3;
- for (int k = 0; k < 3; ++k) {
- for (int l = 0; l < 3; ++l) {
+ for (int k = 0; k < 3; k++) {
+ for (int l = 0; l < 3; l++) {
m_trips.push_back(Triplet(i + k, j + l, -m.coeff(l, k)));
}
}
@@ -255,7 +255,7 @@ using Eigen::ComputationInfo;
static void print_lvector(const lVector &v)
{
- for (int i = 0; i < v.rows(); ++i) {
+ for (int i = 0; i < v.rows(); i++) {
if (i > 0 && i % 3 == 0) {
printf("\n");
}
@@ -266,12 +266,12 @@ static void print_lvector(const lVector &v)
static void print_lmatrix(const lMatrix &m)
{
- for (int j = 0; j < m.rows(); ++j) {
+ for (int j = 0; j < m.rows(); j++) {
if (j > 0 && j % 3 == 0) {
printf("\n");
}
- for (int i = 0; i < m.cols(); ++i) {
+ for (int i = 0; i < m.cols(); i++) {
if (i > 0 && i % 3 == 0) {
printf(" ");
}
@@ -302,8 +302,8 @@ BLI_INLINE void triplets_m3(TripletList &tlist, float m[3][3], int i, int j)
{
i *= 3;
j *= 3;
- for (int l = 0; l < 3; ++l) {
- for (int k = 0; k < 3; ++k) {
+ for (int l = 0; l < 3; l++) {
+ for (int k = 0; k < 3; k++) {
tlist.push_back(Triplet(i + k, j + l, m[k][l]));
}
}
@@ -313,8 +313,8 @@ BLI_INLINE void triplets_m3fl(TripletList &tlist, float m[3][3], int i, int j, f
{
i *= 3;
j *= 3;
- for (int l = 0; l < 3; ++l) {
- for (int k = 0; k < 3; ++k) {
+ for (int l = 0; l < 3; l++) {
+ for (int k = 0; k < 3; k++) {
tlist.push_back(Triplet(i + k, j + l, m[k][l] * factor));
}
}
@@ -667,7 +667,7 @@ void BPH_mass_spring_set_new_velocity(Implicit_Data *data, int index, const floa
void BPH_mass_spring_clear_constraints(Implicit_Data *data)
{
int numverts = data->numverts;
- for (int i = 0; i < numverts; ++i) {
+ for (int i = 0; i < numverts; i++) {
data->iS.add(i, i, I);
zero_v3(data->z.v3(i));
}
@@ -1236,7 +1236,7 @@ BLI_INLINE void spring_angbend_estimate_dfdx(Implicit_Data *data,
/* XXX TODO offset targets to account for position dependency */
- for (a = 0; a < 3; ++a) {
+ for (a = 0; a < 3; a++) {
spring_angbend_forces(
data, i, j, k, goal, stiffness, damping, q, dvec_pos[a], dvec_null[a], f);
copy_v3_v3(dfdx[a], f);
@@ -1245,7 +1245,7 @@ BLI_INLINE void spring_angbend_estimate_dfdx(Implicit_Data *data,
data, i, j, k, goal, stiffness, damping, q, dvec_neg[a], dvec_null[a], f);
sub_v3_v3(dfdx[a], f);
- for (b = 0; b < 3; ++b) {
+ for (b = 0; b < 3; b++) {
dfdx[a][b] /= delta;
}
}
@@ -1275,7 +1275,7 @@ BLI_INLINE void spring_angbend_estimate_dfdv(Implicit_Data *data,
/* XXX TODO offset targets to account for position dependency */
- for (a = 0; a < 3; ++a) {
+ for (a = 0; a < 3; a++) {
spring_angbend_forces(
data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_pos[a], f);
copy_v3_v3(dfdv[a], f);
@@ -1284,7 +1284,7 @@ BLI_INLINE void spring_angbend_estimate_dfdv(Implicit_Data *data,
data, i, j, k, goal, stiffness, damping, q, dvec_null[a], dvec_neg[a], f);
sub_v3_v3(dfdv[a], f);
- for (b = 0; b < 3; ++b) {
+ for (b = 0; b < 3; b++) {
dfdv[a][b] /= delta;
}
}
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index 9e734123caa..6b63d1ef2c3 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -480,7 +480,7 @@ static void bpy_prop_boolean_array_get_cb(struct PointerRNA *ptr,
if (ret == NULL) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = false;
}
}
@@ -488,7 +488,7 @@ static void bpy_prop_boolean_array_get_cb(struct PointerRNA *ptr,
if (PyC_AsArray(values, ret, len, &PyBool_Type, false, "BoolVectorProperty get") == -1) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = false;
}
@@ -724,7 +724,7 @@ static void bpy_prop_int_array_get_cb(struct PointerRNA *ptr,
if (ret == NULL) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = 0;
}
}
@@ -732,7 +732,7 @@ static void bpy_prop_int_array_get_cb(struct PointerRNA *ptr,
if (PyC_AsArray(values, ret, len, &PyLong_Type, false, "IntVectorProperty get") == -1) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = 0;
}
@@ -968,7 +968,7 @@ static void bpy_prop_float_array_get_cb(struct PointerRNA *ptr,
if (ret == NULL) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = 0.0f;
}
}
@@ -976,7 +976,7 @@ static void bpy_prop_float_array_get_cb(struct PointerRNA *ptr,
if (PyC_AsArray(values, ret, len, &PyFloat_Type, false, "FloatVectorProperty get") == -1) {
PyC_Err_PrintWithFunc(py_func);
- for (i = 0; i < len; ++i) {
+ for (i = 0; i < len; i++) {
values[i] = 0.0f;
}
diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c
index b890295d32f..1b438072329 100644
--- a/source/blender/python/mathutils/mathutils_noise.c
+++ b/source/blender/python/mathutils/mathutils_noise.c
@@ -140,11 +140,11 @@ static void next_state(void)
left = N;
next = state;
- for (j = N - M + 1; --j; p++) {
+ for (j = N - M + 1; j--; p++) {
*p = p[M] ^ TWIST(p[0], p[1]);
}
- for (j = M; --j; p++) {
+ for (j = M; j--; p++) {
*p = p[M - N] ^ TWIST(p[0], p[1]);
}
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 9672184cec8..dc7288234b3 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -842,8 +842,8 @@ static void area_sample(TexResult *texr, ImBuf *ibuf, float fx, float fy, afdata
xsd = 1.f / xsam;
ysd = 1.f / ysam;
texr->tr = texr->tg = texr->tb = texr->ta = 0.f;
- for (ys = 0; ys < ysam; ++ys) {
- for (xs = 0; xs < xsam; ++xs) {
+ for (ys = 0; ys < ysam; ys++) {
+ for (xs = 0; xs < xsam; xs++) {
const float su = (xs + ((ys & 1) + 0.5f) * 0.5f) * xsd - 0.5f;
const float sv = (ys + ((xs & 1) + 0.5f) * 0.5f) * ysd - 0.5f;
const float pu = fx + su * AFD->dxt[0] + sv * AFD->dyt[0];
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c
index 04fcaf206d4..8308048ddba 100644
--- a/source/blender/render/intern/source/pipeline.c
+++ b/source/blender/render/intern/source/pipeline.c
@@ -926,8 +926,8 @@ static void render_result_rescale(Render *re)
scale_x = (float)result->rectx / re->result->rectx;
scale_y = (float)result->recty / re->result->recty;
- for (x = 0; x < re->result->rectx; ++x) {
- for (y = 0; y < re->result->recty; ++y) {
+ for (x = 0; x < re->result->rectx; x++) {
+ for (y = 0; y < re->result->recty; y++) {
int src_x = x * scale_x;
int src_y = y * scale_y;
int dst_index = y * re->result->rectx + x;
diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c
index 3ede55434b9..cb33492763a 100644
--- a/source/blender/render/intern/source/pointdensity.c
+++ b/source/blender/render/intern/source/pointdensity.c
@@ -355,11 +355,11 @@ static void pointdensity_cache_vertex_weight(PointDensity *pd,
return;
}
- for (i = 0, dv = mdef; i < totvert; ++i, ++dv, data_color += 3) {
+ for (i = 0, dv = mdef; i < totvert; i++, dv++, data_color += 3) {
MDeformWeight *dw;
int j;
- for (j = 0, dw = dv->dw; j < dv->totweight; ++j, ++dw) {
+ for (j = 0, dw = dv->dw; j < dv->totweight; j++, dw++) {
if (dw->def_nr == mdef_index) {
copy_v3_fl(data_color, dw->weight);
break;
@@ -910,8 +910,8 @@ static void point_density_sample_func(void *__restrict data_v,
}
size_t z = (size_t)iter;
- for (size_t y = 0; y < resolution; ++y) {
- for (size_t x = 0; x < resolution; ++x) {
+ for (size_t y = 0; y < resolution; y++) {
+ for (size_t x = 0; x < resolution; x++) {
size_t index = z * resolution2 + y * resolution + x;
float texvec[3];
float age, vec[3], col[3];