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/space_view3d | |
parent | 3db67fd670535c0a709ec6e8204fcb730cd3eb0d (diff) |
Cleanup: declare arrays arrays where possible
Diffstat (limited to 'source/blender/editors/space_view3d')
7 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index d78c58c0c64..38784a5c79e 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1071,7 +1071,7 @@ static void v3d_object_dimension_buts(bContext *C, uiLayout *layout, View3D *v3d const float lim = FLT_MAX; for (int i = 0; i < 3; i++) { uiBut *but; - char text[3] = {'X' + i, ':', '\0'}; + const char text[3] = {'X' + i, ':', '\0'}; but = uiDefButF(block, UI_BTYPE_NUM, B_TRANSFORM_PANEL_DIMS, diff --git a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c index 30212fcd9e5..e17993445df 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.c @@ -156,7 +156,7 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int if (eve_test) { BMVert *vert = (BMVert *)eve_test; float vert_p_co[3], vert_co[3]; - float mval_f[2] = {UNPACK2(vc.mval)}; + const float mval_f[2] = {UNPACK2(vc.mval)}; mul_v3_m4v3(vert_co, gz_ele->bases[base_index_vert]->object->obmat, vert->co); ED_view3d_project(vc.region, vert_co, vert_p_co); float len = len_v2v2(vert_p_co, mval_f); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index 59b2e378955..7799aba5c19 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -909,7 +909,7 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz) static int gizmo_ruler_test_select(bContext *UNUSED(C), wmGizmo *gz, const int mval[2]) { RulerItem *ruler_item_pick = (RulerItem *)gz; - float mval_fl[2] = {UNPACK2(mval)}; + const float mval_fl[2] = {UNPACK2(mval)}; int co_index; /* select and drag */ diff --git a/source/blender/editors/space_view3d/view3d_placement.c b/source/blender/editors/space_view3d/view3d_placement.c index b7219290654..b79632f0a82 100644 --- a/source/blender/editors/space_view3d/view3d_placement.c +++ b/source/blender/editors/space_view3d/view3d_placement.c @@ -321,7 +321,7 @@ static void draw_line_bounds(const BoundBox *bounds, const float color[4]) GPUVertFormat *format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(format, "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT); - int edges[12][2] = { + const int edges[12][2] = { /* First side. */ {0, 1}, {1, 2}, @@ -507,7 +507,7 @@ static void draw_circle_in_quad(const float v1[2], float theta = ((2.0f * M_PI) * ((float)i / (float)resolution)) + 0.01f; float x = cosf(theta); float y = sinf(theta); - float pt[2] = {x, y}; + const float pt[2] = {x, y}; float w[4]; barycentric_weights_v2_quad(UNPACK4(quad), pt, w); diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index c10a88af146..c790a8659ee 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -778,7 +778,7 @@ void ED_view3d_project(const struct ARegion *region, const float world[3], float { // viewport is set up to make coordinates relative to the region, not window RegionView3D *rv3d = region->regiondata; - int viewport[4] = {0, 0, region->winx, region->winy}; + const int viewport[4] = {0, 0, region->winx, region->winy}; GPU_matrix_project(world, rv3d->viewmat, rv3d->winmat, viewport, r_region_co); } @@ -787,8 +787,8 @@ bool ED_view3d_unproject( const struct ARegion *region, float regionx, float regiony, float regionz, float world[3]) { RegionView3D *rv3d = region->regiondata; - int viewport[4] = {0, 0, region->winx, region->winy}; - float region_co[3] = {regionx, regiony, regionz}; + const int viewport[4] = {0, 0, region->winx, region->winy}; + const float region_co[3] = {regionx, regiony, regionz}; return GPU_matrix_unproject(region_co, rv3d->viewmat, rv3d->winmat, viewport, world); } diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 4e73a2be17e..a264e1560c6 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -1499,7 +1499,7 @@ void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const */ void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist) { - float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]}; + const float iviewquat[4] = {-quat[0], quat[1], quat[2], quat[3]}; float dvec[3] = {0.0f, 0.0f, dist}; quat_to_mat4(mat, iviewquat); diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c index 64167b83655..2cc41097070 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -387,7 +387,7 @@ static bool walk_floor_distance_get(RegionView3D *rv3d, const float dvec[3], float *r_distance) { - float ray_normal[3] = {0, 0, -1}; /* down */ + const float ray_normal[3] = {0, 0, -1}; /* down */ float ray_start[3]; float r_location[3]; float r_normal_dummy[3]; |