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/interface | |
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/interface')
4 files changed, 8 insertions, 8 deletions
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; } |