diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:36:11 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-07 15:37:39 +0300 |
commit | b134434224254d4ac3fc73d023f2f6d914746690 (patch) | |
tree | b67d2c5aee982495d55848414c362665a37476b0 /source/blender/editors/gpencil | |
parent | 3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff) |
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_fill.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_mesh.c | 2 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 4 | ||||
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 6 |
6 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index ab83abb6b37..b45a324bc67 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -573,14 +573,14 @@ static short annotation_stroke_addpoint(tGPsdata *p, /* Arrow end corner. */ if (gpd->runtime.sbuffer_sflag & GP_STROKE_USE_ARROW_END) { pt++; - float e_heading[2] = {start[0] - end[0], start[1] - end[1]}; + const float e_heading[2] = {start[0] - end[0], start[1] - end[1]}; /* Calculate points for ending arrow. */ annotation_stroke_arrow_calc_points( pt, e_heading, end, gpd->runtime.arrow_end, gpd->runtime.arrow_end_style); } /* Arrow start corner. */ if (gpd->runtime.sbuffer_sflag & GP_STROKE_USE_ARROW_START) { - float s_heading[2] = {end[0] - start[0], end[1] - start[1]}; + const float s_heading[2] = {end[0] - start[0], end[1] - start[1]}; /* Calculate points for starting arrow. */ annotation_stroke_arrow_calc_points( NULL, s_heading, start, gpd->runtime.arrow_start, gpd->runtime.arrow_start_style); @@ -704,7 +704,7 @@ static void annotation_stroke_arrow_init_point( tGPsdata *p, tGPspoint *ptc, bGPDspoint *pt, const float co[8], const int co_idx) { /* Note: provided co_idx should be always pair number as it's [x1, y1, x2, y2, x3, y3]. */ - float real_co[2] = {co[co_idx], co[co_idx + 1]}; + const float real_co[2] = {co[co_idx], co[co_idx + 1]}; copy_v2_v2(&ptc->x, real_co); annotation_stroke_convertcoords(p, &ptc->x, &pt->x, NULL); annotation_stroke_arrow_init_point_default(pt); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 9658dc04b52..99e98df3397 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -3376,7 +3376,7 @@ static void gpencil_stroke_join_strokes(bGPDstroke *gps_a, bGPDspoint point; bGPDspoint *pt; int i; - float delta[3] = {1.0f, 1.0f, 1.0f}; + const float delta[3] = {1.0f, 1.0f, 1.0f}; float deltatime = 0.0f; /* sanity checks */ diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index 7db25ef817b..a70bbfc9d48 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -456,7 +456,7 @@ static bool gpencil_render_offscreen(tGPDfill *tgpf) GPU_matrix_set(tgpf->rv3d->viewmat); /* draw strokes */ - float ink[4] = {1.0f, 0.0f, 0.0f, 1.0f}; + const float ink[4] = {1.0f, 0.0f, 0.0f, 1.0f}; gpencil_draw_datablock(tgpf, ink); GPU_matrix_pop_projection(); diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c index 11f42f7d3ac..a6088e31ff8 100644 --- a/source/blender/editors/gpencil/gpencil_mesh.c +++ b/source/blender/editors/gpencil/gpencil_mesh.c @@ -196,7 +196,7 @@ static int gpencil_bake_mesh_animation_exec(bContext *C, wmOperator *op) bool newob = false; if (STREQ(target, "*NEW")) { ushort local_view_bits = (v3d && v3d->localvd) ? v3d->local_view_uuid : 0; - float loc[3] = {0.0f, 0.0f, 0.0f}; + const float loc[3] = {0.0f, 0.0f, 0.0f}; ob_gpencil = ED_gpencil_add_object(C, loc, local_view_bits); newob = true; } diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 9ec04bbb553..de58a0916b2 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -519,7 +519,7 @@ static void gpencil_brush_angle(bGPdata *gpd, Brush *brush, tGPspoint *pt, const /* default angle of brush in radians */ float angle = brush->gpencil_settings->draw_angle; /* angle vector of the brush with full thickness */ - float v0[2] = {cos(angle), sin(angle)}; + const float v0[2] = {cos(angle), sin(angle)}; /* Apply to first point (only if there are 2 points because before no data to do it ) */ if (gpd->runtime.sbuffer_used == 1) { @@ -3247,7 +3247,7 @@ static void gpencil_brush_angle_segment(tGPsdata *p, tGPspoint *pt_prev, tGPspoi float fac; /* angle vector of the brush with full thickness */ - float v0[2] = {cos(angle), sin(angle)}; + const float v0[2] = {cos(angle), sin(angle)}; mvec[0] = pt->x - pt_prev->x; mvec[1] = pt->y - pt_prev->y; diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index f2ccbd6d2cf..339e97bd71c 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1080,7 +1080,7 @@ void ED_gpencil_project_stroke_to_plane(const Scene *scene, } } else { - float scale[3] = {1.0f, 1.0f, 1.0f}; + const float scale[3] = {1.0f, 1.0f, 1.0f}; plane_normal[2] = 1.0f; float mat[4][4]; loc_eul_size_to_mat4(mat, cursor->location, cursor->rotation_euler, scale); @@ -1285,7 +1285,7 @@ void ED_gpencil_project_point_to_plane(const Scene *scene, } } else { - float scale[3] = {1.0f, 1.0f, 1.0f}; + const float scale[3] = {1.0f, 1.0f, 1.0f}; plane_normal[2] = 1.0f; float mat[4][4]; loc_eul_size_to_mat4(mat, cursor->location, cursor->rotation_euler, scale); @@ -1469,7 +1469,7 @@ void ED_gpencil_reset_layers_parent(Depsgraph *depsgraph, Object *obact, bGPdata /* Helper function to create new OB_GPENCIL Object */ Object *ED_gpencil_add_object(bContext *C, const float loc[3], ushort local_view_bits) { - float rot[3] = {0.0f}; + const float rot[3] = {0.0f}; Object *ob = ED_object_add_type(C, OB_GPENCIL, NULL, loc, rot, false, local_view_bits); |