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:
authorAaron Carlisle <carlisle.b3d@gmail.com>2021-12-27 00:32:57 +0300
committerAaron Carlisle <carlisle.b3d@gmail.com>2021-12-27 20:31:31 +0300
commit5814de65f9a074a65d4cb5e28787f644f268ee75 (patch)
tree618d288e969d83e4f54c288598d46af58dfac475 /source/blender/editors/gpencil/gpencil_fill.c
parent11ac276caaa6e6d42176452526af97cf972abb5f (diff)
Cleanup: Store cursor location in tGPspoint as an array
Fixes many instances of `-Wstringop-overread` warning on GCC 11 Differential Revision: https://developer.blender.org/D13672
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_fill.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index f0adb901f88..541b6673cb6 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1072,7 +1072,7 @@ static void gpencil_erase_processed_area(tGPDfill *tgpf)
/* First set in blue the perimeter. */
for (int i = 0; i < tgpf->sbuffer_used && point2D; i++, point2D++) {
- int image_idx = ibuf->x * (int)point2D->y + (int)point2D->x;
+ int image_idx = ibuf->x * (int)point2D->m_xy[1] + (int)point2D->m_xy[0];
set_pixel(ibuf, image_idx, blue_col);
}
@@ -1393,7 +1393,7 @@ static void gpencil_get_depth_array(tGPDfill *tgpf)
for (i = 0, ptc = tgpf->sbuffer; i < totpoints; i++, ptc++) {
int mval_i[2];
- round_v2i_v2fl(mval_i, &ptc->x);
+ round_v2i_v2fl(mval_i, ptc->m_xy);
if ((ED_view3d_depth_read_cached(depths, mval_i, depth_margin, tgpf->depth_arr + i) == 0) &&
(i && (ED_view3d_depth_read_cached_seg(
@@ -1437,9 +1437,9 @@ static int gpencil_points_from_stack(tGPDfill *tgpf)
while (!BLI_stack_is_empty(tgpf->stack)) {
int v[2];
BLI_stack_pop(tgpf->stack, &v);
- copy_v2fl_v2i(&point2D->x, v);
+ copy_v2fl_v2i(point2D->m_xy, v);
/* shift points to center of pixel */
- add_v2_fl(&point2D->x, 0.5f);
+ add_v2_fl(point2D->m_xy, 0.5f);
point2D->pressure = 1.0f;
point2D->strength = 1.0f;
point2D->time = 0.0f;
@@ -2125,7 +2125,7 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
tgpf->gps_mouse = BKE_gpencil_stroke_new(0, 1, 10.0f);
tGPspoint point2D;
bGPDspoint *pt = &tgpf->gps_mouse->points[0];
- copy_v2fl_v2i(&point2D.x, tgpf->mouse);
+ copy_v2fl_v2i(point2D.m_xy, tgpf->mouse);
gpencil_stroke_convertcoords_tpoint(
tgpf->scene, tgpf->region, tgpf->ob, &point2D, NULL, &pt->x);