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
This commit is contained in:
Jacques Lucke 2020-07-13 11:27:09 +02:00
parent a19584a471
commit 725973485a
144 changed files with 460 additions and 298 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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);

View File

@ -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,

View File

@ -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 -------- */

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -1157,7 +1157,7 @@ void BKE_nurb_knot_calc_v(Nurb *nu)
}
static void basisNurb(
float t, short order, int pnts, float *knots, float *basis, int *start, int *end)
float t, short order, int pnts, const float *knots, float *basis, int *start, int *end)
{
float d, e;
int i, i1 = 0, i2 = 0, j, orderpluspnts, opp2, o2;
@ -3560,8 +3560,13 @@ static void free_arrays(void *buffer)
}
/* computes in which direction to change h[i] to satisfy conditions better */
static float bezier_relax_direction(
float *a, float *b, float *c, float *d, float *h, int i, int count)
static float bezier_relax_direction(const float *a,
const float *b,
const float *c,
const float *d,
const float *h,
int i,
int count)
{
/* current deviation between sides of the equation */
float state = a[i] * h[(i + count - 1) % count] + b[i] * h[i] + c[i] * h[(i + 1) % count] - d[i];
@ -3577,8 +3582,15 @@ static void bezier_lock_unknown(float *a, float *b, float *c, float *d, int i, f
d[i] = value;
}
static void bezier_restore_equation(
float *a, float *b, float *c, float *d, float *a0, float *b0, float *c0, float *d0, int i)
static void bezier_restore_equation(float *a,
float *b,
float *c,
float *d,
const float *a0,
const float *b0,
const float *c0,
const float *d0,
int i)
{
a[i] = a0[i];
b[i] = b0[i];
@ -3586,8 +3598,14 @@ static void bezier_restore_equation(
d[i] = d0[i];
}
static bool tridiagonal_solve_with_limits(
float *a, float *b, float *c, float *d, float *h, float *hmin, float *hmax, int solve_count)
static bool tridiagonal_solve_with_limits(float *a,
float *b,
float *c,
float *d,
float *h,
const float *hmin,
const float *hmax,
int solve_count)
{
float *a0, *b0, *c0, *d0;
float **arrays[] = {&a0, &b0, &c0, &d0, NULL};
@ -3726,7 +3744,7 @@ static bool tridiagonal_solve_with_limits(
/* clang-format on */
static void bezier_eq_continuous(
float *a, float *b, float *c, float *d, float *dy, float *l, int i)
float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
{
a[i] = l[i] * l[i];
b[i] = 2.0f * (l[i] + 1);
@ -3735,7 +3753,7 @@ static void bezier_eq_continuous(
}
static void bezier_eq_noaccel_right(
float *a, float *b, float *c, float *d, float *dy, float *l, int i)
float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
{
a[i] = 0.0f;
b[i] = 2.0f;
@ -3744,7 +3762,7 @@ static void bezier_eq_noaccel_right(
}
static void bezier_eq_noaccel_left(
float *a, float *b, float *c, float *d, float *dy, float *l, int i)
float *a, float *b, float *c, float *d, const float *dy, const float *l, int i)
{
a[i] = l[i] * l[i];
b[i] = 2.0f * l[i];
@ -4823,7 +4841,7 @@ float (*BKE_curve_nurbs_key_vert_coords_alloc(ListBase *lb, float *key, int *r_v
return cos;
}
void BKE_curve_nurbs_key_vert_tilts_apply(ListBase *lb, float *key)
void BKE_curve_nurbs_key_vert_tilts_apply(ListBase *lb, const float *key)
{
Nurb *nu;
int i;

View File

@ -562,7 +562,7 @@ static bool data_transfer_layersmapping_cdlayers_multisrc_to_dst(ListBase *r_map
CustomData *cd_dst,
const bool use_dupref_dst,
const int tolayers,
bool *use_layers_src,
const bool *use_layers_src,
const int num_layers_src,
cd_datatransfer_interp interp,
void *interp_data)

View File

@ -249,7 +249,7 @@ void BKE_defvert_sync_mapped(MDeformVert *dvert_dst,
/**
* be sure all flip_map values are valid
*/
void BKE_defvert_remap(MDeformVert *dvert, int *map, const int map_len)
void BKE_defvert_remap(MDeformVert *dvert, const int *map, const int map_len)
{
MDeformWeight *dw = dvert->dw;
unsigned int i;
@ -1184,7 +1184,7 @@ static bool data_transfer_layersmapping_vgroups_multisrc_to_dst(ListBase *r_map,
CustomData *cd_dst,
const bool UNUSED(use_dupref_dst),
const int tolayers,
bool *use_layers_src,
const bool *use_layers_src,
const int num_layers_src)
{
int idx_src;

View File

@ -588,7 +588,7 @@ static bool boundsIntersectDist(Bounds3D *b1, Bounds3D *b2, const float dist)
}
/* check whether bounds intersects a point with given radius */
static bool boundIntersectPoint(Bounds3D *b, float point[3], const float radius)
static bool boundIntersectPoint(Bounds3D *b, const float point[3], const float radius)
{
if (!b->valid) {
return false;
@ -4780,13 +4780,16 @@ static void dynamic_paint_paint_single_point_cb_ex(void *__restrict userdata,
}
}
static int dynamicPaint_paintSinglePoint(Depsgraph *depsgraph,
DynamicPaintSurface *surface,
float *pointCoord,
DynamicPaintBrushSettings *brush,
Object *brushOb,
Scene *scene,
float timescale)
static int dynamicPaint_paintSinglePoint(
Depsgraph *depsgraph,
DynamicPaintSurface *surface,
/* Cannot be const, because it is assigned to non-const variable.
* NOLINTNEXTLINE: readability-non-const-parameter. */
float *pointCoord,
DynamicPaintBrushSettings *brush,
Object *brushOb,
Scene *scene,
float timescale)
{
PaintSurfaceData *sData = surface->data;
float brush_radius = brush->paint_distance * surface->radius_scale;
@ -5456,11 +5459,14 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata,
}
}
static void dynamicPaint_doEffectStep(DynamicPaintSurface *surface,
float *force,
PaintPoint *prevPoint,
float timescale,
float steps)
static void dynamicPaint_doEffectStep(
DynamicPaintSurface *surface,
/* Cannot be const, because it is assigned to non-const variable.
* NOLINTNEXTLINE: readability-non-const-parameter. */
float *force,
PaintPoint *prevPoint,
float timescale,
float steps)
{
PaintSurfaceData *sData = surface->data;

View File

@ -1277,7 +1277,7 @@ short test_time_fcurve(FCurve *fcu)
* than the horizontal distance between (v1-v4).
* This is to prevent curve loops.
*/
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])
{
float h1[2], h2[2], len1, len2, len, fac;

View File

@ -137,9 +137,9 @@ bool BKE_fluid_reallocate_fluid(FluidDomainSettings *fds, int res[3], int free_o
void BKE_fluid_reallocate_copy_fluid(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])
{
@ -559,7 +559,7 @@ static bool BKE_fluid_modifier_init(
// forward declaration
static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *view_layer);
static float calc_voxel_transp(
float *result, float *input, int res[3], int *pixel, float *t_ray, float correct);
float *result, const float *input, int res[3], int *pixel, float *t_ray, float correct);
static void update_distances(int index,
float *fesh_distances,
BVHTreeFromMesh *tree_data,
@ -594,8 +594,8 @@ static int get_light(ViewLayer *view_layer, float *light)
static void clamp_bounds_in_domain(FluidDomainSettings *fds,
int min[3],
int max[3],
float *min_vel,
float *max_vel,
const float *min_vel,
const float *max_vel,
int margin,
float dt)
{
@ -1830,7 +1830,7 @@ static void sample_mesh(FluidFlowSettings *ffs,
float *velocity_map,
int index,
const int base_res[3],
float flow_center[3],
const float flow_center[3],
BVHTreeFromMesh *tree_data,
const float ray_start[3],
const float *vert_vel,
@ -4196,7 +4196,7 @@ struct Mesh *BKE_fluid_modifier_do(
}
static float calc_voxel_transp(
float *result, float *input, int res[3], int *pixel, float *t_ray, float correct)
float *result, const float *input, int res[3], int *pixel, float *t_ray, float correct)
{
const size_t index = manta_get_index(pixel[0], res[0], pixel[1], res[1], pixel[2]);

View File

@ -1146,7 +1146,7 @@ void BKE_gpencil_stroke_2d_flat_ref(const bGPDspoint *ref_points,
static void gpencil_calc_stroke_fill_uv(const float (*points2d)[2],
bGPDstroke *gps,
const float minv[2],
float maxv[2],
const float maxv[2],
float (*r_uv)[2])
{
const float s = sin(gps->uv_rotation);

View File

@ -529,7 +529,13 @@ static int setkeys(float fac, ListBase *lb, KeyBlock *k[], float t[4], int cycl)
return 0;
}
static void flerp(int tot, float *in, float *f0, float *f1, float *f2, float *f3, float *t)
static void flerp(int tot,
float *in,
const float *f0,
const float *f1,
const float *f2,
const float *f3,
const float *t)
{
int a;
@ -538,7 +544,7 @@ static void flerp(int tot, float *in, float *f0, float *f1, float *f2, float *f3
}
}
static void rel_flerp(int tot, float *in, float *ref, float *out, float fac)
static void rel_flerp(int tot, float *in, const float *ref, const float *out, float fac)
{
int a;

View File

@ -624,7 +624,7 @@ void BKE_mask_point_segment_co(MaskSpline *spline, MaskSplinePoint *point, float
co, bezt->vec[1], bezt->vec[2], bezt_next->vec[0], bezt_next->vec[1], u);
}
BLI_INLINE void orthogonal_direction_get(float vec[2], float result[2])
BLI_INLINE void orthogonal_direction_get(const float vec[2], float result[2])
{
result[0] = -vec[1];
result[1] = vec[0];

View File

@ -1256,7 +1256,7 @@ static float maskrasterize_layer_z_depth_quad(
return w[2] + w[3]; /* we can make this assumption for small speedup */
}
static float maskrasterize_layer_isect(unsigned int *face,
static float maskrasterize_layer_isect(const unsigned int *face,
float (*cos)[3],
const float dist_orig,
const float xy[2])
@ -1489,6 +1489,8 @@ static void maskrasterize_buffer_cb(void *__restrict userdata,
void BKE_maskrasterize_buffer(MaskRasterHandle *mr_handle,
const unsigned int width,
const unsigned int height,
/* Cannot be const, because it is assigned to non-const variable.
* NOLINTNEXTLINE: readability-non-const-parameter. */
float *buffer)
{
const float x_inv = 1.0f / (float)width;

View File

@ -2888,7 +2888,7 @@ void BKE_mesh_loops_to_mface_corners(
void BKE_mesh_loops_to_tessdata(CustomData *fdata,
CustomData *ldata,
MFace *mface,
int *polyindices,
const int *polyindices,
unsigned int (*loopindices)[4],
const int num_faces)
{
@ -2981,7 +2981,7 @@ void BKE_mesh_loops_to_tessdata(CustomData *fdata,
void BKE_mesh_tangent_loops_to_tessdata(CustomData *fdata,
CustomData *ldata,
MFace *mface,
int *polyindices,
const int *polyindices,
unsigned int (*loopindices)[4],
const int num_faces,
const char *layer_name)

View File

@ -953,7 +953,7 @@ void BKE_mesh_loop_islands_free(MeshIslandStore *island_store)
void BKE_mesh_loop_islands_add(MeshIslandStore *island_store,
const int item_num,
int *items_indices,
const int *items_indices,
const int num_island_items,
int *island_item_indices,
const int num_innercut_items,

View File

@ -1071,7 +1071,7 @@ static void mesh_island_to_astar_graph_edge_process(MeshIslandStore *islands,
BLI_bitmap *done_edges,
MeshElemMap *edge_to_poly_map,
const bool is_edge_innercut,
int *poly_island_index_map,
const int *poly_island_index_map,
float (*poly_centers)[3],
unsigned char *poly_status)
{

View File

@ -175,7 +175,7 @@ static BLI_bitmap *multires_mdisps_upsample_hidden(BLI_bitmap *lo_hidden,
return subd;
}
static BLI_bitmap *multires_mdisps_downsample_hidden(BLI_bitmap *old_hidden,
static BLI_bitmap *multires_mdisps_downsample_hidden(const BLI_bitmap *old_hidden,
int old_level,
int new_level)
{

View File

@ -80,7 +80,7 @@
/**
* Used to check if a vertex is in a disconnected element ID.
*/
static bool is_vertex_in_id(BMVert *v, int *elem_id, int elem)
static bool is_vertex_in_id(BMVert *v, const int *elem_id, int elem)
{
const int v_index = BM_elem_index_get(v);
return elem_id[v_index] == elem;

View File

@ -68,7 +68,7 @@ static Lattice *object_defgroup_lattice_get(ID *id)
*
* \param map: an array mapping old indices to new indices.
*/
void BKE_object_defgroup_remap_update_users(Object *ob, int *map)
void BKE_object_defgroup_remap_update_users(Object *ob, const int *map)
{
ModifierData *md;
ParticleSystem *psys;

View File

@ -147,19 +147,19 @@ static void init_complex(fftw_complex cmpl, float real, float image)
cmpl[1] = image;
}
static void add_comlex_c(fftw_complex res, fftw_complex cmpl1, fftw_complex cmpl2)
static void add_comlex_c(fftw_complex res, const fftw_complex cmpl1, const fftw_complex cmpl2)
{
res[0] = cmpl1[0] + cmpl2[0];
res[1] = cmpl1[1] + cmpl2[1];
}
static void mul_complex_f(fftw_complex res, fftw_complex cmpl, float f)
static void mul_complex_f(fftw_complex res, const fftw_complex cmpl, float f)
{
res[0] = cmpl[0] * (double)f;
res[1] = cmpl[1] * (double)f;
}
static void mul_complex_c(fftw_complex res, fftw_complex cmpl1, fftw_complex cmpl2)
static void mul_complex_c(fftw_complex res, const fftw_complex cmpl1, const fftw_complex cmpl2)
{
fftwf_complex temp;
temp[0] = cmpl1[0] * cmpl2[0] - cmpl1[1] * cmpl2[1];
@ -178,7 +178,7 @@ static float image_c(fftw_complex cmpl)
return cmpl[1];
}
static void conj_complex(fftw_complex res, fftw_complex cmpl1)
static void conj_complex(fftw_complex res, const fftw_complex cmpl1)
{
res[0] = cmpl1[0];
res[1] = -cmpl1[1];

View File

@ -433,7 +433,7 @@ static void psys_uv_to_w(float u, float v, int quad, float *w)
}
/* Find the index in "sum" array before "value" is crossed. */
static int distribute_binary_search(float *sum, int n, float value)
static int distribute_binary_search(const float *sum, int n, float value)
{
int mid, low = 0, high = n - 1;

View File

@ -358,7 +358,7 @@ static void update_vb(PBVH *pbvh, PBVHNode *node, BBC *prim_bbc, int offset, int
/* Returns the number of visible quads in the nodes' grids. */
int BKE_pbvh_count_grid_quads(BLI_bitmap **grid_hidden,
int *grid_indices,
const int *grid_indices,
int totgrid,
int gridsize)
{

View File

@ -206,7 +206,7 @@ static int ptcache_softbody_write(int index, void *soft_v, void **data, int UNUS
return 1;
}
static void ptcache_softbody_read(
int index, void *soft_v, void **data, float UNUSED(cfra), float *old_data)
int index, void *soft_v, void **data, float UNUSED(cfra), const float *old_data)
{
SoftBody *soft = soft_v;
BodyPoint *bp = soft->bpoint + index;
@ -220,8 +220,13 @@ static void ptcache_softbody_read(
PTCACHE_DATA_TO(data, BPHYS_DATA_VELOCITY, 0, bp->vec);
}
}
static void ptcache_softbody_interpolate(
int index, void *soft_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
static void ptcache_softbody_interpolate(int index,
void *soft_v,
void **data,
float cfra,
float cfra1,
float cfra2,
const float *old_data)
{
SoftBody *soft = soft_v;
BodyPoint *bp = soft->bpoint + index;
@ -316,7 +321,7 @@ static int ptcache_particle_write(int index, void *psys_v, void **data, int cfra
return 1 + (pa->state.time >= pa->time && pa->prev_state.time <= pa->time);
}
static void ptcache_particle_read(
int index, void *psys_v, void **data, float cfra, float *old_data)
int index, void *psys_v, void **data, float cfra, const float *old_data)
{
ParticleSystem *psys = psys_v;
ParticleData *pa;
@ -383,8 +388,13 @@ static void ptcache_particle_read(
unit_qt(pa->state.rot);
}
}
static void ptcache_particle_interpolate(
int index, void *psys_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
static void ptcache_particle_interpolate(int index,
void *psys_v,
void **data,
float cfra,
float cfra1,
float cfra2,
const float *old_data)
{
ParticleSystem *psys = psys_v;
ParticleData *pa;
@ -528,7 +538,7 @@ static int ptcache_cloth_write(int index, void *cloth_v, void **data, int UNUSED
return 1;
}
static void ptcache_cloth_read(
int index, void *cloth_v, void **data, float UNUSED(cfra), float *old_data)
int index, void *cloth_v, void **data, float UNUSED(cfra), const float *old_data)
{
ClothModifierData *clmd = cloth_v;
Cloth *cloth = clmd->clothObject;
@ -545,8 +555,13 @@ static void ptcache_cloth_read(
PTCACHE_DATA_TO(data, BPHYS_DATA_XCONST, 0, vert->xconst);
}
}
static void ptcache_cloth_interpolate(
int index, void *cloth_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
static void ptcache_cloth_interpolate(int index,
void *cloth_v,
void **data,
float cfra,
float cfra1,
float cfra2,
const float *old_data)
{
ClothModifierData *clmd = cloth_v;
Cloth *cloth = clmd->clothObject;
@ -1509,7 +1524,7 @@ static int ptcache_rigidbody_write(int index, void *rb_v, void **data, int UNUSE
return 1;
}
static void ptcache_rigidbody_read(
int index, void *rb_v, void **data, float UNUSED(cfra), float *old_data)
int index, void *rb_v, void **data, float UNUSED(cfra), const float *old_data)
{
RigidBodyWorld *rbw = rb_v;
Object *ob = NULL;
@ -1534,8 +1549,13 @@ static void ptcache_rigidbody_read(
}
}
}
static void ptcache_rigidbody_interpolate(
int index, void *rb_v, void **data, float cfra, float cfra1, float cfra2, float *old_data)
static void ptcache_rigidbody_interpolate(int index,
void *rb_v,
void **data,
float cfra,
float cfra1,
float cfra2,
const float *old_data)
{
RigidBodyWorld *rbw = rb_v;
Object *ob = NULL;
@ -1887,7 +1907,7 @@ static int ptcache_sim_particle_write(int index, void *state_v, void **data, int
return 1;
}
static void ptcache_sim_particle_read(
int index, void *state_v, void **data, float UNUSED(cfra), float *UNUSED(old_data))
int index, void *state_v, void **data, float UNUSED(cfra), const float *UNUSED(old_data))
{
ParticleSimulationState *state = (ParticleSimulationState *)state_v;

View File

@ -2668,7 +2668,7 @@ static void RVAddBitmaps_float(float *a, float *b, float *c, int width, int heig
}
static void RVIsolateHighlights_float(
float *in, float *out, int width, int height, float threshold, float boost, float clamp)
const float *in, float *out, int width, int height, float threshold, float boost, float clamp)
{
int x, y, index;
float intensity;
@ -3423,7 +3423,7 @@ static void do_gaussian_blur_effect_byte_x(Sequence *seq,
int y,
int frame_width,
int UNUSED(frame_height),
unsigned char *rect,
const unsigned char *rect,
unsigned char *out)
{
#define INDEX(_x, _y) (((_y) * (x) + (_x)) * 4)
@ -3473,7 +3473,7 @@ static void do_gaussian_blur_effect_byte_y(Sequence *seq,
int y,
int UNUSED(frame_width),
int frame_height,
unsigned char *rect,
const unsigned char *rect,
unsigned char *out)
{
#define INDEX(_x, _y) (((_y) * (x) + (_x)) * 4)

View File

@ -331,7 +331,7 @@ static void curves_apply_threaded(int width,
unsigned char *rect,
float *rect_float,
unsigned char *mask_rect,
float *mask_rect_float,
const float *mask_rect_float,
void *data_v)
{
CurveMapping *curve_mapping = (CurveMapping *)data_v;
@ -556,7 +556,7 @@ static void brightcontrast_apply_threaded(int width,
unsigned char *rect,
float *rect_float,
unsigned char *mask_rect,
float *mask_rect_float,
const float *mask_rect_float,
void *data_v)
{
BrightContrastThreadData *data = (BrightContrastThreadData *)data_v;
@ -658,7 +658,7 @@ static void maskmodifier_apply_threaded(int width,
unsigned char *rect,
float *rect_float,
unsigned char *mask_rect,
float *mask_rect_float,
const float *mask_rect_float,
void *UNUSED(data_v))
{
int x, y;

View File

@ -2390,7 +2390,7 @@ static void color_balance_byte_float(StripColorBalance *cb_,
static void color_balance_float_float(StripColorBalance *cb_,
float *rect_float,
float *mask_rect_float,
const float *mask_rect_float,
int width,
int height,
float mul)

View File

@ -147,7 +147,7 @@ int BLI_access(const char *filename, int mode) ATTR_WARN_UNUSED_RESULT ATTR_NONN
bool BLI_file_is_writable(const char *file) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
bool BLI_file_touch(const char *file) ATTR_NONNULL();
bool BLI_file_alias_target(char *target, const char *filepath);
bool BLI_file_alias_target(const char *target, const char *filepath);
#if 0 /* UNUSED */
int BLI_file_gzip(const char *from, const char *to) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();

View File

@ -148,8 +148,12 @@ void blackbody_temperature_to_rgb_table(float *r_table, int width, float min, fl
/********* lift/gamma/gain / ASC-CDL conversion ***********/
void lift_gamma_gain_to_asc_cdl(
float *lift, float *gamma, float *gain, float *offset, float *slope, float *power);
void lift_gamma_gain_to_asc_cdl(const float *lift,
const float *gamma,
const float *gain,
float *offset,
float *slope,
float *power);
#if BLI_MATH_DO_INLINE
# include "intern/math_color_inline.c"

View File

@ -64,7 +64,7 @@ void swap_m3m3(float A[3][3], float B[3][3]);
void swap_m4m4(float A[4][4], float B[4][4]);
/* Build index shuffle matrix */
void shuffle_m4(float R[4][4], int index[4]);
void shuffle_m4(float R[4][4], const int index[4]);
/******************************** Arithmetic *********************************/

View File

@ -105,12 +105,12 @@ int BLI_rng_thread_rand(RNG_THREAD_ARRAY *rngarr, int thread) ATTR_WARN_UNUSED_R
/** Return the _n_th number of the given low-discrepancy sequence. */
void BLI_halton_1d(unsigned int prime, double offset, int n, double *r);
void BLI_halton_2d(unsigned int prime[2], double offset[2], int n, double *r);
void BLI_halton_3d(unsigned int prime[3], double offset[3], int n, double *r);
void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r);
void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double *r);
void BLI_hammersley_1d(unsigned int n, double *r);
/** Return the whole low-discrepancy sequence up to _n_. */
void BLI_halton_2d_sequence(unsigned int prime[2], double offset[2], int n, double *r);
void BLI_halton_2d_sequence(const unsigned int prime[2], double offset[2], int n, double *r);
void BLI_hammersley_2d_sequence(unsigned int n, double *r);
#ifdef __cplusplus

View File

@ -35,10 +35,13 @@ extern "C" {
(int64_t)(z) * (int64_t)(res)[0] * (int64_t)(res)[1])
/* all input coordinates must be in bounding box 0.0 - 1.0 */
float BLI_voxel_sample_nearest(float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_trilinear(float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_triquadratic(float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline);
float BLI_voxel_sample_nearest(const float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_trilinear(const float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_triquadratic(const float *data, const int res[3], const float co[3]);
float BLI_voxel_sample_tricubic(const float *data,
const int res[3],
const float co[3],
int bspline);
#ifdef __cplusplus
}

View File

@ -4320,7 +4320,7 @@ static void exactinit(void)
*/
static int fast_expansion_sum_zeroelim(
int elen, double *e, int flen, double *f, double *h) /* h cannot be e or f. */
int elen, const double *e, int flen, const double *f, double *h) /* h cannot be e or f. */
{
double Q;
INEXACT double Qnew;
@ -4405,7 +4405,7 @@ static int fast_expansion_sum_zeroelim(
*/
static int scale_expansion_zeroelim(int elen,
double *e,
const double *e,
double b,
double *h) /* e and h cannot be the same. */
{
@ -4451,7 +4451,7 @@ static int scale_expansion_zeroelim(int elen,
* See either version of my paper for details.
*/
static double estimate(int elen, double *e)
static double estimate(int elen, const double *e)
{
double Q;
int eindex;

View File

@ -503,8 +503,12 @@ int constrain_rgb(float *r, float *g, float *b)
/* ********************** lift/gamma/gain / ASC-CDL conversion ********************************* */
void lift_gamma_gain_to_asc_cdl(
float *lift, float *gamma, float *gain, float *offset, float *slope, float *power)
void lift_gamma_gain_to_asc_cdl(const float *lift,
const float *gamma,
const float *gain,
float *offset,
float *slope,
float *power)
{
int c;
for (c = 0; c < 3; c++) {

View File

@ -248,7 +248,7 @@ void swap_m4m4(float m1[4][4], float m2[4][4])
}
}
void shuffle_m4(float R[4][4], int index[4])
void shuffle_m4(float R[4][4], const int index[4])
{
zero_m4(R);
for (int k = 0; k < 4; k++) {

View File

@ -27,7 +27,7 @@
#include "BLI_noise.h"
/* local */
static float noise3_perlin(float vec[3]);
static float noise3_perlin(const float vec[3]);
// static float turbulence_perlin(const float point[3], float lofreq, float hifreq);
// static float turbulencep(float noisesize, float x, float y, float z, int nr);
@ -779,7 +779,7 @@ static const float g_perlin_data_v3[512 + 2][3] = {
} \
(void)0
static float noise3_perlin(float vec[3])
static float noise3_perlin(const float vec[3])
{
const char *p = g_perlin_data_ub;
const float(*g)[3] = g_perlin_data_v3;

View File

@ -302,7 +302,7 @@ void BLI_halton_1d(unsigned int prime, double offset, int n, double *r)
}
}
void BLI_halton_2d(unsigned int prime[2], double offset[2], int n, double *r)
void BLI_halton_2d(const unsigned int prime[2], double offset[2], int n, double *r)
{
const double invprimes[2] = {1.0 / (double)prime[0], 1.0 / (double)prime[1]};
@ -315,7 +315,7 @@ void BLI_halton_2d(unsigned int prime[2], double offset[2], int n, double *r)
}
}
void BLI_halton_3d(unsigned int prime[3], double offset[3], int n, double *r)
void BLI_halton_3d(const unsigned int prime[3], double offset[3], int n, double *r)
{
const double invprimes[3] = {
1.0 / (double)prime[0], 1.0 / (double)prime[1], 1.0 / (double)prime[2]};
@ -329,7 +329,7 @@ void BLI_halton_3d(unsigned int prime[3], double offset[3], int n, double *r)
}
}
void BLI_halton_2d_sequence(unsigned int prime[2], double offset[2], int n, double *r)
void BLI_halton_2d_sequence(const unsigned int prime[2], double offset[2], int n, double *r)
{
const double invprimes[2] = {1.0 / (double)prime[0], 1.0 / (double)prime[1]};

View File

@ -290,7 +290,7 @@ eFileAttributes BLI_file_attributes(const char *path)
/* Return alias/shortcut file target. Apple version is defined in storage_apple.mm */
#ifndef __APPLE__
bool BLI_file_alias_target(char target[FILE_MAXDIR], const char *filepath)
bool BLI_file_alias_target(const char target[FILE_MAXDIR], const char *filepath)
{
# ifdef WIN32
if (!BLI_path_extension_check(filepath, ".lnk")) {

View File

@ -111,7 +111,11 @@ void BLI_system_backtrace(FILE *fp)
/* NOTE: The code for CPU brand string is adopted from Cycles. */
#if !defined(_WIN32) || defined(FREE_WINDOWS)
static void __cpuid(int data[4], int selector)
static void __cpuid(
/* Cannot be const, because it is modified below.
* NOLINTNEXTLINE: readability-non-const-parameter. */
int data[4],
int selector)
{
# if defined(__x86_64__)
asm("cpuid" : "=a"(data[0]), "=b"(data[1]), "=c"(data[2]), "=d"(data[3]) : "a"(selector));

View File

@ -213,7 +213,7 @@ static void voronoiParabola_setRight(VoronoiParabola *parabola, VoronoiParabola
right->parent = parabola;
}
static float voronoi_getY(VoronoiProcess *process, float p[2], float x)
static float voronoi_getY(VoronoiProcess *process, const float p[2], float x)
{
float ly = process->current_y;

View File

@ -26,7 +26,7 @@
#include "BLI_strict_flags.h"
BLI_INLINE float D(float *data, const int res[3], int x, int y, int z)
BLI_INLINE float D(const float *data, const int res[3], int x, int y, int z)
{
CLAMP(x, 0, res[0] - 1);
CLAMP(y, 0, res[1] - 1);
@ -36,7 +36,7 @@ BLI_INLINE float D(float *data, const int res[3], int x, int y, int z)
/* *** nearest neighbor *** */
/* input coordinates must be in bounding box 0.0 - 1.0 */
float BLI_voxel_sample_nearest(float *data, const int res[3], const float co[3])
float BLI_voxel_sample_nearest(const float *data, const int res[3], const float co[3])
{
int xi, yi, zi;
@ -65,7 +65,7 @@ BLI_INLINE int64_t _clamp(int a, int b, int c)
return (a < b) ? b : ((a > c) ? c : a);
}
float BLI_voxel_sample_trilinear(float *data, const int res[3], const float co[3])
float BLI_voxel_sample_trilinear(const float *data, const int res[3], const float co[3])
{
if (data) {
@ -106,7 +106,7 @@ float BLI_voxel_sample_trilinear(float *data, const int res[3], const float co[3
return 0.f;
}
float BLI_voxel_sample_triquadratic(float *data, const int res[3], const float co[3])
float BLI_voxel_sample_triquadratic(const float *data, const int res[3], const float co[3])
{
if (data) {
@ -161,7 +161,10 @@ float BLI_voxel_sample_triquadratic(float *data, const int res[3], const float c
return 0.f;
}
float BLI_voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline)
float BLI_voxel_sample_tricubic(const float *data,
const int res[3],
const float co[3],
int bspline)
{
if (data) {

View File

@ -1299,7 +1299,9 @@ static UUIDFashMatch *bm_vert_fasthash_create(BMesh *bm, const uint depth)
return id_curr;
}
static void bm_vert_fasthash_edge_order(UUIDFashMatch *fm, const BMEdge *e, UUIDFashMatch e_fm[2])
static void bm_vert_fasthash_edge_order(const UUIDFashMatch *fm,
const BMEdge *e,
UUIDFashMatch e_fm[2])
{
e_fm[0] = fm[BM_elem_index_get(e->v1)];
e_fm[1] = fm[BM_elem_index_get(e->v2)];

View File

@ -26,8 +26,8 @@
// this part has been copied from the double edge mask
static void do_adjacentKeepBorders(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize)
@ -196,8 +196,8 @@ static void do_adjacentKeepBorders(unsigned int t,
static void do_adjacentBleedBorders(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize)
@ -417,8 +417,8 @@ static void do_adjacentBleedBorders(unsigned int t,
static void do_allKeepBorders(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize)
@ -579,8 +579,8 @@ static void do_allKeepBorders(unsigned int t,
static void do_allBleedBorders(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize)
@ -793,8 +793,8 @@ static void do_allBleedBorders(unsigned int t,
static void do_allEdgeDetection(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize,
@ -863,8 +863,8 @@ static void do_allEdgeDetection(unsigned int t,
static void do_adjacentEdgeDetection(unsigned int t,
unsigned int rw,
unsigned int *limask,
unsigned int *lomask,
const unsigned int *limask,
const unsigned int *lomask,
unsigned int *lres,
float *res,
unsigned int *rsize,
@ -935,7 +935,7 @@ static void do_adjacentEdgeDetection(unsigned int t,
static void do_createEdgeLocationBuffer(unsigned int t,
unsigned int rw,
unsigned int *lres,
const unsigned int *lres,
float *res,
unsigned short *gbuf,
unsigned int *innerEdgeOffset,
@ -1060,7 +1060,7 @@ static void do_createEdgeLocationBuffer(unsigned int t,
static void do_fillGradientBuffer(unsigned int rw,
float *res,
unsigned short *gbuf,
const unsigned short *gbuf,
unsigned int isz,
unsigned int osz,
unsigned int gsz,

View File

@ -198,7 +198,7 @@ static void FHT2D(
//------------------------------------------------------------------------------
/* 2D convolution calc, d1 *= d2, M/N - > log2 of width/height */
static void fht_convolve(fREAL *d1, fREAL *d2, unsigned int M, unsigned int N)
static void fht_convolve(fREAL *d1, const fREAL *d2, unsigned int M, unsigned int N)
{
fREAL a, b;
unsigned int i, j, k, L, mj, mL;

View File

@ -514,7 +514,7 @@ void antialias_tagbuf(int xsize, int ysize, char *rectmove)
/* we make this into 3 points, center point is (0, 0) */
/* and offset the center point just enough to make curve go through midpoint */
static void quad_bezier_2d(float *result, float *v1, float *v2, float *ipodata)
static void quad_bezier_2d(float *result, const float *v1, const float *v2, const float *ipodata)
{
float p1[2], p2[2], p3[2];

View File

@ -114,8 +114,8 @@ void EEVEE_material_bind_resources(DRWShadingGroup *shgrp,
GPUMaterial *gpumat,
EEVEE_ViewLayerData *sldata,
EEVEE_Data *vedata,
int *ssr_id,
float *refract_depth,
const int *ssr_id,
const float *refract_depth,
bool use_ssrefraction,
bool use_alpha_blend)
{

View File

@ -1012,8 +1012,8 @@ void EEVEE_material_bind_resources(DRWShadingGroup *shgrp,
struct GPUMaterial *gpumat,
EEVEE_ViewLayerData *sldata,
EEVEE_Data *vedata,
int *ssr_id,
float *refract_depth,
const int *ssr_id,
const float *refract_depth,
bool use_ssrefraction,
bool use_alpha_blend);
/* eevee_lights.c */

View File

@ -96,7 +96,7 @@ static void invert_cdf(const float cdf[FILTER_CDF_TABLE_SIZE],
}
/* Evaluate a discrete function table with linear interpolation. */
static float eval_table(float *table, float x)
static float eval_table(const float *table, float x)
{
CLAMP(x, 0.0f, 1.0f);
x = x * (FILTER_CDF_TABLE_SIZE - 1);

View File

@ -2118,7 +2118,7 @@ static void armature_context_setup(ArmatureDrawContext *ctx,
const bool do_envelope_dist,
const bool is_edit_mode,
const bool is_pose_mode,
float *const_color)
const float *const_color)
{
const bool is_object_mode = !do_envelope_dist;
const bool is_xray = (ob->dtx & OB_DRAWXRAY) != 0 || (pd->armature.do_pose_xray && is_pose_mode);

View File

@ -1356,7 +1356,7 @@ static void OVERLAY_volume_extra(OVERLAY_ExtraCallBuffers *cb,
Object *ob,
ModifierData *md,
Scene *scene,
float *color)
const float *color)
{
FluidModifierData *fmd = (FluidModifierData *)md;
FluidDomainSettings *fds = fmd->domain;

View File

@ -623,7 +623,7 @@ void DRW_render_object_iter(void *vedata,
struct RenderEngine *engine,
struct Depsgraph *depsgraph));
void DRW_render_instance_buffer_finish(void);
void DRW_render_viewport_size_set(int size[2]);
void DRW_render_viewport_size_set(const int size[2]);
void DRW_custom_pipeline(DrawEngineType *draw_engine_type,
struct Depsgraph *depsgraph,

View File

@ -369,7 +369,7 @@ void DRW_engine_viewport_data_size_get(
}
/* WARNING: only use for custom pipeline. 99% of the time, you don't want to use this. */
void DRW_render_viewport_size_set(int size[2])
void DRW_render_viewport_size_set(const int size[2])
{
DST.size[0] = size[0];
DST.size[1] = size[1];

View File

@ -583,7 +583,7 @@ void drw_state_set(DRWState state);
void drw_debug_draw(void);
void drw_debug_init(void);
eDRWCommandType command_type_get(uint64_t *command_type_bits, int index);
eDRWCommandType command_type_get(const uint64_t *command_type_bits, int index);
void drw_batch_cache_validate(Object *ob);
void drw_batch_cache_generate_requested(struct Object *ob);

View File

@ -623,7 +623,7 @@ static void command_type_set(uint64_t *command_type_bits, int index, eDRWCommand
command_type_bits[index / 16] |= ((uint64_t)type) << ((index % 16) * 4);
}
eDRWCommandType command_type_get(uint64_t *command_type_bits, int index)
eDRWCommandType command_type_get(const uint64_t *command_type_bits, int index)
{
return ((command_type_bits[index / 16] >> ((index % 16) * 4)) & 0xF);
}

View File

@ -91,10 +91,13 @@ static void drw_deferred_shader_queue_free(ListBase *queue)
}
}
static void drw_deferred_shader_compilation_exec(void *custom_data,
short *stop,
short *do_update,
float *progress)
static void drw_deferred_shader_compilation_exec(
void *custom_data,
/* Cannot be const, this function implements wm_jobs_start_callback.
* NOLINTNEXTLINE: readability-non-const-parameter. */
short *stop,
short *do_update,
float *progress)
{
DRWShaderCompiler *comp = (DRWShaderCompiler *)custom_data;
void *gl_context = comp->gl_context;

View File

@ -540,7 +540,7 @@ static void draw_markers_background(rctf *rect)
immUnbindProgram();
}
static bool marker_is_in_frame_range(TimeMarker *marker, int frame_range[2])
static bool marker_is_in_frame_range(TimeMarker *marker, const int frame_range[2])
{
if (marker->frame < frame_range[0]) {
return false;

View File

@ -655,7 +655,7 @@ void heat_bone_weighting(Object *ob,
bDeformGroup **dgroupflip,
float (*root)[3],
float (*tip)[3],
int *selected,
const int *selected,
const char **err_str)
{
LaplacianSystem *sys;
@ -1236,7 +1236,7 @@ static float meshdeform_boundary_phi(const MeshDeformBind *mdb,
}
static float meshdeform_interp_w(MeshDeformBind *mdb,
float *gridvec,
const float *gridvec,
float *UNUSED(vec),
int UNUSED(cagevert))
{

View File

@ -56,7 +56,7 @@ void heat_bone_weighting(struct Object *ob,
struct bDeformGroup **dgroupflip,
float (*root)[3],
float (*tip)[3],
int *selected,
const int *selected,
const char **error);
#ifdef RIGID_DEFORM

View File

@ -2245,7 +2245,7 @@ static void gpencil_copy_points(
}
static void gpencil_insert_point(
bGPDstroke *gps, bGPDspoint *a_pt, bGPDspoint *b_pt, const float co_a[3], float co_b[3])
bGPDstroke *gps, bGPDspoint *a_pt, bGPDspoint *b_pt, const float co_a[3], const float co_b[3])
{
bGPDspoint *temp_points;
int totnewpoints, oldtotpoints;
@ -2764,7 +2764,7 @@ void ED_gpencil_init_random_settings(Brush *brush,
}
static void gpencil_sbuffer_vertex_color_random(
bGPdata *gpd, Brush *brush, tGPspoint *tpt, float random_color[3], float pen_pressure)
bGPdata *gpd, Brush *brush, tGPspoint *tpt, const float random_color[3], float pen_pressure)
{
BrushGpencilSettings *brush_settings = brush->gpencil_settings;
if (brush_settings->flag & GP_BRUSH_GROUP_RANDOM) {
@ -2895,7 +2895,7 @@ void ED_gpencil_sbuffer_vertex_color_set(Depsgraph *depsgraph,
/* Check if the stroke collides with brush. */
bool ED_gpencil_stroke_check_collision(GP_SpaceConversion *gsc,
bGPDstroke *gps,
float mouse[2],
const float mouse[2],
const int radius,
const float diff_mat[4][4])
{

View File

@ -348,7 +348,7 @@ static void gpencil_grid_cell_average_color_idx_get(tGP_BrushVertexpaintData *gs
}
}
static int gpencil_grid_cell_index_get(tGP_BrushVertexpaintData *gso, int pc[2])
static int gpencil_grid_cell_index_get(tGP_BrushVertexpaintData *gso, const int pc[2])
{
float bottom[2], top[2];

View File

@ -106,7 +106,7 @@ struct FileSelectParams *ED_fileselect_get_params(struct SpaceFile *sfile);
short ED_fileselect_set_params(struct SpaceFile *sfile);
void ED_fileselect_set_params_from_userdef(struct SpaceFile *sfile);
void ED_fileselect_params_to_userdef(struct SpaceFile *sfile,
int temp_win_size[],
const int temp_win_size[],
const bool is_maximized);
void ED_fileselect_reset_params(struct SpaceFile *sfile);

View File

@ -351,7 +351,7 @@ void ED_gpencil_init_random_settings(struct Brush *brush,
bool ED_gpencil_stroke_check_collision(struct GP_SpaceConversion *gsc,
struct bGPDstroke *gps,
float mouse[2],
const float mouse[2],
const int radius,
const float diff_mat[4][4]);
bool ED_gpencil_stroke_point_is_inside(struct bGPDstroke *gps,

View File

@ -125,8 +125,8 @@ void ED_image_draw_info(struct Scene *scene,
const unsigned char cp[4],
const float fp[4],
const float linearcol[4],
int *zp,
float *zpf);
const int *zp,
const float *zpf);
bool ED_space_image_show_cache(struct SpaceImage *sima);

View File

@ -121,7 +121,7 @@ void ED_operatormacros_node(void);
bool ED_space_node_color_sample(struct Main *bmain,
struct SpaceNode *snode,
struct ARegion *region,
int mval[2],
const int mval[2],
float r_col[3]);
#ifdef __cplusplus

View File

@ -150,7 +150,7 @@ void ED_view3d_cursor3d_update(struct bContext *C,
struct Camera *ED_view3d_camera_data_get(struct View3D *v3d, struct RegionView3D *rv3d);
void ED_view3d_to_m4(float mat[4][4], const float ofs[3], const float quat[4], const float dist);
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], float *dist);
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist);
void ED_view3d_from_object(
const struct Object *ob, float ofs[3], float quat[4], float *dist, float *lens);
@ -502,7 +502,7 @@ bool ED_view3d_autodist_simple(struct ARegion *region,
const int mval[2],
float mouse_worldloc[3],
int margin,
float *force_depth);
const float *force_depth);
bool ED_view3d_autodist_depth(struct ARegion *region, const int mval[2], int margin, float *depth);
bool ED_view3d_autodist_depth_seg(struct ARegion *region,
const int mval_sta[2],

View File

@ -1506,7 +1506,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block,
short width,
short height,
short *keypoin,
short *modkeypoin,
const short *modkeypoin,
const char *tip);
uiBut *uiDefSearchBut(uiBlock *block,

View File

@ -6262,7 +6262,7 @@ uiBut *uiDefHotKeyevtButS(uiBlock *block,
short width,
short height,
short *keypoin,
short *modkeypoin,
const short *modkeypoin,
const char *tip)
{
uiBut *but = ui_def_but(block,

View File

@ -268,7 +268,7 @@ void LATTICE_OT_select_mirror(wmOperatorType *ot)
* \{ */
static bool lattice_test_bitmap_uvw(
Lattice *lt, BLI_bitmap *selpoints, int u, int v, int w, const bool selected)
Lattice *lt, const BLI_bitmap *selpoints, int u, int v, int w, const bool selected)
{
if ((u < 0 || u >= lt->pntsu) || (v < 0 || v >= lt->pntsv) || (w < 0 || w >= lt->pntsw)) {
return false;

View File

@ -439,7 +439,7 @@ static bool add_vertex_new(const bContext *C, Mask *mask, MaskLayer *mask_layer,
/* Convert coordinate from normalized space to pixel one.
* TODO(sergey): Make the function more generally available. */
static void mask_point_make_pixel_space(bContext *C,
float point_normalized[2],
const float point_normalized[2],
float point_pixel[2])
{
ScrArea *area = CTX_wm_area(C);

View File

@ -1029,7 +1029,7 @@ bool EDBM_vert_color_check(BMEditMesh *em)
/** \name Mirror Cache API
* \{ */
static BMVert *cache_mirr_intptr_as_bmvert(intptr_t *index_lookup, int index)
static BMVert *cache_mirr_intptr_as_bmvert(const intptr_t *index_lookup, int index)
{
intptr_t eve_i = index_lookup[index];
return (eve_i == -1) ? NULL : (BMVert *)eve_i;

View File

@ -875,8 +875,12 @@ static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups,
return alpha_overlay_active;
}
BLI_INLINE void draw_tri_point(
uint pos, const float sel_col[4], float pivot_col[4], float *co, float width, bool selected)
BLI_INLINE void draw_tri_point(uint pos,
const float sel_col[4],
const float pivot_col[4],
float *co,
float width,
bool selected)
{
immUniformColor4fv(selected ? sel_col : pivot_col);
@ -905,8 +909,12 @@ BLI_INLINE void draw_tri_point(
immEnd();
}
BLI_INLINE void draw_rect_point(
uint pos, const float sel_col[4], float handle_col[4], float *co, float width, bool selected)
BLI_INLINE void draw_rect_point(uint pos,
const float sel_col[4],
const float handle_col[4],
const float *co,
float width,
bool selected)
{
immUniformColor4fv(selected ? sel_col : handle_col);

View File

@ -257,7 +257,7 @@ static ushort *brush_painter_mask_ibuf_new(BrushPainter *painter, const int size
/* update rectangular section of the brush image */
static void brush_painter_mask_imbuf_update(BrushPainter *painter,
ImagePaintTile *tile,
ushort *tex_mask_old,
const ushort *tex_mask_old,
int origx,
int origy,
int w,
@ -1052,7 +1052,7 @@ static void paint_2d_lift_soften(ImagePaintState *s,
ImagePaintTile *tile,
ImBuf *ibuf,
ImBuf *ibufb,
int *pos,
const int *pos,
const short paint_tile)
{
bool sharpen = (tile->cache.invert ^ ((s->brush->flag & BRUSH_DIR_IN) != 0));
@ -1255,7 +1255,7 @@ static void paint_2d_lift_smear(ImBuf *ibuf, ImBuf *ibufb, int *pos, short paint
}
}
static ImBuf *paint_2d_lift_clone(ImBuf *ibuf, ImBuf *ibufb, int *pos)
static ImBuf *paint_2d_lift_clone(ImBuf *ibuf, ImBuf *ibufb, const int *pos)
{
/* note: allocImbuf returns zero'd memory, so regions outside image will
* have zero alpha, and hence not be blended onto the image */

View File

@ -206,7 +206,7 @@ void PAINT_OT_vertex_color_from_weight(wmOperatorType *ot)
/** \name Smooth Vertex Colors Operator
* \{ */
static void vertex_color_smooth_looptag(Mesh *me, bool *mlooptag)
static void vertex_color_smooth_looptag(Mesh *me, const bool *mlooptag)
{
const bool use_face_sel = (me->editflag & ME_EDIT_PAINT_FACE_SEL) != 0;
const MPoly *mp;

View File

@ -437,13 +437,16 @@ static void do_cloth_brush_solve_simulation_task_cb_ex(
BKE_pbvh_vertex_iter_end;
}
static void cloth_brush_build_nodes_constraints(Sculpt *sd,
Object *ob,
PBVHNode **nodes,
int totnode,
SculptClothSimulation *cloth_sim,
float initial_location[3],
const float radius)
static void cloth_brush_build_nodes_constraints(
Sculpt *sd,
Object *ob,
PBVHNode **nodes,
int totnode,
SculptClothSimulation *cloth_sim,
/* Cannot be const, because it is assigned to a non-const variable.
* NOLINTNEXTLINE: readability-non-const-parameter. */
float initial_location[3],
const float radius)
{
Brush *brush = BKE_paint_brush(&sd->paint);

View File

@ -1403,6 +1403,8 @@ static void do_sequence_proxy(void *pjv,
int build_count,
int *build_undistort_sizes,
int build_undistort_count,
/* Cannot be const, because it is assigned to a non-const variable.
* NOLINTNEXTLINE: readability-non-const-parameter. */
short *stop,
short *do_update,
float *progress)

View File

@ -214,7 +214,13 @@ static bool track_markers_initjob(bContext *C, TrackMarkersJob *tmj, bool backwa
return true;
}
static void track_markers_startjob(void *tmv, short *stop, short *do_update, float *progress)
static void track_markers_startjob(
void *tmv,
/* Cannot be const, this function implements wm_jobs_start_callback.
* NOLINTNEXTLINE: readability-non-const-parameter. */
short *stop,
short *do_update,
float *progress)
{
TrackMarkersJob *tmj = (TrackMarkersJob *)tmv;
int framenr = tmj->sfra;

View File

@ -731,7 +731,9 @@ void CLIP_OT_select_lasso(wmOperatorType *ot)
/********************** circle select operator *********************/
static int point_inside_ellipse(float point[2], float offset[2], float ellipse[2])
static int point_inside_ellipse(const float point[2],
const float offset[2],
const float ellipse[2])
{
/* normalized ellipse: ell[0] = scaleX, ell[1] = scaleY */
float x, y;

View File

@ -2809,7 +2809,7 @@ static void filelist_readjob_main_recursive(Main *bmain, FileList *filelist)
static void filelist_readjob_do(const bool do_lib,
FileList *filelist,
const char *main_name,
short *stop,
const short *stop,
short *do_update,
float *progress,
ThreadMutex *lock)

View File

@ -374,7 +374,7 @@ void ED_fileselect_set_params_from_userdef(SpaceFile *sfile)
* pass its size here so we can store that in the preferences. Otherwise NULL.
*/
void ED_fileselect_params_to_userdef(SpaceFile *sfile,
int temp_win_size[2],
const int temp_win_size[2],
const bool is_maximized)
{
UserDef_FileSpaceData *sfile_udata_new = &U.file_space_data;

View File

@ -1129,10 +1129,13 @@ int fsmenu_get_active_indices(struct FSMenu *fsmenu, enum FSMenuCategory categor
* before being defined as unreachable by the OS, we need to validate the bookmarks in an async
* job...
*/
static void fsmenu_bookmark_validate_job_startjob(void *fsmenuv,
short *stop,
short *do_update,
float *UNUSED(progress))
static void fsmenu_bookmark_validate_job_startjob(
void *fsmenuv,
/* Cannot be const, this function implements wm_jobs_start_callback.
* NOLINTNEXTLINE: readability-non-const-parameter. */
short *stop,
short *do_update,
float *UNUSED(progress))
{
FSMenu *fsmenu = fsmenuv;

View File

@ -572,8 +572,12 @@ static void image_multiview_cb(bContext *C, void *rnd_pt, void *UNUSED(arg_v))
WM_event_add_notifier(C, NC_IMAGE | ND_DRAW, NULL);
}
static void uiblock_layer_pass_buttons(
uiLayout *layout, Image *image, RenderResult *rr, ImageUser *iuser, int w, short *render_slot)
static void uiblock_layer_pass_buttons(uiLayout *layout,
Image *image,
RenderResult *rr,
ImageUser *iuser,
int w,
const short *render_slot)
{
struct ImageUI_Data rnd_pt_local, *rnd_pt = NULL;
uiBlock *block = uiLayoutGetBlock(layout);

View File

@ -150,8 +150,8 @@ void ED_image_draw_info(Scene *scene,
const uchar cp[4],
const float fp[4],
const float linearcol[4],
int *zp,
float *zpf)
const int *zp,
const float *zpf)
{
rcti color_rect;
char str[256];
@ -463,7 +463,7 @@ void ED_image_draw_info(Scene *scene,
/* image drawing */
static void sima_draw_zbuf_pixels(
float x1, float y1, int rectx, int recty, int *rect, float zoomx, float zoomy)
float x1, float y1, int rectx, int recty, const int *rect, float zoomx, float zoomy)
{
float red[4] = {1.0f, 0.0f, 0.0f, 0.0f};
@ -489,7 +489,7 @@ static void sima_draw_zbuffloat_pixels(Scene *scene,
float y1,
int rectx,
int recty,
float *rect_float,
const float *rect_float,
float zoomx,
float zoomy)
{

View File

@ -238,7 +238,12 @@ static void compo_progressjob(void *cjv, float progress)
}
/* only this runs inside thread */
static void compo_startjob(void *cjv, short *stop, short *do_update, float *progress)
static void compo_startjob(void *cjv,
/* Cannot be const, this function implements wm_jobs_start_callback.
* NOLINTNEXTLINE: readability-non-const-parameter. */
short *stop,
short *do_update,
float *progress)
{
CompoJob *cj = cjv;
bNodeTree *ntree = cj->localtree;

View File

@ -419,7 +419,7 @@ static void sample_draw(const bContext *C, ARegion *region, void *arg_info)
* And here we've got recursion in the comments tips...
*/
bool ED_space_node_color_sample(
Main *bmain, SpaceNode *snode, ARegion *region, int mval[2], float r_col[3])
Main *bmain, SpaceNode *snode, ARegion *region, const int mval[2], float r_col[3])
{
void *lock;
Image *ima;

View File

@ -50,14 +50,14 @@ static void rgb_to_yuv_normalized(const float rgb[3], float yuv[3])
yuv[2] += 0.5f;
}
static void scope_put_pixel(uchar *table, uchar *pos)
static void scope_put_pixel(const uchar *table, uchar *pos)
{
uchar newval = table[*pos];
pos[0] = pos[1] = pos[2] = newval;
pos[3] = 255;
}
static void scope_put_pixel_single(uchar *table, uchar *pos, int col)
static void scope_put_pixel_single(const uchar *table, uchar *pos, int col)
{
char newval = table[pos[col]];
pos[col] = newval;

View File

@ -1572,7 +1572,7 @@ void VIEW3D_OT_select_menu(wmOperatorType *ot)
static Base *object_mouse_select_menu(bContext *C,
ViewContext *vc,
uint *buffer,
const uint *buffer,
int hits,
const int mval[2],
bool extend,

View File

@ -1028,8 +1028,11 @@ void ED_view3d_autodist_init(Depsgraph *depsgraph, ARegion *region, View3D *v3d,
}
/* no 4x4 sampling, run #ED_view3d_autodist_init first */
bool ED_view3d_autodist_simple(
ARegion *region, const int mval[2], float mouse_worldloc[3], int margin, float *force_depth)
bool ED_view3d_autodist_simple(ARegion *region,
const int mval[2],
float mouse_worldloc[3],
int margin,
const float *force_depth)
{
float depth;
@ -1458,7 +1461,7 @@ bool ED_view3d_lock(RegionView3D *rv3d)
* \param quat: The view rotation, quaternion normally from RegionView3D.viewquat.
* \param dist: The view distance from ofs, normally from RegionView3D.dist.
*/
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], float *dist)
void ED_view3d_from_m4(const float mat[4][4], float ofs[3], float quat[4], const float *dist)
{
float nmat[3][3];

View File

@ -1106,11 +1106,13 @@ static bool raycastObjects(SnapObjectContext *sctx,
const float ray_start[3],
const float ray_dir[3],
/* read/write args */
float *ray_depth,
/* Parameters below cannot be const, because they are assigned to a
* non-const variable (readability-non-const-parameter). */
float *ray_depth /* NOLINT */,
/* return args */
float r_loc[3],
float r_no[3],
int *r_index,
float r_loc[3] /* NOLINT */,
float r_no[3] /* NOLINT */,
int *r_index /* NOLINT */,
Object **r_ob,
float r_obmat[4][4],
ListBase *r_hit_list)
@ -2789,11 +2791,13 @@ static short snapObjectsRay(SnapObjectContext *sctx,
SnapData *snapdata,
const struct SnapObjectParams *params,
/* read/write args */
float *dist_px,
/* Parameters below cannot be const, because they are assigned to a
* non-const variable (readability-non-const-parameter). */
float *dist_px /* NOLINT */,
/* return args */
float r_loc[3],
float r_no[3],
int *r_index,
float r_loc[3] /* NOLINT */,
float r_no[3] /* NOLINT */,
int *r_index /* NOLINT */,
Object **r_ob,
float r_obmat[4][4])
{

View File

@ -487,7 +487,7 @@ static void p_chart_uv_scale_xy(PChart *chart, float x, float y)
}
}
static void p_chart_uv_translate(PChart *chart, float trans[2])
static void p_chart_uv_translate(PChart *chart, const float trans[2])
{
PVert *v;
@ -805,7 +805,7 @@ static PVert *p_vert_copy(PChart *chart, PVert *v)
return nv;
}
static PEdge *p_edge_lookup(PHandle *handle, PHashKey *vkeys)
static PEdge *p_edge_lookup(PHandle *handle, const PHashKey *vkeys)
{
PHashKey key = PHASH_edge(vkeys[0], vkeys[1]);
PEdge *e = (PEdge *)phash_lookup(handle->hash_edges, key);
@ -1146,14 +1146,14 @@ static PFace *p_face_add(PHandle *handle)
static PFace *p_face_add_construct(PHandle *handle,
ParamKey key,
ParamKey *vkeys,
const ParamKey *vkeys,
float *co[4],
float *uv[4],
int i1,
int i2,
int i3,
ParamBool *pin,
ParamBool *select)
const ParamBool *pin,
const ParamBool *select)
{
PFace *f = p_face_add(handle);
PEdge *e1 = f->edge, *e2 = e1->next, *e3 = e2->next;

View File

@ -1477,7 +1477,7 @@ void UV_OT_select_all(wmOperatorType *ot)
* \{ */
static bool uv_sticky_select(
float *limit, int hitv[], int v, float *hituv[], float *uv, int sticky, int hitlen)
const float *limit, const int hitv[], int v, float *hituv[], float *uv, int sticky, int hitlen)
{
int i;

View File

@ -534,7 +534,7 @@ static void stitch_island_calculate_edge_rotation(UvEdge *edge,
StitchStateContainer *ssc,
StitchState *state,
UVVertAverage *uv_average,
uint *uvfinal_map,
const uint *uvfinal_map,
IslandStitchData *island_stitch_data)
{
BMesh *bm = state->em->bm;

Some files were not shown because too many files have changed in this diff Show More