diff options
author | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-12-27 00:32:57 +0300 |
---|---|---|
committer | Aaron Carlisle <carlisle.b3d@gmail.com> | 2021-12-27 20:31:31 +0300 |
commit | 5814de65f9a074a65d4cb5e28787f644f268ee75 (patch) | |
tree | 618d288e969d83e4f54c288598d46af58dfac475 /source/blender/editors/gpencil/annotate_draw.c | |
parent | 11ac276caaa6e6d42176452526af97cf972abb5f (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/annotate_draw.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_draw.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index 3705ea38e11..ae00fc41f40 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -165,7 +165,7 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, immBindBuiltinProgram(GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA); immUniformColor3fvAlpha(ink, ink[3]); immBegin(GPU_PRIM_POINTS, 1); - immVertex2fv(pos, &pt->x); + immVertex2fv(pos, pt->m_xy); } else { float oldpressure = points[0].pressure; @@ -191,7 +191,7 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, if (fabsf(pt->pressure - oldpressure) > 0.2f) { /* need to have 2 points to avoid immEnd assert error */ if (draw_points < 2) { - immVertex2fv(pos, &(pt - 1)->x); + immVertex2fv(pos, (pt - 1)->m_xy); } immEnd(); @@ -202,7 +202,7 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, /* need to roll-back one point to ensure that there are no gaps in the stroke */ if (i != 0) { - immVertex2fv(pos, &(pt - 1)->x); + immVertex2fv(pos, (pt - 1)->m_xy); draw_points++; } @@ -210,12 +210,12 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, } /* now the point we want */ - immVertex2fv(pos, &pt->x); + immVertex2fv(pos, pt->m_xy); draw_points++; } /* need to have 2 points to avoid immEnd assert error */ if (draw_points < 2) { - immVertex2fv(pos, &(pt - 1)->x); + immVertex2fv(pos, (pt - 1)->m_xy); } } @@ -227,14 +227,14 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, if ((sflag & GP_STROKE_USE_ARROW_END) && (runtime.arrow_end_style != GP_STROKE_ARROWSTYLE_NONE)) { float end[2]; - copy_v2_fl2(end, points[1].x, points[1].y); + copy_v2_v2(end, points[1].m_xy); annotation_draw_stroke_arrow_buffer(pos, end, runtime.arrow_end, runtime.arrow_end_style); } /* Draw starting arrow stroke. */ if ((sflag & GP_STROKE_USE_ARROW_START) && (runtime.arrow_start_style != GP_STROKE_ARROWSTYLE_NONE)) { float start[2]; - copy_v2_fl2(start, points[0].x, points[0].y); + copy_v2_v2(start, points[0].m_xy); annotation_draw_stroke_arrow_buffer( pos, start, runtime.arrow_start, runtime.arrow_start_style); } |