diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:56:13 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:56:13 +0300 |
commit | 48e089375ebe4aeb30d60e9d8ef6f467280cf07d (patch) | |
tree | af4675f9b8489fb49b68a9a9d977a098e645f640 /source/blender/editors/gpencil | |
parent | b134434224254d4ac3fc73d023f2f6d914746690 (diff) |
Cleanup: pass arrays const where possible
Diffstat (limited to 'source/blender/editors/gpencil')
4 files changed, 11 insertions, 6 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index b45a324bc67..30e4fe0b531 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -271,7 +271,7 @@ static void annotation_get_3d_reference(tGPsdata *p, float vec[3]) /* Stroke Editing ---------------------------- */ /* check if the current mouse position is suitable for adding a new point */ -static bool annotation_stroke_filtermval(tGPsdata *p, const float mval[2], float pmval[2]) +static bool annotation_stroke_filtermval(tGPsdata *p, const float mval[2], const float pmval[2]) { int dx = (int)fabsf(mval[0] - pmval[0]); int dy = (int)fabsf(mval[1] - pmval[1]); diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index de58a0916b2..611fe158948 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -362,7 +362,7 @@ static void gpencil_get_3d_reference(tGPsdata *p, float vec[3]) /* Stroke Editing ---------------------------- */ /* check if the current mouse position is suitable for adding a new point */ -static bool gpencil_stroke_filtermval(tGPsdata *p, const float mval[2], float mvalo[2]) +static bool gpencil_stroke_filtermval(tGPsdata *p, const float mval[2], const float mvalo[2]) { Brush *brush = p->brush; int dx = (int)fabsf(mval[0] - mvalo[0]); @@ -3269,7 +3269,7 @@ static void gpencil_brush_angle_segment(tGPsdata *p, tGPspoint *pt_prev, tGPspoi * + PtA - 1 * / * CTL is the vertice of the triangle created between PtA and PtB */ -static void gpencil_add_arc_points(tGPsdata *p, float mval[2], int segments) +static void gpencil_add_arc_points(tGPsdata *p, const float mval[2], int segments) { bGPdata *gpd = p->gpd; BrushGpencilSettings *brush_settings = p->brush->gpencil_settings; diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index f44dbd1a752..28ea9535a80 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -378,7 +378,10 @@ static void gpencil_primitive_add_segment(tGPDprimitive *tgpi) } /* Helper: set control point */ -static void gpencil_primitive_set_cp(tGPDprimitive *tgpi, float p[2], float color[4], int size) +static void gpencil_primitive_set_cp(tGPDprimitive *tgpi, + const float p[2], + float color[4], + int size) { if (tgpi->flag == IN_PROGRESS) { return; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 339e97bd71c..aaf88e1a0b0 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1723,7 +1723,7 @@ void ED_gpencil_vgroup_deselect(bContext *C, Object *ob) /* Cursor drawing */ /* check if cursor is in drawing region */ -static bool gpencil_check_cursor_region(bContext *C, int mval_i[2]) +static bool gpencil_check_cursor_region(bContext *C, const int mval_i[2]) { ARegion *region = CTX_wm_region(C); ScrArea *area = CTX_wm_area(C); @@ -2311,7 +2311,9 @@ static void gpencil_insert_point( MEM_SAFE_FREE(temp_points); } -static float gpencil_calc_factor(float p2d_a1[2], float p2d_a2[2], float r_hit2d[2]) +static float gpencil_calc_factor(const float p2d_a1[2], + const float p2d_a2[2], + const float r_hit2d[2]) { float dist1 = len_squared_v2v2(p2d_a1, p2d_a2); float dist2 = len_squared_v2v2(p2d_a1, r_hit2d); |