[Bf-blender-cvs] [725973485a9] master: Clang Tidy: enable readability-non-const-parameter warning

Jacques Lucke noreply at git.blender.org
Mon Jul 13 11:28:00 CEST 2020


Commit: 725973485a909c2b732c58bd49d06a75edd52f7e
Author: Jacques Lucke
Date:   Mon Jul 13 11:27:09 2020 +0200
Branches: master
https://developer.blender.org/rB725973485a909c2b732c58bd49d06a75edd52f7e

Clang Tidy: enable readability-non-const-parameter warning

Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.

Differential Revision: https://developer.blender.org/D8199

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

M	.clang-tidy
M	source/blender/blenkernel/BKE_appdir.h
M	source/blender/blenkernel/BKE_curve.h
M	source/blender/blenkernel/BKE_deform.h
M	source/blender/blenkernel/BKE_fcurve.h
M	source/blender/blenkernel/BKE_fluid.h
M	source/blender/blenkernel/BKE_mesh.h
M	source/blender/blenkernel/BKE_mesh_mapping.h
M	source/blender/blenkernel/BKE_object_deform.h
M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/BKE_pointcache.h
M	source/blender/blenkernel/intern/appdir.c
M	source/blender/blenkernel/intern/cloth.c
M	source/blender/blenkernel/intern/curve.c
M	source/blender/blenkernel/intern/data_transfer.c
M	source/blender/blenkernel/intern/deform.c
M	source/blender/blenkernel/intern/dynamicpaint.c
M	source/blender/blenkernel/intern/fcurve.c
M	source/blender/blenkernel/intern/fluid.c
M	source/blender/blenkernel/intern/gpencil_geom.c
M	source/blender/blenkernel/intern/key.c
M	source/blender/blenkernel/intern/mask.c
M	source/blender/blenkernel/intern/mask_rasterize.c
M	source/blender/blenkernel/intern/mesh_evaluate.c
M	source/blender/blenkernel/intern/mesh_mapping.c
M	source/blender/blenkernel/intern/mesh_remap.c
M	source/blender/blenkernel/intern/multires.c
M	source/blender/blenkernel/intern/multires_unsubdivide.c
M	source/blender/blenkernel/intern/object_deform.c
M	source/blender/blenkernel/intern/ocean.c
M	source/blender/blenkernel/intern/particle_distribute.c
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenkernel/intern/seqeffects.c
M	source/blender/blenkernel/intern/seqmodifier.c
M	source/blender/blenkernel/intern/sequencer.c
M	source/blender/blenlib/BLI_fileops.h
M	source/blender/blenlib/BLI_math_color.h
M	source/blender/blenlib/BLI_math_matrix.h
M	source/blender/blenlib/BLI_rand.h
M	source/blender/blenlib/BLI_voxel.h
M	source/blender/blenlib/intern/delaunay_2d.c
M	source/blender/blenlib/intern/math_color.c
M	source/blender/blenlib/intern/math_matrix.c
M	source/blender/blenlib/intern/noise.c
M	source/blender/blenlib/intern/rand.cc
M	source/blender/blenlib/intern/storage.c
M	source/blender/blenlib/intern/system.c
M	source/blender/blenlib/intern/voronoi_2d.c
M	source/blender/blenlib/intern/voxel.c
M	source/blender/bmesh/tools/bmesh_region_match.c
M	source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cpp
M	source/blender/compositor/operations/COM_GlareFogGlowOperation.cpp
M	source/blender/compositor/operations/COM_VectorBlurOperation.cpp
M	source/blender/draw/engines/eevee/eevee_materials.c
M	source/blender/draw/engines/eevee/eevee_private.h
M	source/blender/draw/engines/eevee/eevee_temporal_sampling.c
M	source/blender/draw/engines/overlay/overlay_armature.c
M	source/blender/draw/engines/overlay/overlay_extra.c
M	source/blender/draw/intern/DRW_render.h
M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager.h
M	source/blender/draw/intern/draw_manager_data.c
M	source/blender/draw/intern/draw_manager_shader.c
M	source/blender/editors/animation/anim_markers.c
M	source/blender/editors/armature/meshlaplacian.c
M	source/blender/editors/armature/meshlaplacian.h
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/editors/gpencil/gpencil_vertex_paint.c
M	source/blender/editors/include/ED_fileselect.h
M	source/blender/editors/include/ED_gpencil.h
M	source/blender/editors/include/ED_image.h
M	source/blender/editors/include/ED_node.h
M	source/blender/editors/include/ED_view3d.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/interface/interface.c
M	source/blender/editors/lattice/editlattice_select.c
M	source/blender/editors/mask/mask_add.c
M	source/blender/editors/mesh/editmesh_utils.c
M	source/blender/editors/sculpt_paint/paint_cursor.c
M	source/blender/editors/sculpt_paint/paint_image_2d.c
M	source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
M	source/blender/editors/sculpt_paint/sculpt_cloth.c
M	source/blender/editors/space_clip/clip_ops.c
M	source/blender/editors/space_clip/tracking_ops_track.c
M	source/blender/editors/space_clip/tracking_select.c
M	source/blender/editors/space_file/filelist.c
M	source/blender/editors/space_file/filesel.c
M	source/blender/editors/space_file/fsmenu.c
M	source/blender/editors/space_image/image_buttons.c
M	source/blender/editors/space_image/image_draw.c
M	source/blender/editors/space_node/node_edit.c
M	source/blender/editors/space_node/node_view.c
M	source/blender/editors/space_sequencer/sequencer_scopes.c
M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/space_view3d/view3d_utils.c
M	source/blender/editors/transform/transform_snap_object.c
M	source/blender/editors/uvedit/uvedit_parametrizer.c
M	source/blender/editors/uvedit/uvedit_select.c
M	source/blender/editors/uvedit/uvedit_smart_stitch.c
M	source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
M	source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
M	source/blender/freestyle/intern/scene_graph/SceneHash.cpp
M	source/blender/freestyle/intern/scene_graph/SceneHash.h
M	source/blender/freestyle/intern/view_map/CulledOccluderSource.cpp
M	source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp
M	source/blender/gpu/GPU_buffers.h
M	source/blender/gpu/GPU_material.h
M	source/blender/gpu/intern/gpu_buffers.c
M	source/blender/gpu/intern/gpu_material.c
M	source/blender/imbuf/IMB_imbuf.h
M	source/blender/imbuf/intern/colormanagement.c
M	source/blender/imbuf/intern/dds/BlockDXT.cpp
M	source/blender/imbuf/intern/dds/BlockDXT.h
M	source/blender/imbuf/intern/filter.c
M	source/blender/imbuf/intern/imageprocess.c
M	source/blender/imbuf/intern/indexer.c
M	source/blender/imbuf/intern/iris.c
M	source/blender/imbuf/intern/radiance_hdr.c
M	source/blender/imbuf/intern/tiff.c
M	source/blender/io/alembic/exporter/abc_export_capi.cc
M	source/blender/io/avi/intern/avi_mjpeg.c
M	source/blender/io/avi/intern/avi_mjpeg.h
M	source/blender/io/avi/intern/avi_rgb.c
M	source/blender/io/avi/intern/avi_rgb.h
M	source/blender/io/collada/MeshImporter.cpp
M	source/blender/io/collada/MeshImporter.h
M	source/blender/io/collada/TransformWriter.cpp
M	source/blender/io/collada/TransformWriter.h
M	source/blender/io/collada/collada_utils.cpp
M	source/blender/io/collada/collada_utils.h
M	source/blender/io/usd/intern/usd_capi.cc
M	source/blender/makesrna/intern/rna_access_internal.h
M	source/blender/modifiers/intern/MOD_explode.c
M	source/blender/nodes/shader/nodes/node_shader_tex_sky.c
M	source/blender/physics/intern/hair_volume.cpp
M	source/blender/physics/intern/implicit_blender.c
M	source/blender/python/generic/bgl.c
M	source/blender/python/intern/bpy_capi_utils.h
M	source/blender/python/intern/bpy_interface.c
M	source/blender/python/mathutils/mathutils_geometry.c
M	source/blender/render/intern/source/multires_bake.c
M	source/blender/windowmanager/WM_api.h
M	source/blender/windowmanager/intern/wm_jobs.c

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

diff --git a/.clang-tidy b/.clang-tidy
index df5fc05bfd1..ad8a89cab87 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -14,7 +14,6 @@ Checks:  >
 
   -readability-else-after-return,
   -readability-inconsistent-declaration-parameter-name,
-  -readability-non-const-parameter,
   -readability-redundant-preprocessor,
   -readability-function-size,
   -readability-function-size,
diff --git a/source/blender/blenkernel/BKE_appdir.h b/source/blender/blenkernel/BKE_appdir.h
index e49fc260810..7e2aaf291c5 100644
--- a/source/blender/blenkernel/BKE_appdir.h
+++ b/source/blender/blenkernel/BKE_appdir.h
@@ -51,7 +51,7 @@ const char *BKE_appdir_program_path(void);
 const char *BKE_appdir_program_dir(void);
 
 /* Return OS fonts directory. */
-bool BKE_appdir_font_folder_default(char *dir);
+bool BKE_appdir_font_folder_default(const char *dir);
 
 /* find python executable */
 bool BKE_appdir_program_python_search(char *fullpath,
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index d32ab474229..ca41e51984b 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -140,7 +140,7 @@ void BKE_curve_nurbs_vert_coords_apply(struct ListBase *lb,
 float (*BKE_curve_nurbs_key_vert_coords_alloc(struct ListBase *lb,
                                               float *key,
                                               int *r_vert_len))[3];
-void BKE_curve_nurbs_key_vert_tilts_apply(struct ListBase *lb, float *key);
+void BKE_curve_nurbs_key_vert_tilts_apply(struct ListBase *lb, const float *key);
 
 void BKE_curve_editNurb_keyIndex_delCV(struct GHash *keyindex, const void *cv);
 void BKE_curve_editNurb_keyIndex_free(struct GHash **keyindex);
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h
index 04b85aebb39..f59e796c98c 100644
--- a/source/blender/blenkernel/BKE_deform.h
+++ b/source/blender/blenkernel/BKE_deform.h
@@ -111,7 +111,7 @@ void BKE_defvert_sync_mapped(struct MDeformVert *dvert_dst,
                              const int *flip_map,
                              const int flip_map_len,
                              const bool use_ensure);
-void BKE_defvert_remap(struct MDeformVert *dvert, int *map, const int map_len);
+void BKE_defvert_remap(struct MDeformVert *dvert, const int *map, const int map_len);
 void BKE_defvert_flip(struct MDeformVert *dvert, const int *flip_map, const int flip_map_len);
 void BKE_defvert_flip_merged(struct MDeformVert *dvert,
                              const int *flip_map,
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index c3a597e29b9..ddd0cc286ab 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -271,7 +271,7 @@ void testhandles_fcurve(struct FCurve *fcu, eBezTriple_Flag sel_flag, const bool
 void sort_time_fcurve(struct FCurve *fcu);
 short test_time_fcurve(struct FCurve *fcu);
 
-void correct_bezpart(float v1[2], float v2[2], float v3[2], float v4[2]);
+void correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2]);
 
 /* -------- Evaluation --------  */
 
diff --git a/source/blender/blenkernel/BKE_fluid.h b/source/blender/blenkernel/BKE_fluid.h
index c958afb212e..2392263181d 100644
--- a/source/blender/blenkernel/BKE_fluid.h
+++ b/source/blender/blenkernel/BKE_fluid.h
@@ -37,7 +37,7 @@ struct Main;
 struct Scene;
 
 typedef float (*BKE_Fluid_BresenhamFn)(
-    float *result, float *input, int res[3], int *pixel, float *tRay, float correct);
+    float *result, const float *input, int res[3], int *pixel, float *tRay, float correct);
 
 struct Mesh *BKE_fluid_modifier_do(struct FluidModifierData *fmd,
                                    struct Depsgraph *depsgraph,
@@ -56,9 +56,9 @@ bool BKE_fluid_reallocate_fluid(struct FluidDomainSettings *fds, int res[3], int
 void BKE_fluid_reallocate_copy_fluid(struct FluidDomainSettings *fds,
                                      int o_res[3],
                                      int n_res[3],
-                                     int o_min[3],
-                                     int n_min[3],
-                                     int o_max[3],
+                                     const int o_min[3],
+                                     const int n_min[3],
+                                     const int o_max[3],
                                      int o_shift[3],
                                      int n_shift[3]);
 void BKE_fluid_cache_free_all(struct FluidDomainSettings *fds, struct Object *ob);
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 7d989bfcf69..b2510be656e 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -513,13 +513,13 @@ void BKE_mesh_loops_to_mface_corners(struct CustomData *fdata,
 void BKE_mesh_loops_to_tessdata(struct CustomData *fdata,
                                 struct CustomData *ldata,
                                 struct MFace *mface,
-                                int *polyindices,
+                                const int *polyindices,
                                 unsigned int (*loopindices)[4],
                                 const int num_faces);
 void BKE_mesh_tangent_loops_to_tessdata(struct CustomData *fdata,
                                         struct CustomData *ldata,
                                         struct MFace *mface,
-                                        int *polyindices,
+                                        const int *polyindices,
                                         unsigned int (*loopindices)[4],
                                         const int num_faces,
                                         const char *layer_name);
diff --git a/source/blender/blenkernel/BKE_mesh_mapping.h b/source/blender/blenkernel/BKE_mesh_mapping.h
index 9864cc4d28d..5ad5238bbb5 100644
--- a/source/blender/blenkernel/BKE_mesh_mapping.h
+++ b/source/blender/blenkernel/BKE_mesh_mapping.h
@@ -199,7 +199,7 @@ void BKE_mesh_loop_islands_clear(MeshIslandStore *island_store);
 void BKE_mesh_loop_islands_free(MeshIslandStore *island_store);
 void BKE_mesh_loop_islands_add(MeshIslandStore *islands,
                                const int item_num,
-                               int *item_indices,
+                               const int *item_indices,
                                const int num_island_items,
                                int *island_item_indices,
                                const int num_innercut_items,
diff --git a/source/blender/blenkernel/BKE_object_deform.h b/source/blender/blenkernel/BKE_object_deform.h
index 410cb862aa7..e4813aa2288 100644
--- a/source/blender/blenkernel/BKE_object_deform.h
+++ b/source/blender/blenkernel/BKE_object_deform.h
@@ -33,7 +33,7 @@ struct Object;
 struct bDeformGroup;
 
 /* General vgroup operations */
-void BKE_object_defgroup_remap_update_users(struct Object *ob, int *map);
+void BKE_object_defgroup_remap_update_users(struct Object *ob, const int *map);
 
 bool BKE_object_defgroup_array_get(struct ID *id, struct MDeformVert **dvert_arr, int *dvert_tot);
 
diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index f5e2ea51927..da9280148fd 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -224,7 +224,7 @@ void BKE_pbvh_bounding_box(const PBVH *pbvh, float min[3], float max[3]);
 unsigned int **BKE_pbvh_grid_hidden(const PBVH *pbvh);
 
 int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden,
-                              int *grid_indices,
+                              const int *grid_indices,
                               int totgrid,
                               int gridsize);
 
diff --git a/source/blender/blenkernel/BKE_pointcache.h b/source/blender/blenkernel/BKE_pointcache.h
index f919a31c165..a9abe2d0f6d 100644
--- a/source/blender/blenkernel/BKE_pointcache.h
+++ b/source/blender/blenkernel/BKE_pointcache.h
@@ -147,7 +147,7 @@ typedef struct PTCacheID {
   /* copies point data to cache data */
   int (*write_point)(int index, void *calldata, void **data, int cfra);
   /* copies cache cata to point data */
-  void (*read_point)(int index, void *calldata, void **data, float cfra, float *old_data);
+  void (*read_point)(int index, void *calldata, void **data, float cfra, const float *old_data);
   /* interpolated between previously read point data and cache data */
   void (*interpolate_point)(int index,
                             void *calldata,
@@ -155,7 +155,7 @@ typedef struct PTCacheID {
                             float cfra,
                             float cfra1,
                             float cfra2,
-                            float *old_data);
+                            const float *old_data);
 
   /* copies point data to cache data */
   int (*write_stream)(PTCacheFile *pf, void *calldata);
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 58337bcf488..b6f219d7351 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -1019,7 +1019,7 @@ void BKE_tempdir_session_purge(void)
 }
 
 /* Gets a good default directory for fonts */
-bool BKE_appdir_font_folder_default(char *dir)
+bool BKE_appdir_font_folder_default(const char *dir)
 {
   bool success = false;
 #ifdef WIN32
diff --git a/source/blender/blenkernel/intern/cloth.c b/source/blender/blenkernel/intern/cloth.c
index 7c8c1cf6653..f45cd5b679a 100644
--- a/source/blender/blenkernel/intern/cloth.c
+++ b/source/blender/blenkernel/intern/cloth.c
@@ -1037,7 +1037,7 @@ static void cloth_free_errorsprings(Cloth *cloth,
 }
 
 BLI_INLINE void cloth_bend_poly_dir(
-    ClothVertex *verts, int i, int j, int *inds, int len, float r_dir[3])
+    ClothVertex *verts, int i, int j, const int *inds, int len, float r_dir[3])
 {
   float cent[3] = {0};
   float fact = 1.0f / len;
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index c894534c504..e9e44ac05e5 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/i

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list