[Bf-blender-cvs] [0547a775364] master: Cleanup: use const args, variables

Campbell Barton noreply at git.blender.org
Sat Sep 14 00:14:56 CEST 2019


Commit: 0547a7753643f45861306542857d97215ecb2c4f
Author: Campbell Barton
Date:   Sat Sep 14 08:10:50 2019 +1000
Branches: master
https://developer.blender.org/rB0547a7753643f45861306542857d97215ecb2c4f

Cleanup: use const args, variables

===================================================================

M	source/blender/blenkernel/intern/armature.c
M	source/blender/blenkernel/intern/collision.c
M	source/blender/blenkernel/intern/constraint.c
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenkernel/intern/multires.c
M	source/blender/blenkernel/intern/object_dupli.c
M	source/blender/blenkernel/intern/particle_child.c
M	source/blender/blenkernel/intern/particle_system.c
M	source/blender/blenkernel/intern/softbody.c
M	source/blender/blenkernel/intern/studiolight.c
M	source/blender/blenlib/intern/voronoi_2d.c
M	source/blender/bmesh/intern/bmesh_interp.c
M	source/blender/bmesh/intern/bmesh_polygon_edgenet.c
M	source/blender/bmesh/tools/bmesh_intersect_edges.c
M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M	source/blender/draw/engines/gpencil/gpencil_render.c
M	source/blender/draw/engines/workbench/workbench_studiolight.c
M	source/blender/draw/intern/draw_cache.c
M	source/blender/draw/intern/draw_cache_impl_curve.c
M	source/blender/draw/modes/object_mode.c
M	source/blender/editors/gizmo_library/gizmo_library_presets.c
M	source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c
M	source/blender/editors/gpencil/annotate_draw.c
M	source/blender/editors/gpencil/drawgpencil.c
M	source/blender/editors/gpencil/gpencil_brush.c
M	source/blender/editors/gpencil/gpencil_edit.c
M	source/blender/editors/gpencil/gpencil_select.c
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/interface/interface_icons.c
M	source/blender/editors/interface/interface_widgets.c
M	source/blender/editors/mesh/editmesh_add_gizmo.c
M	source/blender/editors/mesh/meshtools.c
M	source/blender/editors/object/object_transform.c
M	source/blender/editors/object/object_vgroup.c
M	source/blender/editors/object/object_warp.c
M	source/blender/editors/physics/particle_edit.c
M	source/blender/editors/physics/particle_object.c
M	source/blender/editors/screen/area.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_image_proj.c
M	source/blender/editors/sculpt_paint/paint_utils.c
M	source/blender/editors/sculpt_paint/sculpt.c
M	source/blender/editors/sculpt_paint/sculpt_uv.c
M	source/blender/editors/space_clip/clip_draw.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/tracking_ops.c
M	source/blender/editors/space_clip/tracking_ops_plane.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/editors/space_console/console_ops.c
M	source/blender/editors/space_view3d/view3d_gizmo_navigate.c
M	source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
M	source/blender/editors/space_view3d/view3d_project.c
M	source/blender/editors/transform/transform.c
M	source/blender/editors/transform/transform_convert_graph.c
M	source/blender/editors/transform/transform_convert_mask.c
M	source/blender/editors/transform/transform_convert_mesh.c
M	source/blender/editors/transform/transform_convert_tracking.c
M	source/blender/editors/transform/transform_snap_object.c
M	source/blender/editors/uvedit/uvedit_buttons.c
M	source/blender/editors/uvedit/uvedit_ops.c
M	source/blender/editors/uvedit/uvedit_unwrap_ops.c
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/imbuf/intern/stereoimbuf.c
M	source/blender/modifiers/intern/MOD_array.c
M	source/blender/modifiers/intern/MOD_mirror.c
M	source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
M	source/blender/render/intern/source/bake_api.c
M	source/blender/windowmanager/intern/wm_cursors.c

===================================================================

diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index c31d1a77404..d74c8e6d258 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -1005,9 +1005,9 @@ void BKE_pchan_bbone_handles_compute(const BBoneSplineParameters *param,
 }
 
 static void make_bbone_spline_matrix(BBoneSplineParameters *param,
-                                     float scalemats[2][4][4],
-                                     float pos[3],
-                                     float axis[3],
+                                     const float scalemats[2][4][4],
+                                     const float pos[3],
+                                     const float axis[3],
                                      float roll,
                                      float scalex,
                                      float scaley,
diff --git a/source/blender/blenkernel/intern/collision.c b/source/blender/blenkernel/intern/collision.c
index 2c3b933af69..91d66e16dde 100644
--- a/source/blender/blenkernel/intern/collision.c
+++ b/source/blender/blenkernel/intern/collision.c
@@ -188,11 +188,11 @@ BLI_INLINE int next_ind(int i)
 }
 
 static float compute_collision_point(float a1[3],
-                                     float a2[3],
-                                     float a3[3],
-                                     float b1[3],
-                                     float b2[3],
-                                     float b3[3],
+                                     const float a2[3],
+                                     const float a3[3],
+                                     const float b1[3],
+                                     const float b2[3],
+                                     const float b3[3],
                                      bool culling,
                                      bool use_normal,
                                      float r_a[3],
@@ -419,7 +419,7 @@ static float compute_collision_point(float a1[3],
 
 // w3 is not perfect
 static void collision_compute_barycentric(
-    float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3)
+    const float pv[3], float p1[3], float p2[3], float p3[3], float *w1, float *w2, float *w3)
 {
   /* dot_v3v3 */
 #define INPR(v1, v2) ((v1)[0] * (v2)[0] + (v1)[1] * (v2)[1] + (v1)[2] * (v2)[2])
@@ -1499,7 +1499,7 @@ BLI_INLINE bool cloth_point_face_collision_params(const float p1[3],
 }
 
 static CollPair *cloth_point_collpair(float p1[3],
-                                      float p2[3],
+                                      const float p2[3],
                                       const MVert *mverts,
                                       int bp1,
                                       int bp2,
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 9b32996aa96..d59849695ff 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -2410,9 +2410,9 @@ static void armdef_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
 }
 
 static void armdef_accumulate_matrix(float obmat[4][4],
-                                     float iobmat[4][4],
-                                     float basemat[4][4],
-                                     float bonemat[4][4],
+                                     const float iobmat[4][4],
+                                     const float basemat[4][4],
+                                     const float bonemat[4][4],
                                      float weight,
                                      float r_sum_mat[4][4],
                                      DualQuat *r_sum_dq)
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index a50926ae7ab..7a6189bbbc6 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -2645,7 +2645,7 @@ static int gpencil_check_same_material_color(Object *ob_gp, float color[4], Mate
 /* Helper: Add gpencil material using curve material as base. */
 static Material *gpencil_add_from_curve_material(Main *bmain,
                                                  Object *ob_gp,
-                                                 float cu_color[4],
+                                                 const float cu_color[4],
                                                  const bool gpencil_lines,
                                                  const bool fill,
                                                  int *r_idx)
@@ -2686,7 +2686,7 @@ static void gpencil_add_new_points(bGPDstroke *gps,
                                    float pressure,
                                    int init,
                                    int totpoints,
-                                   float init_co[3],
+                                   const float init_co[3],
                                    bool last)
 {
   for (int i = 0; i < totpoints; i++) {
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 43bc05ffdc0..8cf960a7f14 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -2348,7 +2348,7 @@ static void multires_apply_uniform_scale(Object *object, const float scale)
 static void multires_apply_smat(struct Depsgraph *UNUSED(depsgraph),
                                 Scene *scene,
                                 Object *object,
-                                float smat[3][3])
+                                const float smat[3][3])
 {
   const MultiresModifierData *mmd = get_multires_modifier(scene, object, true);
   if (mmd == NULL || mmd->totlvl == 0) {
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 8ffb99dd8ab..b9c4adafab2 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -93,8 +93,11 @@ typedef struct DupliGenerator {
 static const DupliGenerator *get_dupli_generator(const DupliContext *ctx);
 
 /* create initial context for root object */
-static void init_context(
-    DupliContext *r_ctx, Depsgraph *depsgraph, Scene *scene, Object *ob, float space_mat[4][4])
+static void init_context(DupliContext *r_ctx,
+                         Depsgraph *depsgraph,
+                         Scene *scene,
+                         Object *ob,
+                         const float space_mat[4][4])
 {
   r_ctx->depsgraph = depsgraph;
   r_ctx->scene = scene;
@@ -118,7 +121,7 @@ static void init_context(
 
 /* create sub-context for recursive duplis */
 static void copy_dupli_context(
-    DupliContext *r_ctx, const DupliContext *ctx, Object *ob, float mat[4][4], int index)
+    DupliContext *r_ctx, const DupliContext *ctx, Object *ob, const float mat[4][4], int index)
 {
   *r_ctx = *ctx;
 
@@ -204,7 +207,7 @@ static DupliObject *make_dupli(const DupliContext *ctx, Object *ob, float mat[4]
  */
 static void make_recursive_duplis(const DupliContext *ctx,
                                   Object *ob,
-                                  float space_mat[4][4],
+                                  const float space_mat[4][4],
                                   int index)
 {
   /* simple preventing of too deep nested collections with MAX_DUPLI_RECUR */
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index 888ec753c54..dcd2a0b8fae 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -657,7 +657,7 @@ float do_clump(ParticleKey *state,
 }
 
 static void do_rough(const float loc[3],
-                     float mat[4][4],
+                     const float mat[4][4],
                      float t,
                      float fac,
                      float size,
@@ -701,7 +701,7 @@ static void do_rough_end(
 }
 
 static void do_rough_curve(const float loc[3],
-                           float mat[4][4],
+                           const float mat[4][4],
                            float time,
                            float fac,
                            float size,
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index 2655382021a..43484a57f1c 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -1695,7 +1695,7 @@ typedef struct SPHRangeData {
 
 static void sph_evaluate_func(BVHTree *tree,
                               ParticleSystem **psys,
-                              float co[3],
+                              const float co[3],
                               SPHRangeData *pfr,
                               float interaction_radius,
                               BVHTree_RangeQuery callback)
@@ -2497,7 +2497,7 @@ static float collision_point_distance_with_normal(
   return 0;
 }
 static void collision_point_on_surface(
-    float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *co)
+    const float p[3], ParticleCollisionElement *pce, float fac, ParticleCollision *col, float *co)
 {
   collision_interpolate_element(pce, 0.f, fac, col);
 
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index d3b72fb295d..b56403dfb6d 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -1049,8 +1049,8 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
 
 /* +++ the face external section*/
 static int sb_detect_face_pointCached(float face_v1[3],
-                                      float face_v2[3],
-                                      float face_v3[3],
+                                      const float face_v2[3],
+                                      const float face_v3[3],
                                       float *damp,
                                       float force[3],
                                       struct Object *vertexowner,
@@ -1147,8 +1147,8 @@

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list