diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-09-14 01:10:50 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-09-14 01:12:53 +0300 |
commit | 0547a7753643f45861306542857d97215ecb2c4f (patch) | |
tree | 1faad834721f7f13d4a0756bd80607963386fccd /source | |
parent | d30ec73d763ed01795100ec5d3a0ef9dc8521f7b (diff) |
Cleanup: use const args, variables
Diffstat (limited to 'source')
70 files changed, 202 insertions, 171 deletions
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 @@ static int sb_detect_face_pointCached(float face_v1[3], } static int sb_detect_face_collisionCached(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, @@ -1326,7 +1326,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], - float edge_v2[3], + const float edge_v2[3], float *damp, float force[3], struct Object *vertexowner, diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 9f45826d59e..ff92704e2d1 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -946,7 +946,7 @@ BLI_INLINE void studiolight_spherical_harmonics_eval(StudioLight *sl, /* This modify the radiance into irradiance. */ static void studiolight_spherical_harmonics_apply_band_factors(StudioLight *sl, float (*sh)[3]) { - static float sl_sh_band_factors[5] = { + static const float sl_sh_band_factors[5] = { 1.0f, 2.0f / 3.0f, 1.0f / 4.0f, @@ -1074,7 +1074,7 @@ static float wrapped_lighting(float NL, float w) static float blinn_specular(const float L[3], const float I[3], const float N[3], - float R[3], + const float R[3], float NL, float roughness, float wrap) diff --git a/source/blender/blenlib/intern/voronoi_2d.c b/source/blender/blenlib/intern/voronoi_2d.c index 29beb93159a..eb718c5e8c6 100644 --- a/source/blender/blenlib/intern/voronoi_2d.c +++ b/source/blender/blenlib/intern/voronoi_2d.c @@ -581,7 +581,7 @@ static void voronoi_clampEdges(ListBase *edges, int width, int height, ListBase } static int voronoi_getNextSideCoord( - ListBase *edges, float coord[2], int dim, int dir, float next_coord[2]) + ListBase *edges, const float coord[2], int dim, int dir, float next_coord[2]) { VoronoiEdge *edge = edges->first; float distance = FLT_MAX; diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 48d6bcd7b03..27c03f0a84f 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -330,9 +330,9 @@ static bool quad_co(const float v1[3], } static void mdisp_axis_from_quad(float v1[3], - float v2[3], + const float v2[3], float UNUSED(v3[3]), - float v4[3], + const float v4[3], float r_axis_x[3], float r_axis_y[3]) { diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c index 83ac7df058a..374c912e3f5 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c @@ -94,7 +94,7 @@ static BMLoop *bm_edge_flagged_radial_first(BMEdge *e) } static void normalize_v2_m3_v3v3(float out[2], - float axis_mat[3][3], + const float axis_mat[3][3], const float v1[3], const float v2[3]) { @@ -110,7 +110,7 @@ static void normalize_v2_m3_v3v3(float out[2], */ static bool bm_face_split_edgenet_find_loop_pair(BMVert *v_init, const float face_normal[3], - float face_normal_matrix[3][3], + const float face_normal_matrix[3][3], BMEdge *e_pair[2]) { /* Always find one boundary edge (to determine winding) @@ -420,7 +420,7 @@ finally: static bool bm_face_split_edgenet_find_loop(BMVert *v_init, const float face_normal[3], - float face_normal_matrix[3][3], + const float face_normal_matrix[3][3], /* cache to avoid realloc every time */ struct VertOrder *edge_order, const uint edge_order_len, diff --git a/source/blender/bmesh/tools/bmesh_intersect_edges.c b/source/blender/bmesh/tools/bmesh_intersect_edges.c index 04c6968bfa0..6422904c83c 100644 --- a/source/blender/bmesh/tools/bmesh_intersect_edges.c +++ b/source/blender/bmesh/tools/bmesh_intersect_edges.c @@ -277,8 +277,8 @@ static void bm_edge_pair_elem_setup(BMEdge *e, static bool bm_vertxedge_isect_impl_ex(BMVert *v, BMEdge *e, int edge_index, - float co[3], - float dir[3], + const float co[3], + const float dir[3], float lambda, float data_dist_sq, int *data_cut_edges_len, @@ -411,10 +411,10 @@ static void bm_edgexedge_isect_impl(struct EDBMSplitData *data, int index_b, BMEdge *e_a, BMEdge *e_b, - float co_a[3], - float dir_a[3], - float co_b[3], - float dir_b[3], + const float co_a[3], + const float dir_a[3], + const float co_b[3], + const float dir_b[3], float lambda_a, float lambda_b) { diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index 541a9e31586..8006c784190 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -80,7 +80,7 @@ static void gpencil_set_buffer_stroke_point(GPUVertBuf *vbo, uint thickness_id, uint uvdata_id, uint prev_pos_id, - float ref_pt[3], + const float ref_pt[3], short thickness, const float ink[4]) { @@ -110,7 +110,7 @@ static void gpencil_set_fill_point(GPUVertBuf *vbo, int idx, bGPDspoint *pt, const float fcolor[4], - float uv[2], + const float uv[2], uint pos_id, uint color_id, uint text_id) @@ -886,7 +886,7 @@ void gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, static void set_grid_point(GPUVertBuf *vbo, int idx, - float col_grid[4], + const float col_grid[4], uint pos_id, uint color_id, float v1, diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 882f2285296..fbaf35890f1 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -276,8 +276,11 @@ static void gpencil_calc_2d_bounding_box(const float (*points2d)[2], } /* calc texture coordinates using flat projected points */ -static void gpencil_calc_stroke_fill_uv( - const float (*points2d)[2], int totpoints, float minv[2], float maxv[2], float (*r_uv)[2]) +static void gpencil_calc_stroke_fill_uv(const float (*points2d)[2], + int totpoints, + const float minv[2], + float maxv[2], + float (*r_uv)[2]) { float d[2]; d[0] = maxv[0] - minv[0]; @@ -419,7 +422,7 @@ static DRWShadingGroup *gpencil_shgroup_fill_create(GPENCIL_Data *vedata, bGPDlayer *gpl, MaterialGPencilStyle *gp_style, int id, - int shading_type[2]) + const int shading_type[2]) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const DRWContextState *draw_ctx = DRW_context_state_get(); diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index 7ee86bcc392..d0deb48c019 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -131,7 +131,7 @@ static void GPENCIL_render_cache(void *vedata, /* TODO: Reuse Eevee code in shared module instead to duplicate here */ static void GPENCIL_render_update_viewvecs(float invproj[4][4], - float winmat[4][4], + const float winmat[4][4], float (*r_viewvecs)[4]) { /* view vectors for the corners of the view frustum. diff --git a/source/blender/draw/engines/workbench/workbench_studiolight.c b/source/blender/draw/engines/workbench/workbench_studiolight.c index fed6ca680a7..ac27ff0b736 100644 --- a/source/blender/draw/engines/workbench/workbench_studiolight.c +++ b/source/blender/draw/engines/workbench/workbench_studiolight.c @@ -284,7 +284,7 @@ bool studiolight_camera_in_object_shadow(WORKBENCH_PrivateData *wpd, } /* Test projected near rectangle sides */ - float pts[4][2] = { + const float pts[4][2] = { {oed->shadow_min[0], oed->shadow_min[1]}, {oed->shadow_min[0], oed->shadow_max[1]}, {oed->shadow_max[0], oed->shadow_min[1]}, diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c index 54c78fd583b..06ed661ad8e 100644 --- a/source/blender/draw/intern/draw_cache.c +++ b/source/blender/draw/intern/draw_cache.c @@ -592,7 +592,7 @@ GPUBatch *DRW_cache_circle_get(void) GPUBatch *DRW_cache_square_get(void) { if (!SHC.drw_square) { - float p[4][3] = { + const float p[4][3] = { {1.0f, 0.0f, 1.0f}, {1.0f, 0.0f, -1.0f}, {-1.0f, 0.0f, -1.0f}, {-1.0f, 0.0f, 1.0f}}; /* Position Only 3D format */ @@ -1801,7 +1801,7 @@ GPUBatch *DRW_cache_light_spot_volume_get(void) GPUBatch *DRW_cache_light_spot_square_get(void) { if (!SHC.drw_light_spot_square) { - float p[5][3] = { + const float p[5][3] = { {0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, -1.0f}, {1.0f, -1.0f, -1.0f}, @@ -1840,7 +1840,7 @@ GPUBatch *DRW_cache_light_spot_square_get(void) GPUBatch *DRW_cache_light_spot_square_volume_get(void) { if (!SHC.drw_light_spot_square_volume) { - float p[5][3] = { + const float p[5][3] = { {0.0f, 0.0f, 0.0f}, {1.0f, 1.0f, -1.0f}, {1.0f, -1.0f, -1.0f}, @@ -1952,7 +1952,7 @@ GPUBatch *DRW_cache_lightprobe_cube_get(void) int v_idx = 0; const float sin_pi_3 = 0.86602540378f; const float cos_pi_3 = 0.5f; - float v[7][3] = { + const float v[7][3] = { {0.0f, 1.0f, 0.0f}, {sin_pi_3, cos_pi_3, 0.0f}, {sin_pi_3, -cos_pi_3, 0.0f}, @@ -2057,7 +2057,7 @@ GPUBatch *DRW_cache_lightprobe_planar_get(void) if (!SHC.drw_lightprobe_planar) { int v_idx = 0; const float sin_pi_3 = 0.86602540378f; - float v[4][3] = { + const float v[4][3] = { {0.0f, 0.5f, 0.0f}, {sin_pi_3, 0.0f, 0.0f}, {0.0f, -0.5f, 0.0f}, diff --git a/source/blender/draw/intern/draw_cache_impl_curve.c b/source/blender/draw/intern/draw_cache_impl_curve.c index c0cbe3266cb..ab800e42cc0 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.c +++ b/source/blender/draw/intern/draw_cache_impl_curve.c @@ -772,7 +772,7 @@ static void curve_create_edit_data_and_handles(CurveRenderData *rdata, GPU_indexbuf_add_line_verts(elbp_lines, vbo_len_used + 1, vbo_len_used + 2); } if (vbo_data) { - char vflag[3] = { + const char vflag[3] = { beztriple_vflag_get(rdata, bezt->f1, bezt->h1, a, nu_id), beztriple_vflag_get(rdata, bezt->f2, bezt->h1, a, nu_id), beztriple_vflag_get(rdata, bezt->f3, bezt->h2, a, nu_id), diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index 2b87e04b6b4..ba5ecb143ae 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -2154,7 +2154,7 @@ static void camera_view3d_stereoscopy_display_extra(OBJECT_ShadingGroupList *sgl static float one = 1.0f; float plane_mat[4][4], scale_mat[4][4]; float scale_factor[3] = {1.0f, 1.0f, 1.0f}; - float color_plane[2][4] = { + const float color_plane[2][4] = { {0.0f, 0.0f, 0.0f, v3d->stereo3d_convergence_alpha}, {0.0f, 0.0f, 0.0f, 1.0f}, }; @@ -2180,7 +2180,7 @@ static void camera_view3d_stereoscopy_display_extra(OBJECT_ShadingGroupList *sgl /* Draw convergence volume. */ if (is_stereo3d_volume && !is_select) { static float one = 1.0f; - float color_volume[3][4] = { + const float color_volume[3][4] = { {0.0f, 1.0f, 1.0f, v3d->stereo3d_volume_alpha}, {1.0f, 0.0f, 0.0f, v3d->stereo3d_volume_alpha}, {0.0f, 0.0f, 0.0f, 1.0f}, @@ -2306,7 +2306,7 @@ static void camera_view3d_reconstruction(OBJECT_ShadingGroupList *sgl, DRW_shgroup_empty_ex(sgl, bundle_mat, &v3d->bundle_size, v3d->bundle_drawtype, color); } - float bundle_color_v4[4] = { + const float bundle_color_v4[4] = { bundle_color[0], bundle_color[1], bundle_color[2], diff --git a/source/blender/editors/gizmo_library/gizmo_library_presets.c b/source/blender/editors/gizmo_library/gizmo_library_presets.c index 59c5b758e1b..fe0893ae3ff 100644 --- a/source/blender/editors/gizmo_library/gizmo_library_presets.c +++ b/source/blender/editors/gizmo_library/gizmo_library_presets.c @@ -54,7 +54,7 @@ * Given a single axis, orient the matrix to a different direction. */ static void single_axis_convert(int src_axis, - float src_mat[4][4], + const float src_mat[4][4], int dst_axis, float dst_mat[4][4]) { @@ -73,7 +73,7 @@ static void single_axis_convert(int src_axis, * Use for all geometry. */ static void ed_gizmo_draw_preset_geometry(const struct wmGizmo *gz, - float mat[4][4], + const float mat[4][4], int select_id, const GizmoGeomInfo *info) { diff --git a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c index 6d8ab096a26..d3121711e28 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/dial3d_gizmo.c @@ -273,7 +273,7 @@ static void dial_ghostarc_draw(const float angle_ofs, static void dial_ghostarc_get_angles(const wmGizmo *gz, const wmEvent *event, const ARegion *ar, - float mat[4][4], + const float mat[4][4], const float co_outer[3], float *r_start, float *r_delta) diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index 683ee7fb973..67bf64a2903 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -95,7 +95,7 @@ static void annotation_draw_stroke_buffer(const tGPspoint *points, short thickness, short dflag, short sflag, - float ink[4]) + const float ink[4]) { int draw_points = 0; diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 4015fa12438..80795b825b0 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -267,8 +267,11 @@ static void gp_calc_2d_bounding_box( } /* calc texture coordinates using flat projected points */ -static void gp_calc_stroke_text_coordinates( - const float (*points2d)[2], int totpoints, float minv[2], float maxv[2], float (*r_uv)[2]) +static void gp_calc_stroke_text_coordinates(const float (*points2d)[2], + int totpoints, + const float minv[2], + float maxv[2], + float (*r_uv)[2]) { float d[2]; d[0] = maxv[0] - minv[0]; diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 89cb85b0e17..2a2e7c21df4 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -565,7 +565,7 @@ static void gp_brush_grab_calc_dvec(tGP_BrushEditData *gso) /* Apply grab transform to all relevant points of the affected strokes */ static void gp_brush_grab_apply_cached(tGP_BrushEditData *gso, bGPDstroke *gps, - float diff_mat[4][4]) + const float diff_mat[4][4]) { tGPSB_Grab_StrokeData *data = BLI_ghash_lookup(gso->stroke_customdata, gps); int i; @@ -1555,7 +1555,7 @@ static float gpsculpt_rotation_eval_get(GP_SpaceConversion *gsc, /* Apply brush operation to points in this stroke */ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso, bGPDstroke *gps, - float diff_mat[4][4], + const float diff_mat[4][4], GP_BrushApplyCb apply) { GP_SpaceConversion *gsc = &gso->gsc; @@ -1680,8 +1680,11 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso, } /* Apply sculpt brushes to strokes in the given frame */ -static bool gpsculpt_brush_do_frame( - bContext *C, tGP_BrushEditData *gso, bGPDlayer *gpl, bGPDframe *gpf, float diff_mat[4][4]) +static bool gpsculpt_brush_do_frame(bContext *C, + tGP_BrushEditData *gso, + bGPDlayer *gpl, + bGPDframe *gpf, + const float diff_mat[4][4]) { bool changed = false; Object *ob = CTX_data_active_object(C); diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 1834261e1bf..96302bcbe63 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -3021,7 +3021,7 @@ static void gpencil_flip_stroke(bGPDstroke *gps) static void gpencil_stroke_copy_point(bGPDstroke *gps, bGPDspoint *point, int idx, - float delta[3], + const float delta[3], float pressure, float strength, float deltatime) diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index f4484624d5a..b7b73c1b501 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -840,7 +840,7 @@ static bool gp_stroke_do_circle_sel(bGPDlayer *gpl, const int radius, const bool select, rcti *rect, - float diff_mat[4][4], + const float diff_mat[4][4], const int selectmode, const float scale) { diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 3ee7aed0a02..89a2a987f60 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1952,7 +1952,7 @@ void ED_gpencil_setup_modes(bContext *C, bGPdata *gpd, int newmode) /* helper to convert 2d to 3d for simple drawing buffer */ static void gpencil_stroke_convertcoords(ARegion *ar, const tGPspoint *point2D, - float origin[3], + const float origin[3], float out[3]) { float mval_f[2] = {(float)point2D->x, (float)point2D->y}; @@ -2084,8 +2084,8 @@ static bool gpencil_check_collision(bGPDstroke *gps, bGPDstroke **gps_array, GHash *all_2d, int totstrokes, - float p2d_a1[2], - float p2d_a2[2], + const float p2d_a1[2], + const float p2d_a2[2], float r_hit[2]) { bool hit = false; @@ -2164,7 +2164,7 @@ static void gp_copy_points(bGPDstroke *gps, bGPDspoint *pt, bGPDspoint *pt_final } static void gp_insert_point( - bGPDstroke *gps, bGPDspoint *a_pt, bGPDspoint *b_pt, float co_a[3], float co_b[3]) + bGPDstroke *gps, bGPDspoint *a_pt, bGPDspoint *b_pt, const float co_a[3], float co_b[3]) { bGPDspoint *temp_points; int totnewpoints, oldtotpoints; diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 104b41491c2..b844e237366 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -777,7 +777,7 @@ static ImBuf *create_mono_icon_with_border(ImBuf *buf, const int blurred_alpha_offset = by * (ICON_GRID_W + 2 * ICON_MONO_BORDER_OUTSET) + bx; const int offset_write = (sy + by) * buf->x + (sx + bx); const float blurred_alpha = blurred_alpha_buffer[blurred_alpha_offset]; - float border_srgb[4] = { + const float border_srgb[4] = { 0, 0, 0, MIN2(1.0, blurred_alpha * border_sharpness) * border_intensity}; const unsigned int color_read = buf->rect[offset_write]; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index a0bb4de96ea..0ee2ed0f338 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1311,7 +1311,7 @@ static struct { void UI_widgetbase_draw_cache_flush(void) { - float checker_params[3] = { + const float checker_params[3] = { UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, 8.0f}; if (g_widget_base_batch.count == 0) { @@ -1394,7 +1394,7 @@ static void draw_widgetbase_batch(GPUBatch *batch, uiWidgetBase *wtb) } } else { - float checker_params[3] = { + const float checker_params[3] = { UI_ALPHA_CHECKER_DARK / 255.0f, UI_ALPHA_CHECKER_LIGHT / 255.0f, 8.0f}; /* draw single */ GPU_batch_program_set_builtin(batch, GPU_SHADER_2D_WIDGET_BASE); @@ -3337,7 +3337,7 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect) static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol) { int y = rect->ymin + BLI_rcti_size_y(rect) / 2 - 1; - uchar col[4] = { + const uchar col[4] = { wcol->text[0], wcol->text[1], wcol->text[2], diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c index f6729fb56e1..66832ceba7f 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.c +++ b/source/blender/editors/mesh/editmesh_add_gizmo.c @@ -78,7 +78,7 @@ static void calc_initial_placement_point_from_view(bContext *C, float orient_matrix[3][3]; BKE_scene_cursor_to_mat4(&scene->cursor, cursor_matrix); - float dots[3] = { + const float dots[3] = { dot_v3v3(rv3d->viewinv[2], cursor_matrix[0]), dot_v3v3(rv3d->viewinv[2], cursor_matrix[1]), dot_v3v3(rv3d->viewinv[2], cursor_matrix[2]), diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 8d9d0e40f44..c68f5963cbd 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -81,7 +81,7 @@ static void join_mesh_single(Depsgraph *depsgraph, Scene *scene, Object *ob_dst, Object *ob_src, - float imat[4][4], + const float imat[4][4], MVert **mvert_pp, MEdge **medge_pp, MLoop **mloop_pp, diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 9b5342fc797..1cd16b1b0bf 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1679,7 +1679,7 @@ static void object_apply_location(Object *ob, const float loc[3]) } static void object_orient_to_location(Object *ob, - float rot_orig[3][3], + const float rot_orig[3][3], const float axis[3], const float location[3]) { diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index ce385b12608..d703cdfecb3 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1319,8 +1319,8 @@ static void moveCloserToDistanceFromPlane(Depsgraph *depsgraph, Object *ob, Mesh *me, int index, - float norm[3], - float coord[3], + const float norm[3], + const float coord[3], float d, float distToBe, float strength, diff --git a/source/blender/editors/object/object_warp.c b/source/blender/editors/object/object_warp.c index 3a089acb330..836e38e3676 100644 --- a/source/blender/editors/object/object_warp.c +++ b/source/blender/editors/object/object_warp.c @@ -43,7 +43,7 @@ static void object_warp_calc_view_matrix(float r_mat_view[4][4], float r_center_view[3], Object *obedit, - float viewmat[4][4], + const float viewmat[4][4], const float center[3], const float offset_angle) { @@ -62,7 +62,7 @@ static void object_warp_calc_view_matrix(float r_mat_view[4][4], } static void object_warp_transverts_minmax_x(TransVertStore *tvs, - float mat_view[4][4], + const float mat_view[4][4], const float center_view[3], float *r_min, float *r_max) @@ -90,7 +90,7 @@ static void object_warp_transverts_minmax_x(TransVertStore *tvs, } static void object_warp_transverts(TransVertStore *tvs, - float mat_view[4][4], + const float mat_view[4][4], const float center_view[3], const float angle_, const float min, diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 7a781999dfc..2047ecb9e0a 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -649,8 +649,8 @@ typedef void (*ForHitPointFunc)(PEData *data, int point_index, float mouse_dista typedef void (*ForKeyFunc)(PEData *data, int point_index, int key_index, bool is_inside); typedef void (*ForKeyMatFunc)(PEData *data, - float mat[4][4], - float imat[4][4], + const float mat[4][4], + const float imat[4][4], int point_index, int key_index, PTCacheEditKey *key); diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 12eb433a3dd..5a2009845f8 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -704,8 +704,8 @@ static bool remap_hair_emitter(Depsgraph *depsgraph, Object *target_ob, ParticleSystem *target_psys, PTCacheEdit *target_edit, - float from_mat[4][4], - float to_mat[4][4], + const float from_mat[4][4], + const float to_mat[4][4], bool from_global, bool to_global) { diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 2ad512851b1..cb87b076d79 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -812,7 +812,7 @@ static void area_azone_initialize(wmWindow *win, const bScreen *screen, ScrArea return; } - float coords[4][4] = { + const float coords[4][4] = { /* Bottom-left. */ {sa->totrct.xmin - U.pixelsize, sa->totrct.ymin - U.pixelsize, @@ -2434,7 +2434,7 @@ void ED_region_panels_layout_ex(const bContext *C, * instead they calculate offsets for the next panel to start drawing. */ Panel *panel = ar->panels.last; if (panel != NULL) { - int size_dyn[2] = { + const int size_dyn[2] = { UI_UNIT_X * ((panel->flag & PNL_CLOSED) ? 8 : 14) / UI_DPI_FAC, UI_panel_size_y(panel) / UI_DPI_FAC, }; diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index 9464bdb901e..5c83bdf0012 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -869,15 +869,19 @@ static bool paint_draw_alpha_overlay(UnifiedPaintSettings *ups, return alpha_overlay_active; } -BLI_INLINE void draw_tri_point( - unsigned int pos, float sel_col[4], float pivot_col[4], float *co, float width, bool selected) +BLI_INLINE void draw_tri_point(unsigned int pos, + const float sel_col[4], + float pivot_col[4], + float *co, + float width, + bool selected) { immUniformColor4fv(selected ? sel_col : pivot_col); GPU_line_width(3.0f); float w = width / 2.0f; - float tri[3][2] = { + const float tri[3][2] = { {co[0], co[1] + w}, {co[0] - w, co[1] - w}, {co[0] + w, co[1] - w}, @@ -899,8 +903,12 @@ BLI_INLINE void draw_tri_point( immEnd(); } -BLI_INLINE void draw_rect_point( - unsigned int pos, float sel_col[4], float handle_col[4], float *co, float width, bool selected) +BLI_INLINE void draw_rect_point(unsigned int pos, + const float sel_col[4], + float handle_col[4], + float *co, + float width, + bool selected) { immUniformColor4fv(selected ? sel_col : handle_col); @@ -1087,8 +1095,8 @@ static bool ommit_cursor_drawing(Paint *paint, ePaintMode mode, Brush *brush) static void cursor_draw_point_screen_space(const uint gpuattr, const ARegion *ar, - float true_location[3], - float obmat[4][4]) + const float true_location[3], + const float obmat[4][4]) { float translation_vertex_cursor[3], location[3]; copy_v3_v3(location, true_location); @@ -1100,7 +1108,7 @@ static void cursor_draw_point_screen_space(const uint gpuattr, static void cursor_draw_tiling_preview(const uint gpuattr, const ARegion *ar, - float true_location[3], + const float true_location[3], Sculpt *sd, Object *ob, float radius) diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 397b2981ace..04a54ad5137 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -5212,8 +5212,10 @@ static void do_projectpaint_thread(TaskPool *__restrict UNUSED(pool), float line_len_sq_inv, line_len; float f; float color_f[4]; - float p[2] = {projPixel->projCoSS[0] - lastpos[0], - projPixel->projCoSS[1] - lastpos[1]}; + const float p[2] = { + projPixel->projCoSS[0] - lastpos[0], + projPixel->projCoSS[1] - lastpos[1], + }; sub_v2_v2v2(tangent, pos, lastpos); line_len = len_squared_v2(tangent); diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 6919536043f..6459325e6ee 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -251,7 +251,7 @@ static void imapaint_project(float matrix[4][4], const float co[3], float pco[4] } static void imapaint_tri_weights(float matrix[4][4], - GLint view[4], + const GLint view[4], const float v1[3], const float v2[3], const float v3[3], diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fd45d1a17bc..351e4c0482b 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -444,7 +444,7 @@ static bool is_symmetry_iteration_valid(char i, char symm) /* Checks if a vertex is inside the brush radius from any of its mirrored axis */ static bool sculpt_is_vertex_inside_brush_radius_symm(float vertex[3], - float br_co[3], + const float br_co[3], float radius, char symm) { @@ -3594,7 +3594,7 @@ static void pose_brush_init_task_cb_ex(void *__restrict userdata, } static bool sculpt_pose_brush_is_vertex_inside_brush_radius(float vertex[3], - float br_co[3], + const float br_co[3], float radius, char symm) { diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c index 251dddf6d78..de03fea7bb1 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -147,7 +147,7 @@ typedef struct Temp_UvData { static void HC_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, - float mouse_coord[2], + const float mouse_coord[2], float alpha, float radius, float aspectRatio) @@ -235,7 +235,7 @@ static void HC_relaxation_iteration_uv(BMEditMesh *em, static void laplacian_relaxation_iteration_uv(BMEditMesh *em, UvSculptData *sculptdata, - float mouse_coord[2], + const float mouse_coord[2], float alpha, float radius, float aspectRatio) diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c index e3fa8edd714..e96dc91cedb 100644 --- a/source/blender/editors/space_clip/clip_draw.c +++ b/source/blender/editors/space_clip/clip_draw.c @@ -887,7 +887,7 @@ static float get_shortest_pattern_side(MovieTrackingMarker *marker) } static void draw_marker_slide_square( - float x, float y, float dx, float dy, int outline, float px[2], unsigned int pos) + float x, float y, float dx, float dy, int outline, const float px[2], unsigned int pos) { float tdx, tdy; @@ -903,7 +903,7 @@ static void draw_marker_slide_square( } static void draw_marker_slide_triangle( - float x, float y, float dx, float dy, int outline, float px[2], unsigned int pos) + float x, float y, float dx, float dy, int outline, const float px[2], unsigned int pos) { float tdx, tdy; diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c index bc1026180a3..da534cf9b40 100644 --- a/source/blender/editors/space_clip/clip_ops.c +++ b/source/blender/editors/space_clip/clip_ops.c @@ -1131,7 +1131,7 @@ static void proxy_freejob(void *pjv) static int proxy_bitflag_to_array(int size_flag, int build_sizes[4], int undistort) { int build_count = 0; - int size_flags[2][4] = { + const int size_flags[2][4] = { {MCLIP_PROXY_SIZE_25, MCLIP_PROXY_SIZE_50, MCLIP_PROXY_SIZE_75, MCLIP_PROXY_SIZE_100}, {MCLIP_PROXY_UNDISTORTED_SIZE_25, MCLIP_PROXY_UNDISTORTED_SIZE_50, diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 1375b99bdaa..68198acfe52 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -448,8 +448,8 @@ static float mouse_to_slide_zone_distance_squared(const float co[2], int width, int height) { - float pixel_co[2] = {co[0] * width, co[1] * height}, - pixel_slide_zone[2] = {slide_zone[0] * width, slide_zone[1] * height}; + const float pixel_co[2] = {co[0] * width, co[1] * height}, + pixel_slide_zone[2] = {slide_zone[0] * width, slide_zone[1] * height}; return SQUARE(pixel_co[0] - pixel_slide_zone[0]) + SQUARE(pixel_co[1] - pixel_slide_zone[1]); } diff --git a/source/blender/editors/space_clip/tracking_ops_plane.c b/source/blender/editors/space_clip/tracking_ops_plane.c index b1bf88634bc..7d2324d3f48 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.c +++ b/source/blender/editors/space_clip/tracking_ops_plane.c @@ -115,8 +115,8 @@ static float mouse_to_plane_slide_zone_distance_squared(const float co[2], int width, int height) { - float pixel_co[2] = {co[0] * width, co[1] * height}, - pixel_slide_zone[2] = {slide_zone[0] * width, slide_zone[1] * height}; + const float pixel_co[2] = {co[0] * width, co[1] * height}, + pixel_slide_zone[2] = {slide_zone[0] * width, slide_zone[1] * height}; return SQUARE(pixel_co[0] - pixel_slide_zone[0]) + SQUARE(pixel_co[1] - pixel_slide_zone[1]); } diff --git a/source/blender/editors/space_clip/tracking_select.c b/source/blender/editors/space_clip/tracking_select.c index 4532b61f291..f6063b49005 100644 --- a/source/blender/editors/space_clip/tracking_select.c +++ b/source/blender/editors/space_clip/tracking_select.c @@ -57,7 +57,7 @@ static float dist_to_crns(float co[2], float pos[2], float crns[4][2]); /********************** mouse select operator *********************/ static int mouse_on_side( - float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy) + const float co[2], float x1, float y1, float x2, float y2, float epsx, float epsy) { if (x1 > x2) { SWAP(float, x1, x2); @@ -71,7 +71,7 @@ static int mouse_on_side( } static int mouse_on_rect( - float co[2], float pos[2], float min[2], float max[2], float epsx, float epsy) + const float co[2], float pos[2], float min[2], float max[2], float epsx, float epsy) { return mouse_on_side( co, pos[0] + min[0], pos[1] + min[1], pos[0] + max[0], pos[1] + min[1], epsx, epsy) || diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index faf613482a3..bc18a6cfb56 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -1082,7 +1082,7 @@ typedef struct SetConsoleCursor { // TODO, cursor placement without selection static void console_cursor_set_to_pos( - SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, int mval[2], int UNUSED(sel)) + SpaceConsole *sc, ARegion *ar, SetConsoleCursor *scu, const int mval[2], int UNUSED(sel)) { int pos; pos = console_char_pick(sc, ar, mval); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index ec7d1fc85f1..53a5609d437 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -213,7 +213,7 @@ static void WIDGETGROUP_navigate_setup(const bContext *C, wmGizmoGroup *gzgroup) { wmGizmo *gz = navgroup->gz_array[GZ_INDEX_ROTATE]; gz->scale_basis = GIZMO_SIZE / 2; - char mapping[6] = { + const char mapping[6] = { RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_FRONT, diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c index 539b5d93bdf..b5b924c7f4a 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c @@ -479,7 +479,7 @@ static int gizmo_axis_test_select(bContext *UNUSED(C), wmGizmo *gz, const int mv float i_best_len_sq = FLT_MAX; for (int i = 0; i < 3; i++) { for (int is_pos = 0; is_pos < 2; is_pos++) { - float co[2] = { + const float co[2] = { gz->matrix_offset[i][0] * (is_pos ? 1 : -1), gz->matrix_offset[i][1] * (is_pos ? 1 : -1), }; diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index b81b7e0109e..56c8b4bcbe9 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -116,7 +116,7 @@ eV3DProjStatus ED_view3d_project_base(const struct ARegion *ar, struct Base *bas * - 'rv3d->persmatob', is_local == true */ static eV3DProjStatus ed_view3d_project__internal(const ARegion *ar, - float perspmat[4][4], + const float perspmat[4][4], const bool is_local, /* normally hidden */ const float co[3], float r_co[2], diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 8839abe70a2..a95c7cf7456 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1794,7 +1794,7 @@ static void drawHelpline(bContext *UNUSED(C), int x, int y, void *customdata) if (t->helpline != HLP_NONE) { float cent[2]; - float mval[3] = { + const float mval[3] = { x, y, 0.0f, @@ -4322,8 +4322,11 @@ static void headerRotation(TransInfo *t, char str[UI_MAX_DRAW_STR], float final) * * Protected axis and other transform settings are taken into account. */ -static void ElementRotation_ex( - TransInfo *t, TransDataContainer *tc, TransData *td, float mat[3][3], const float *center) +static void ElementRotation_ex(TransInfo *t, + TransDataContainer *tc, + TransData *td, + const float mat[3][3], + const float *center) { float vec[3], totmat[3][3], smat[3][3]; float eul[3], fmat[3][3], quat[4]; @@ -4727,7 +4730,7 @@ static void initTrackball(TransInfo *t) static void applyTrackballValue(TransInfo *t, const float axis1[3], const float axis2[3], - float angles[2]) + const float angles[2]) { float mat[3][3]; float axis[3]; diff --git a/source/blender/editors/transform/transform_convert_graph.c b/source/blender/editors/transform/transform_convert_graph.c index c3afbb9b7ba..3eb4d220cb0 100644 --- a/source/blender/editors/transform/transform_convert_graph.c +++ b/source/blender/editors/transform/transform_convert_graph.c @@ -63,8 +63,8 @@ static void bezt_to_transdata(TransData *td, bool selected, bool ishandle, bool intvals, - float mtx[3][3], - float smtx[3][3], + const float mtx[3][3], + const float smtx[3][3], float unit_scale, float offset) { diff --git a/source/blender/editors/transform/transform_convert_mask.c b/source/blender/editors/transform/transform_convert_mask.c index 9e892f395b3..32152442acf 100644 --- a/source/blender/editors/transform/transform_convert_mask.c +++ b/source/blender/editors/transform/transform_convert_mask.c @@ -62,8 +62,8 @@ static void MaskHandleToTransData(MaskSplinePoint *point, TransData2D *td2d, TransDataMasking *tdm, const float asp[2], - /*const*/ float parent_matrix[3][3], - /*const*/ float parent_inverse_matrix[3][3]) + /*const*/ const float parent_matrix[3][3], + /*const*/ const float parent_inverse_matrix[3][3]) { BezTriple *bezt = &point->bezt; const bool is_sel_any = MASKPOINT_ISSEL_ANY(point); diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index acbe2c5f06a..9c46094ee83 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -75,7 +75,7 @@ static bool bmesh_test_dist_add(BMVert *v, /* optionally track original index */ int *index, const int *index_prev, - float mtx[3][3]) + const float mtx[3][3]) { if ((BM_elem_flag_test(v_other, BM_ELEM_SELECT) == 0) && (BM_elem_flag_test(v_other, BM_ELEM_HIDDEN) == 0)) { @@ -105,7 +105,7 @@ static bool bmesh_test_dist_add(BMVert *v, * \param index: Optionally store the original index we're measuring the distance to (can be NULL). */ static void editmesh_set_connectivity_distance(BMesh *bm, - float mtx[3][3], + const float mtx[3][3], float *dists, int *index) { diff --git a/source/blender/editors/transform/transform_convert_tracking.c b/source/blender/editors/transform/transform_convert_tracking.c index d7275f1fbf9..b68b79adbd8 100644 --- a/source/blender/editors/transform/transform_convert_tracking.c +++ b/source/blender/editors/transform/transform_convert_tracking.c @@ -76,7 +76,7 @@ static void markerToTransDataInit(TransData *td, MovieTrackingMarker *marker, int area, float loc[2], - float rel[2], + const float rel[2], const float off[2], const float aspect[2]) { diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index 76797339cea..9c2642a46c1 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -354,7 +354,7 @@ static bool raycastMesh(SnapObjectContext *sctx, const float ray_dir[3], Object *ob, Mesh *me, - float obmat[4][4], + const float obmat[4][4], const unsigned int ob_index, bool use_hide, /* read/write args */ @@ -527,7 +527,7 @@ static bool raycastEditMesh(SnapObjectContext *sctx, const float ray_dir[3], Object *ob, BMEditMesh *em, - float obmat[4][4], + const float obmat[4][4], const unsigned int ob_index, /* read/write args */ float *ray_depth, @@ -710,7 +710,7 @@ static bool raycastObj(SnapObjectContext *sctx, const float ray_start[3], const float ray_dir[3], Object *ob, - float obmat[4][4], + const float obmat[4][4], const unsigned int ob_index, bool use_obedit, bool use_occlusion_test, @@ -923,10 +923,10 @@ static bool raycastObjects(SnapObjectContext *sctx, /* Test BoundBox */ static bool snap_bound_box_check_dist(float min[3], - float max[3], - float lpmat[4][4], - float win_size[2], - float mval[2], + const float max[3], + const float lpmat[4][4], + const float win_size[2], + const float mval[2], float dist_px_sq) { /* In vertex and edges you need to get the pixel distance from ray to BoundBox, @@ -1220,7 +1220,7 @@ static void cb_snap_tri_verts(void *userdata, static short snap_mesh_polygon(SnapObjectContext *sctx, SnapData *snapdata, Object *ob, - float obmat[4][4], + const float obmat[4][4], /* read/write args */ float *dist_px, /* return args */ @@ -1362,7 +1362,7 @@ static short snap_mesh_polygon(SnapObjectContext *sctx, static short snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, SnapData *snapdata, Object *ob, - float obmat[4][4], + const float obmat[4][4], float original_dist_px, const float prev_co[3], /* read/write args */ @@ -1542,7 +1542,7 @@ static short snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, static short snapArmature(SnapData *snapdata, Object *ob, - float obmat[4][4], + const float obmat[4][4], bool use_obedit, /* read/write args */ float *dist_px, @@ -1687,7 +1687,7 @@ static short snapArmature(SnapData *snapdata, static short snapCurve(SnapData *snapdata, Object *ob, - float obmat[4][4], + const float obmat[4][4], bool use_obedit, /* read/write args */ float *dist_px, @@ -1838,7 +1838,7 @@ static short snapCurve(SnapData *snapdata, /* may extend later (for now just snaps to empty center) */ static short snapEmpty(SnapData *snapdata, Object *ob, - float obmat[4][4], + const float obmat[4][4], /* read/write args */ float *dist_px, /* return args */ @@ -1993,7 +1993,7 @@ static short snapMesh(SnapObjectContext *sctx, SnapData *snapdata, Object *ob, Mesh *me, - float obmat[4][4], + const float obmat[4][4], /* read/write args */ float *dist_px, /* return args */ @@ -2231,7 +2231,7 @@ static short snapEditMesh(SnapObjectContext *sctx, SnapData *snapdata, Object *ob, BMEditMesh *em, - float obmat[4][4], + const float obmat[4][4], /* read/write args */ float *dist_px, /* return args */ diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c index 2abbe67237e..44bffc76859 100644 --- a/source/blender/editors/uvedit/uvedit_buttons.c +++ b/source/blender/editors/uvedit/uvedit_buttons.c @@ -98,7 +98,7 @@ static int uvedit_center( } static void uvedit_translate( - Scene *scene, Object **objects, uint objects_len, Image *ima, float delta[2]) + Scene *scene, Object **objects, uint objects_len, Image *ima, const float delta[2]) { BMFace *f; BMLoop *l; diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index cd7e5f9ba09..57e2a84d248 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -4458,7 +4458,7 @@ static int uv_select_overlap(bContext *C, const bool extend) overlap_data[data_index].face_index = face_index; /* BVH needs 3D, overlap data uses 2D. */ - float tri[3][3] = { + const float tri[3][3] = { {UNPACK2(uv_verts[indices[t][0]]), 0.0f}, {UNPACK2(uv_verts[indices[t][1]]), 0.0f}, {UNPACK2(uv_verts[indices[t][2]]), 0.0f}, diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 2d8f40ea5af..1db038bef94 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1258,7 +1258,7 @@ static void uv_map_rotation_matrix_ex(float result[4][4], float upangledeg, float sideangledeg, float radius, - float offset[4]) + const float offset[4]) { float rotup[4][4], rotside[4][4], viewmatrix[4][4], rotobj[4][4]; float sideangle = 0.0f, upangle = 0.0f; @@ -2035,9 +2035,9 @@ void UV_OT_reset(wmOperatorType *ot) /****************** Sphere Project operator ***************/ static void uv_sphere_project(float target[2], - float source[3], - float center[3], - float rotmat[4][4]) + const float source[3], + const float center[3], + const float rotmat[4][4]) { float pv[3]; @@ -2162,9 +2162,9 @@ void UV_OT_sphere_project(wmOperatorType *ot) /***************** Cylinder Project operator **************/ static void uv_cylinder_project(float target[2], - float source[3], - float center[3], - float rotmat[4][4]) + const float source[3], + const float center[3], + const float rotmat[4][4]) { float pv[3]; diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 12ed8d4de70..3511c7438cb 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -954,7 +954,7 @@ void GPU_pbvh_bmesh_buffers_update(GPU_PBVH_Buffers *buffers, BM_face_as_array_vert_tri(f, v); - uint idx[3] = { + const uint idx[3] = { BM_elem_index_get(v[0]), BM_elem_index_get(v[1]), BM_elem_index_get(v[2])}; GPU_indexbuf_add_tri_verts(&elb, idx[0], idx[1], idx[2]); diff --git a/source/blender/gpu/intern/gpu_material.c b/source/blender/gpu/intern/gpu_material.c index 7e254d802f0..2e3a0a8df27 100644 --- a/source/blender/gpu/intern/gpu_material.c +++ b/source/blender/gpu/intern/gpu_material.c @@ -344,7 +344,7 @@ static float eval_integral(float x0, float x1, short falloff_type, float sharpne #undef INTEGRAL_RESOLUTION static void compute_sss_kernel( - GPUSssKernelData *kd, float radii[3], int sample_len, int falloff_type, float sharpness) + GPUSssKernelData *kd, const float radii[3], int sample_len, int falloff_type, float sharpness) { float rad[3]; /* Minimum radius */ diff --git a/source/blender/imbuf/intern/stereoimbuf.c b/source/blender/imbuf/intern/stereoimbuf.c index 44c311eba9d..71750c9c28f 100644 --- a/source/blender/imbuf/intern/stereoimbuf.c +++ b/source/blender/imbuf/intern/stereoimbuf.c @@ -68,7 +68,7 @@ static void imb_stereo3d_write_anaglyph(Stereo3DData *s3d, enum eStereo3dAnaglyp const int stride_from = width; const int stride_to = width; - int anaglyph_encoding[3][3] = { + const int anaglyph_encoding[3][3] = { {0, 1, 1}, {1, 0, 1}, {0, 0, 1}, @@ -810,7 +810,7 @@ static void imb_stereo3d_read_anaglyph(Stereo3DData *s3d, enum eStereo3dAnaglyph const int stride_from = width; const int stride_to = width; - int anaglyph_encoding[3][3] = { + const int anaglyph_encoding[3][3] = { {0, 1, 1}, {1, 0, 1}, {0, 0, 1}, diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c index 9e368d2c050..3c3aae8fda6 100644 --- a/source/blender/modifiers/intern/MOD_array.c +++ b/source/blender/modifiers/intern/MOD_array.c @@ -268,7 +268,7 @@ static void dm_mvert_map_doubles(int *doubles_map, static void mesh_merge_transform(Mesh *result, Mesh *cap_mesh, - float cap_offset[4][4], + const float cap_offset[4][4], unsigned int cap_verts_index, unsigned int cap_edges_index, int cap_loops_index, diff --git a/source/blender/modifiers/intern/MOD_mirror.c b/source/blender/modifiers/intern/MOD_mirror.c index 11f001d7a85..21ec3505dc9 100644 --- a/source/blender/modifiers/intern/MOD_mirror.c +++ b/source/blender/modifiers/intern/MOD_mirror.c @@ -68,8 +68,11 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte } } -static Mesh *doBiscetOnMirrorPlane( - MirrorModifierData *mmd, const Mesh *mesh, int axis, float plane_co[3], float plane_no[3]) +static Mesh *doBiscetOnMirrorPlane(MirrorModifierData *mmd, + const Mesh *mesh, + int axis, + const float plane_co[3], + float plane_no[3]) { bool do_bisect_flip_axis = ((axis == 0 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_X) || (axis == 1 && mmd->flag & MOD_MIR_BISECT_FLIP_AXIS_Y) || diff --git a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c index ea916d25ffd..21d2cdcb3b5 100644 --- a/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c +++ b/source/blender/nodes/shader/nodes/node_shader_hueSatVal.c @@ -39,7 +39,7 @@ static bNodeSocketTemplate sh_node_hue_sat_out[] = { /* note: it would be possible to use CMP version for both nodes */ static void do_hue_sat_fac( - bNode *UNUSED(node), float *out, float hue, float sat, float val, float in[4], float fac) + bNode *UNUSED(node), float *out, float hue, float sat, float val, const float in[4], float fac) { if (fac != 0.0f && (hue != 0.5f || sat != 1.0f || val != 1.0f)) { float col[3], hsv[3], mfac = 1.0f - fac; diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c index 4e5a83555eb..e8c349f6c85 100644 --- a/source/blender/render/intern/source/bake_api.c +++ b/source/blender/render/intern/source/bake_api.c @@ -172,8 +172,8 @@ void RE_bake_margin(ImBuf *ibuf, char *mask, const int margin) */ static void calc_point_from_barycentric_cage(TriTessFace *triangles_low, TriTessFace *triangles_cage, - float mat_low[4][4], - float mat_cage[4][4], + const float mat_low[4][4], + const float mat_cage[4][4], int primitive_id, float u, float v, @@ -214,8 +214,8 @@ static void calc_point_from_barycentric_cage(TriTessFace *triangles_low, * The returned coordinate is extruded along the normal by cage_extrusion */ static void calc_point_from_barycentric_extrusion(TriTessFace *triangles, - float mat[4][4], - float imat[4][4], + const float mat[4][4], + const float imat[4][4], int primitive_id, float u, float v, @@ -316,7 +316,7 @@ static bool cast_ray_highpoly(BVHTreeFromMesh *treeData, TriTessFace *triangles[], BakePixel *pixel_array_low, BakePixel *pixel_array, - float mat_low[4][4], + const float mat_low[4][4], BakeHighPolyData *highpoly, const float co[3], const float dir[3], diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index cd140eba55a..2313383fe6e 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -77,8 +77,11 @@ static GHOST_TStandardCursor convert_cursor(int curs) } } -static void window_set_custom_cursor( - wmWindow *win, unsigned char mask[16][2], unsigned char bitmap[16][2], int hotx, int hoty) +static void window_set_custom_cursor(wmWindow *win, + unsigned const char mask[16][2], + unsigned char bitmap[16][2], + int hotx, + int hoty) { GHOST_SetCustomCursorShape( win->ghostwin, (GHOST_TUns8 *)bitmap, (GHOST_TUns8 *)mask, 16, 16, hotx, hoty, true); |