diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:12:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-07 17:23:25 +0300 |
commit | 0b2d1badecc48b5cbff5ec088b29c6e9acc5e1d0 (patch) | |
tree | 0283a5c819d1e709edfd0de814636aa83a9b1033 /source/blender/editors | |
parent | ab823176d31dc155645de733f1cd4fbd6ad74592 (diff) |
Cleanup: use post increment/decrement
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
Diffstat (limited to 'source/blender/editors')
34 files changed, 82 insertions, 82 deletions
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]); |