From b13953b1f2d83766ae20cb32ca8a89717a69c4c7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 21 May 2021 15:45:25 +1000 Subject: Cleanup: quiet -Warray-parameter warnings from GCC11 Some warnings remain that require larger changes. --- source/blender/editors/include/ED_view3d.h | 4 ++-- source/blender/editors/interface/interface_intern.h | 4 +--- source/blender/editors/sculpt_paint/paint_intern.h | 2 +- .../editors/transform/transform_orientations.c | 2 +- source/blender/makesrna/intern/rna_armature.c | 2 +- source/blender/makesrna/intern/rna_armature_api.c | 20 ++++++++++---------- source/blender/makesrna/intern/rna_curve_api.c | 2 +- source/blender/makesrna/intern/rna_curveprofile.c | 2 +- source/blender/makesrna/intern/rna_lattice_api.c | 2 +- source/blender/makesrna/intern/rna_mesh_api.c | 2 +- source/blender/makesrna/intern/rna_meta_api.c | 2 +- source/blender/makesrna/intern/rna_nodetree.c | 4 ++-- source/blender/makesrna/intern/rna_object_api.c | 4 ++-- source/blender/makesrna/intern/rna_pose_api.c | 2 +- source/blender/makesrna/intern/rna_scene_api.c | 2 +- source/blender/makesrna/intern/rna_tracking.c | 2 +- source/blender/render/RE_engine.h | 2 +- source/blender/render/intern/engine.c | 2 +- 18 files changed, 30 insertions(+), 32 deletions(-) diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 499f28beb60..66ec57c8a31 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -454,7 +454,7 @@ bool ED_view3d_calc_render_border(const struct Scene *scene, struct ARegion *region, struct rcti *rect); -void ED_view3d_clipping_calc_from_boundbox(float clip[6][4], +void ED_view3d_clipping_calc_from_boundbox(float clip[4][4], const struct BoundBox *clipbb, const bool is_flip); void ED_view3d_clipping_calc(struct BoundBox *bb, @@ -690,7 +690,7 @@ float ED_view3d_grid_scale(const struct Scene *scene, void ED_view3d_grid_steps(const struct Scene *scene, struct View3D *v3d, struct RegionView3D *rv3d, - float *r_grid_steps); + float r_grid_steps[8]); float ED_view3d_grid_view_scale(struct Scene *scene, struct View3D *v3d, struct ARegion *region, diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 40a3f0d330f..23856c41ceb 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -934,9 +934,7 @@ extern void ui_but_execute_end(struct bContext *C, void *active_back); extern void ui_but_active_free(const struct bContext *C, uiBut *but); extern int ui_but_menu_direction(uiBut *but); -extern void ui_but_text_password_hide(char password_str[UI_MAX_DRAW_STR], - uiBut *but, - const bool restore); +extern void ui_but_text_password_hide(char password_str[128], uiBut *but, const bool restore); extern uiBut *ui_but_find_select_in_enum(uiBut *but, int direction); bool ui_but_is_editing(const uiBut *but); float ui_block_calc_pie_segment(struct uiBlock *block, const float event_xy[2]); diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index 3f5093222e9..7341d984c91 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -304,7 +304,7 @@ bool paint_curve_poll(struct bContext *C); bool facemask_paint_poll(struct bContext *C); void flip_v3_v3(float out[3], const float in[3], const enum ePaintSymmetryFlags symm); -void flip_qt_qt(float out[3], const float in[3], const enum ePaintSymmetryFlags symm); +void flip_qt_qt(float out[4], const float in[4], const enum ePaintSymmetryFlags symm); /* stroke operator */ typedef enum BrushStrokeMode { diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index b3ed294845d..d97bcba161f 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -445,7 +445,7 @@ int BIF_countTransformOrientation(const bContext *C) return BLI_listbase_count(transform_orientations); } -void applyTransformOrientation(const TransformOrientation *ts, float r_mat[3][3], char *r_name) +void applyTransformOrientation(const TransformOrientation *ts, float r_mat[3][3], char r_name[64]) { if (r_name) { BLI_strncpy(r_name, ts->name, MAX_NAME); diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index c54621372ba..c8fccfc27f8 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -674,7 +674,7 @@ static bool rna_Armature_is_editmode_get(PointerRNA *ptr) return (arm->edbo != NULL); } -static void rna_Armature_transform(bArmature *arm, float *mat) +static void rna_Armature_transform(bArmature *arm, float mat[16]) { ED_armature_transform(arm, (const float(*)[4])mat, true); } diff --git a/source/blender/makesrna/intern/rna_armature_api.c b/source/blender/makesrna/intern/rna_armature_api.c index 36aa0401c7d..a02f55667e3 100644 --- a/source/blender/makesrna/intern/rna_armature_api.c +++ b/source/blender/makesrna/intern/rna_armature_api.c @@ -44,7 +44,7 @@ static void rna_EditBone_align_roll(EditBone *ebo, float no[3]) ebo->roll = ED_armature_ebone_roll_to_vector(ebo, no, false); } -static float rna_Bone_do_envelope(Bone *bone, float *vec) +static float rna_Bone_do_envelope(Bone *bone, float vec[3]) { float scale = (bone->flag & BONE_MULT_VG_ENV) == BONE_MULT_VG_ENV ? bone->weight : 1.0f; return distfactor_to_bone(vec, @@ -56,11 +56,11 @@ static float rna_Bone_do_envelope(Bone *bone, float *vec) } static void rna_Bone_convert_local_to_pose(Bone *bone, - float *r_matrix, - float *matrix, - float *matrix_local, - float *parent_matrix, - float *parent_matrix_local, + float r_matrix[16], + float matrix[16], + float matrix_local[16], + float parent_matrix[16], + float parent_matrix_local[16], bool invert) { BoneParentTransform bpt; @@ -89,14 +89,14 @@ static void rna_Bone_convert_local_to_pose(Bone *bone, BKE_bone_parent_transform_apply(&bpt, (float(*)[4])matrix, (float(*)[4])r_matrix); } -static void rna_Bone_MatrixFromAxisRoll(float *axis, float roll, float *r_matrix) +static void rna_Bone_MatrixFromAxisRoll(float axis[3], float roll, float r_matrix[9]) { vec_roll_to_mat3(axis, roll, (float(*)[3])r_matrix); } -static void rna_Bone_AxisRollFromMatrix(float *matrix, - float *axis_override, - float *r_axis, +static void rna_Bone_AxisRollFromMatrix(float matrix[9], + float axis_override[3], + float r_axis[3], float *r_roll) { float mat[3][3]; diff --git a/source/blender/makesrna/intern/rna_curve_api.c b/source/blender/makesrna/intern/rna_curve_api.c index 94fdb130026..beea607e8c0 100644 --- a/source/blender/makesrna/intern/rna_curve_api.c +++ b/source/blender/makesrna/intern/rna_curve_api.c @@ -35,7 +35,7 @@ #include "rna_internal.h" /* own include */ #ifdef RNA_RUNTIME -static void rna_Curve_transform(Curve *cu, float *mat, bool shape_keys) +static void rna_Curve_transform(Curve *cu, float mat[16], bool shape_keys) { BKE_curve_transform(cu, (const float(*)[4])mat, shape_keys, true); diff --git a/source/blender/makesrna/intern/rna_curveprofile.c b/source/blender/makesrna/intern/rna_curveprofile.c index bb54d55f8bd..b3ab8cc15a2 100644 --- a/source/blender/makesrna/intern/rna_curveprofile.c +++ b/source/blender/makesrna/intern/rna_curveprofile.c @@ -137,7 +137,7 @@ static void rna_CurveProfile_remove_point(CurveProfile *profile, static void rna_CurveProfile_evaluate(struct CurveProfile *profile, ReportList *reports, float length_portion, - float *location) + float location[2]) { if (!profile->table) { BKE_report(reports, RPT_ERROR, "CurveProfile table not initialized, call initialize()"); diff --git a/source/blender/makesrna/intern/rna_lattice_api.c b/source/blender/makesrna/intern/rna_lattice_api.c index 0b61603dd09..5b69a743d47 100644 --- a/source/blender/makesrna/intern/rna_lattice_api.c +++ b/source/blender/makesrna/intern/rna_lattice_api.c @@ -33,7 +33,7 @@ #include "rna_internal.h" /* own include */ #ifdef RNA_RUNTIME -static void rna_Lattice_transform(Lattice *lt, float *mat, bool shape_keys) +static void rna_Lattice_transform(Lattice *lt, float mat[16], bool shape_keys) { BKE_lattice_transform(lt, (float(*)[4])mat, shape_keys); diff --git a/source/blender/makesrna/intern/rna_mesh_api.c b/source/blender/makesrna/intern/rna_mesh_api.c index f92a2932f06..2b0582cae9a 100644 --- a/source/blender/makesrna/intern/rna_mesh_api.c +++ b/source/blender/makesrna/intern/rna_mesh_api.c @@ -172,7 +172,7 @@ static void rna_Mesh_normals_split_custom_set_from_vertices(Mesh *mesh, DEG_id_tag_update(&mesh->id, 0); } -static void rna_Mesh_transform(Mesh *mesh, float *mat, bool shape_keys) +static void rna_Mesh_transform(Mesh *mesh, float mat[16], bool shape_keys) { BKE_mesh_transform(mesh, (float(*)[4])mat, shape_keys); diff --git a/source/blender/makesrna/intern/rna_meta_api.c b/source/blender/makesrna/intern/rna_meta_api.c index 19d0b35959b..93bd9fe3b9c 100644 --- a/source/blender/makesrna/intern/rna_meta_api.c +++ b/source/blender/makesrna/intern/rna_meta_api.c @@ -35,7 +35,7 @@ #include "rna_internal.h" /* own include */ #ifdef RNA_RUNTIME -static void rna_Meta_transform(struct MetaBall *mb, float *mat) +static void rna_Meta_transform(struct MetaBall *mb, float mat[16]) { BKE_mball_transform(mb, (float(*)[4])mat, true); diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 49abb892acc..c2512ea33ae 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -3133,7 +3133,7 @@ static void rna_NodeSocketStandard_draw(ID *id, } static void rna_NodeSocketStandard_draw_color( - ID *id, bNodeSocket *sock, struct bContext *C, PointerRNA *nodeptr, float *r_color) + ID *id, bNodeSocket *sock, struct bContext *C, PointerRNA *nodeptr, float r_color[4]) { PointerRNA ptr; RNA_pointer_create(id, &RNA_NodeSocket, sock, &ptr); @@ -3153,7 +3153,7 @@ static void rna_NodeSocketInterfaceStandard_draw(ID *id, static void rna_NodeSocketInterfaceStandard_draw_color(ID *id, bNodeSocket *sock, struct bContext *C, - float *r_color) + float r_color[4]) { PointerRNA ptr; RNA_pointer_create(id, &RNA_NodeSocket, sock, &ptr); diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index df628caa000..e463323c6dc 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -296,8 +296,8 @@ static bool rna_Object_visible_in_viewport_get(Object *ob, View3D *v3d) static void rna_Object_mat_convert_space(Object *ob, ReportList *reports, bPoseChannel *pchan, - float *mat, - float *mat_ret, + float mat[16], + float mat_ret[16], int from, int to) { diff --git a/source/blender/makesrna/intern/rna_pose_api.c b/source/blender/makesrna/intern/rna_pose_api.c index 29516830058..0d35365c2d8 100644 --- a/source/blender/makesrna/intern/rna_pose_api.c +++ b/source/blender/makesrna/intern/rna_pose_api.c @@ -47,7 +47,7 @@ # include "BLI_ghash.h" -static float rna_PoseBone_do_envelope(bPoseChannel *chan, float *vec) +static float rna_PoseBone_do_envelope(bPoseChannel *chan, float vec[3]) { Bone *bone = chan->bone; diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index c2089004da2..c49b41867a8 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -98,7 +98,7 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, int frame, float subf } } -static void rna_Scene_uvedit_aspect(Scene *UNUSED(scene), Object *ob, float *aspect) +static void rna_Scene_uvedit_aspect(Scene *UNUSED(scene), Object *ob, float aspect[2]) { if ((ob->type == OB_MESH) && (ob->mode == OB_MODE_EDIT)) { BMEditMesh *em; diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index c136605c727..336359a9dc0 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -697,7 +697,7 @@ static MovieTrackingMarker *rna_trackingMarkers_find_frame(MovieTrackingTrack *t static MovieTrackingMarker *rna_trackingMarkers_insert_frame(MovieTrackingTrack *track, int framenr, - float *co) + float co[2]) { MovieTrackingMarker marker, *new_marker; diff --git a/source/blender/render/RE_engine.h b/source/blender/render/RE_engine.h index f6ab7fd9d3c..7352ac7b12e 100644 --- a/source/blender/render/RE_engine.h +++ b/source/blender/render/RE_engine.h @@ -195,7 +195,7 @@ float RE_engine_get_camera_shift_x(RenderEngine *engine, void RE_engine_get_camera_model_matrix(RenderEngine *engine, struct Object *camera, bool use_spherical_stereo, - float *r_modelmat); + float r_modelmat[16]); bool RE_engine_get_spherical_stereo(RenderEngine *engine, struct Object *camera); bool RE_engine_test_break(RenderEngine *engine); diff --git a/source/blender/render/intern/engine.c b/source/blender/render/intern/engine.c index 66d38eb19c7..306d144f79d 100644 --- a/source/blender/render/intern/engine.c +++ b/source/blender/render/intern/engine.c @@ -546,7 +546,7 @@ float RE_engine_get_camera_shift_x(RenderEngine *engine, Object *camera, bool us void RE_engine_get_camera_model_matrix(RenderEngine *engine, Object *camera, bool use_spherical_stereo, - float *r_modelmat) + float r_modelmat[16]) { /* When using spherical stereo, get model matrix without multiview, * leaving stereo to be handled by the engine. */ -- cgit v1.2.3