From b134434224254d4ac3fc73d023f2f6d914746690 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 7 Aug 2020 22:36:11 +1000 Subject: Cleanup: declare arrays arrays where possible --- source/blender/blenlib/intern/lasso_2d.c | 2 +- source/blender/blenlib/intern/math_geom.c | 4 ++-- source/blender/blenlib/intern/math_interp.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/blenlib/intern') diff --git a/source/blender/blenlib/intern/lasso_2d.c b/source/blender/blenlib/intern/lasso_2d.c index f2cc8d42de7..a3b111cf0f2 100644 --- a/source/blender/blenlib/intern/lasso_2d.c +++ b/source/blender/blenlib/intern/lasso_2d.c @@ -61,7 +61,7 @@ bool BLI_lasso_is_point_inside(const int mcoords[][2], return false; } - int pt[2] = {sx, sy}; + const int pt[2] = {sx, sy}; return isect_point_poly_v2_int(pt, mcoords, mcoords_len, true); } diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index ce83b522178..eff58f305d2 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -2094,7 +2094,7 @@ bool isect_ray_seg_v2(const float ray_origin[2], det = cross_v2v2(ray_direction, s10); if (det != 0.0f) { const float v = cross_v2v2(v0_local, v1_local); - float p[2] = {(ray_direction[0] * v) / det, (ray_direction[1] * v) / det}; + const float p[2] = {(ray_direction[0] * v) / det, (ray_direction[1] * v) / det}; const float t = (dot_v2v2(p, ray_direction) / dot_v2v2(ray_direction, ray_direction)); if ((t >= 0.0f) == 0) { @@ -5106,7 +5106,7 @@ void map_to_sphere(float *r_u, float *r_v, const float x, const float y, const f void map_to_plane_v2_v3v3(float r_co[2], const float co[3], const float no[3]) { - float target[3] = {0.0f, 0.0f, 1.0f}; + const float target[3] = {0.0f, 0.0f, 1.0f}; float axis[3]; cross_v3_v3v3(axis, no, target); diff --git a/source/blender/blenlib/intern/math_interp.c b/source/blender/blenlib/intern/math_interp.c index 6277b1cd9dc..13a1816f1bd 100644 --- a/source/blender/blenlib/intern/math_interp.c +++ b/source/blender/blenlib/intern/math_interp.c @@ -286,7 +286,7 @@ BLI_INLINE void bilinear_interpolation(const unsigned char *byte_buffer, if (float_output) { const float *row1, *row2, *row3, *row4; - float empty[4] = {0.0f, 0.0f, 0.0f, 0.0f}; + const float empty[4] = {0.0f, 0.0f, 0.0f, 0.0f}; /* pixel value must be already wrapped, however values at boundaries may flip */ if (wrap_x) { -- cgit v1.2.3