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/blenkernel | |
parent | b134434224254d4ac3fc73d023f2f6d914746690 (diff) |
Cleanup: pass arrays const where possible
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/cloth.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/constraint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/curve.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/dynamicpaint.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fluid.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_curve.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mask.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires_reshape_apply_base.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object_dupli.c | 5 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/particle_child.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/softbody.c | 6 |
11 files changed, 20 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c index aa534250554..027761335b0 100644 --- a/source/blender/blenkernel/intern/cloth.c +++ b/source/blender/blenkernel/intern/cloth.c @@ -1355,7 +1355,7 @@ BLI_INLINE void cross_identity_v3(float r[3][3], const float v[3]) r[2][1] = -v[0]; } -BLI_INLINE void madd_m3_m3fl(float r[3][3], float m[3][3], float f) +BLI_INLINE void madd_m3_m3fl(float r[3][3], const float m[3][3], float f) { r[0][0] += m[0][0] * f; r[0][1] += m[0][1] * f; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 2bd8713a292..87d1b2561a9 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -2404,7 +2404,7 @@ static void armdef_get_tarmat(struct Depsgraph *UNUSED(depsgraph), } } -static void armdef_accumulate_matrix(float obmat[4][4], +static void armdef_accumulate_matrix(const float obmat[4][4], const float iobmat[4][4], const float basemat[4][4], const float bonemat[4][4], diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c index 735ffdea86e..8e03f61d601 100644 --- a/source/blender/blenkernel/intern/curve.c +++ b/source/blender/blenkernel/intern/curve.c @@ -3598,7 +3598,10 @@ static void bezier_clamp( } /* write changes to a bezier handle */ -static void bezier_output_handle_inner(BezTriple *bezt, bool right, float newval[3], bool endpoint) +static void bezier_output_handle_inner(BezTriple *bezt, + bool right, + const float newval[3], + bool endpoint) { float tmp[3]; diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c index b017f3b179f..a39f2ccb6d8 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.c +++ b/source/blender/blenkernel/intern/dynamicpaint.c @@ -602,7 +602,7 @@ static bool boundIntersectPoint(Bounds3D *b, const float point[3], const float r } /* expand bounds by a new point */ -static void boundInsert(Bounds3D *b, float point[3]) +static void boundInsert(Bounds3D *b, const float point[3]) { if (!b->valid) { copy_v3_v3(b->min, point); diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c index 8aebbbefb31..b37d940195e 100644 --- a/source/blender/blenkernel/intern/fluid.c +++ b/source/blender/blenkernel/intern/fluid.c @@ -655,7 +655,7 @@ typedef struct FluidObjectBB { int total_cells, valid; } FluidObjectBB; -static void bb_boundInsert(FluidObjectBB *bb, float point[3]) +static void bb_boundInsert(FluidObjectBB *bb, const float point[3]) { int i = 0; if (!bb->valid) { diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c index a7adbed6c4b..3e568bd5e1e 100644 --- a/source/blender/blenkernel/intern/gpencil_curve.c +++ b/source/blender/blenkernel/intern/gpencil_curve.c @@ -50,7 +50,7 @@ #include "DEG_depsgraph_query.h" /* Helper: Check materials with same color. */ -static int gpencil_check_same_material_color(Object *ob_gp, float color[4], Material **r_mat) +static int gpencil_check_same_material_color(Object *ob_gp, const float color[4], Material **r_mat) { Material *ma = NULL; float color_cu[4]; diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index faaaafc391d..444ed0c65b5 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -1512,7 +1512,8 @@ static void mask_layer_shape_from_mask_point(BezTriple *bezt, fp[7] = bezt->radius; } -static void mask_layer_shape_to_mask_point(BezTriple *bezt, float fp[MASK_OBJECT_SHAPE_ELEM_SIZE]) +static void mask_layer_shape_to_mask_point(BezTriple *bezt, + const float fp[MASK_OBJECT_SHAPE_ELEM_SIZE]) { copy_v2_v2(bezt->vec[0], &fp[0]); copy_v2_v2(bezt->vec[1], &fp[2]); diff --git a/source/blender/blenkernel/intern/multires_reshape_apply_base.c b/source/blender/blenkernel/intern/multires_reshape_apply_base.c index 105e56e4219..10a43a4c9b8 100644 --- a/source/blender/blenkernel/intern/multires_reshape_apply_base.c +++ b/source/blender/blenkernel/intern/multires_reshape_apply_base.c @@ -72,7 +72,7 @@ void multires_reshape_apply_base_update_mesh_coords(MultiresReshapeContext *resh /* Assumes no is normalized; return value's sign is negative if v is on the other side of the * plane. */ -static float v3_dist_from_plane(float v[3], float center[3], float no[3]) +static float v3_dist_from_plane(const float v[3], const float center[3], const float no[3]) { float s[3]; sub_v3_v3v3(s, v, center); diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c index dac9b1f1cfe..f485f3d2419 100644 --- a/source/blender/blenkernel/intern/object_dupli.c +++ b/source/blender/blenkernel/intern/object_dupli.c @@ -144,7 +144,10 @@ static void copy_dupli_context( /* generate a dupli instance * mat is transform of the object relative to current context (including object obmat) */ -static DupliObject *make_dupli(const DupliContext *ctx, Object *ob, float mat[4][4], int index) +static DupliObject *make_dupli(const DupliContext *ctx, + Object *ob, + const float mat[4][4], + int index) { DupliObject *dob; int i; diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c index 29f6194d404..da5fdc85561 100644 --- a/source/blender/blenkernel/intern/particle_child.c +++ b/source/blender/blenkernel/intern/particle_child.c @@ -684,7 +684,7 @@ static void do_rough(const float loc[3], } static void do_rough_end( - const float loc[3], float mat[4][4], float t, float fac, float shape, ParticleKey *state) + const float loc[3], const float mat[4][4], float t, float fac, float shape, ParticleKey *state) { float rough[2]; float roughfac; diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index a66cba1f01a..1d56db3779a 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1051,7 +1051,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), /* --- the aabb section*/ /* +++ the face external section*/ -static int sb_detect_face_pointCached(float face_v1[3], +static int sb_detect_face_pointCached(const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, @@ -1149,7 +1149,7 @@ static int sb_detect_face_pointCached(float face_v1[3], return deflected; } -static int sb_detect_face_collisionCached(float face_v1[3], +static int sb_detect_face_collisionCached(const float face_v1[3], const float face_v2[3], const float face_v3[3], float *damp, @@ -1328,7 +1328,7 @@ static void scan_for_ext_face_forces(Object *ob, float timenow) /* +++ the spring external section*/ -static int sb_detect_edge_collisionCached(float edge_v1[3], +static int sb_detect_edge_collisionCached(const float edge_v1[3], const float edge_v2[3], float *damp, float force[3], |