From 2743d746ea4f38c098512f6dd6fc33d5a62429d3 Mon Sep 17 00:00:00 2001 From: Aaron Carlisle Date: Wed, 20 Oct 2021 23:45:30 +1100 Subject: Cleanup: use an array for wmEvent cursor position variables Use arrays for wmEvent coordinates, this quiets warnings with GCC11. - `x, y` -> `xy`. - `prevx, prevy` -> `prev_xy`. - `prevclickx, prevclicky` -> `prev_click_xy`. There is still some cleanup such as using `copy_v2_v2_int()`, this can be done separately. Reviewed By: campbellbarton, Severin Ref D12901 --- source/blender/editors/sculpt_paint/paint_image.c | 6 +++--- source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c | 4 ++-- source/blender/editors/sculpt_paint/sculpt.c | 2 +- source/blender/editors/sculpt_paint/sculpt_cloth.c | 2 +- source/blender/editors/sculpt_paint/sculpt_detail.c | 2 +- source/blender/editors/sculpt_paint/sculpt_filter_color.c | 2 +- source/blender/editors/sculpt_paint/sculpt_filter_mesh.c | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) (limited to 'source/blender/editors/sculpt_paint') diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index b5113681955..6ba5c43f698 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -863,8 +863,8 @@ static int grab_clone_invoke(bContext *C, wmOperator *op, const wmEvent *event) cmv = MEM_callocN(sizeof(GrabClone), "GrabClone"); copy_v2_v2(cmv->startoffset, brush->clone.offset); - cmv->startx = event->x; - cmv->starty = event->y; + cmv->startx = event->xy[0]; + cmv->starty = event->xy[1]; op->customdata = cmv; WM_event_add_modal_handler(C, op); @@ -890,7 +890,7 @@ static int grab_clone_modal(bContext *C, wmOperator *op, const wmEvent *event) /* mouse moved, so move the clone image */ UI_view2d_region_to_view( ®ion->v2d, cmv->startx - xmin, cmv->starty - ymin, &startfx, &startfy); - UI_view2d_region_to_view(®ion->v2d, event->x - xmin, event->y - ymin, &fx, &fy); + UI_view2d_region_to_view(®ion->v2d, event->xy[0] - xmin, event->xy[1] - ymin, &fx, &fy); delta[0] = fx - startfx; delta[1] = fy - startfy; diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c index cb8dc838422..1077f66f10c 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -339,8 +339,8 @@ static const EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, uint index; const int mval[2] = { - win->eventstate->x - vc.region->winrct.xmin, - win->eventstate->y - vc.region->winrct.ymin, + win->eventstate->xy[0] - vc.region->winrct.xmin, + win->eventstate->xy[1] - vc.region->winrct.ymin, }; view3d_operator_needs_opengl(C); diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 1330beb917b..7b854e886a0 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -8057,7 +8057,7 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent /* For tablet rotation. */ ignore_background_click = RNA_boolean_get(op->ptr, "ignore_background_click"); - if (ignore_background_click && !over_mesh(C, op, event->x, event->y)) { + if (ignore_background_click && !over_mesh(C, op, event->xy[0], event->xy[1])) { paint_stroke_free(C, op); return OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.c b/source/blender/editors/sculpt_paint/sculpt_cloth.c index a53a2126af4..fa879214794 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.c +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.c @@ -1528,7 +1528,7 @@ static int sculpt_cloth_filter_modal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } - const float len = event->prevclickx - event->x; + const float len = event->prev_click_xy[0] - event->xy[0]; filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC; SCULPT_vertex_random_access_ensure(ss); diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.c b/source/blender/editors/sculpt_paint/sculpt_detail.c index 188bb0a88eb..edbb98b481e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_detail.c +++ b/source/blender/editors/sculpt_paint/sculpt_detail.c @@ -306,7 +306,7 @@ static int sculpt_sample_detail_size_modal(bContext *C, wmOperator *op, const wm switch (event->type) { case LEFTMOUSE: if (event->val == KM_PRESS) { - const int ss_co[2] = {event->x, event->y}; + const int ss_co[2] = {event->xy[0], event->xy[1]}; int mode = RNA_enum_get(op->ptr, "mode"); sample_detail(C, ss_co[0], ss_co[1], mode); diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_color.c b/source/blender/editors/sculpt_paint/sculpt_filter_color.c index 4b49bf2cefb..a0062a98194 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_color.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_color.c @@ -231,7 +231,7 @@ static int sculpt_color_filter_modal(bContext *C, wmOperator *op, const wmEvent return OPERATOR_RUNNING_MODAL; } - const float len = event->prevclickx - event->x; + const float len = event->prev_click_xy[0] - event->xy[0]; filter_strength = filter_strength * -len * 0.001f; float fill_color[3]; diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c index 2a7c2a46818..760cf632ae9 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.c @@ -624,7 +624,7 @@ static int sculpt_mesh_filter_modal(bContext *C, wmOperator *op, const wmEvent * return OPERATOR_RUNNING_MODAL; } - const float len = event->prevclickx - event->x; + const float len = event->prev_click_xy[0] - event->xy[0]; filter_strength = filter_strength * -len * 0.001f * UI_DPI_FAC; SCULPT_vertex_random_access_ensure(ss); -- cgit v1.2.3