[Bf-blender-cvs] [1012e9bbfa6] master: Cleanup: Fix inconcistent array lengths in function declarations

Hans Goudey noreply at git.blender.org
Wed Apr 28 20:14:06 CEST 2021


Commit: 1012e9bbfa61e09a49962e5ca468e239ad75865a
Author: Hans Goudey
Date:   Wed Apr 28 13:13:43 2021 -0500
Branches: master
https://developer.blender.org/rB1012e9bbfa61e09a49962e5ca468e239ad75865a

Cleanup: Fix inconcistent array lengths in function declarations

In some cases functions were defined with arguments of different array
lengths in headers vs. implementations. This commit fixes some of the
cases I ran into, but probably not all of them.

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

M	source/blender/blenkernel/intern/pbvh_intern.h
M	source/blender/blenlib/BLI_math_color.h
M	source/blender/blenlib/BLI_math_geom.h
M	source/blender/blenlib/BLI_math_matrix.h
M	source/blender/blenlib/BLI_math_vector.h
M	source/blender/blenlib/intern/uvproject.c
M	source/blender/editors/include/ED_screen.h
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/include/UI_resources.h
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/space_view3d/view3d_edit.c
M	source/blender/editors/transform/transform.c

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

diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h
index 63bc8753fc7..db6b2a89efb 100644
--- a/source/blender/blenkernel/intern/pbvh_intern.h
+++ b/source/blender/blenkernel/intern/pbvh_intern.h
@@ -187,10 +187,10 @@ int BB_widest_axis(const BB *bb);
 void pbvh_grow_nodes(PBVH *bvh, int totnode);
 bool ray_face_intersection_quad(const float ray_start[3],
                                 struct IsectRayPrecalc *isect_precalc,
-                                const float *t0,
-                                const float *t1,
-                                const float *t2,
-                                const float *t3,
+                                const float t0[3],
+                                const float t1[3],
+                                const float t2[3],
+                                const float t3[3],
                                 float *depth);
 bool ray_face_intersection_tri(const float ray_start[3],
                                struct IsectRayPrecalc *isect_precalc,
@@ -201,17 +201,17 @@ bool ray_face_intersection_tri(const float ray_start[3],
 
 bool ray_face_nearest_quad(const float ray_start[3],
                            const float ray_normal[3],
-                           const float *t0,
-                           const float *t1,
-                           const float *t2,
-                           const float *t3,
+                           const float t0[3],
+                           const float t1[3],
+                           const float t2[3],
+                           const float t3[3],
                            float *r_depth,
                            float *r_dist_sq);
 bool ray_face_nearest_tri(const float ray_start[3],
                           const float ray_normal[3],
-                          const float *t0,
-                          const float *t1,
-                          const float *t2,
+                          const float t0[3],
+                          const float t1[3],
+                          const float t2[3],
                           float *r_depth,
                           float *r_dist_sq);
 
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index 26d2f1fcb29..a113f3a370c 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -105,8 +105,8 @@ int constrain_rgb(float *r, float *g, float *b);
 void minmax_rgb(short c[3]);
 void hsv_clamp_v(float hsv[3], float v_max);
 
-void rgb_float_set_hue_float_offset(float *rgb, float hue_offset);
-void rgb_byte_set_hue_float_offset(unsigned char *rgb, float hue_offset);
+void rgb_float_set_hue_float_offset(float rgb[3], float hue_offset);
+void rgb_byte_set_hue_float_offset(unsigned char rgb[3], float hue_offset);
 
 void rgb_uchar_to_float(float r_col[3], const unsigned char col_ub[3]);
 void rgba_uchar_to_float(float r_col[4], const unsigned char col_ub[4]);
diff --git a/source/blender/blenlib/BLI_math_geom.h b/source/blender/blenlib/BLI_math_geom.h
index d767c2924d1..b9c3d8af25c 100644
--- a/source/blender/blenlib/BLI_math_geom.h
+++ b/source/blender/blenlib/BLI_math_geom.h
@@ -778,7 +778,7 @@ MINLINE float dot_shsh(const float a[9], const float b[9]);
 MINLINE float eval_shv3(float r[9], const float v[3]);
 MINLINE float diffuse_shv3(float r[9], const float v[3]);
 MINLINE void vec_fac_to_sh(float r[9], const float v[3], const float f);
-MINLINE void madd_sh_shfl(float r[9], const float sh[3], const float f);
+MINLINE void madd_sh_shfl(float r[9], const float sh[9], const float f);
 
 /********************************* Form Factor *******************************/
 
diff --git a/source/blender/blenlib/BLI_math_matrix.h b/source/blender/blenlib/BLI_math_matrix.h
index 378095589e8..54df88ca541 100644
--- a/source/blender/blenlib/BLI_math_matrix.h
+++ b/source/blender/blenlib/BLI_math_matrix.h
@@ -362,7 +362,7 @@ void loc_quat_size_to_mat4(float R[4][4],
                            const float size[3]);
 void loc_axisangle_size_to_mat4(float R[4][4],
                                 const float loc[3],
-                                const float axis[4],
+                                const float axis[3],
                                 const float angle,
                                 const float size[3]);
 
diff --git a/source/blender/blenlib/BLI_math_vector.h b/source/blender/blenlib/BLI_math_vector.h
index bb1e1a1c38d..b43f86af670 100644
--- a/source/blender/blenlib/BLI_math_vector.h
+++ b/source/blender/blenlib/BLI_math_vector.h
@@ -146,7 +146,7 @@ MINLINE void mul_v3_v3(float r[3], const float a[3]);
 MINLINE void mul_v3_v3v3(float r[3], const float a[3], const float b[3]);
 MINLINE void mul_v4_fl(float r[4], float f);
 MINLINE void mul_v4_v4(float r[4], const float a[4]);
-MINLINE void mul_v4_v4fl(float r[3], const float a[4], float f);
+MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f);
 MINLINE void mul_v2_v2_cw(float r[2], const float mat[2], const float vec[2]);
 MINLINE void mul_v2_v2_ccw(float r[2], const float mat[2], const float vec[2]);
 MINLINE float mul_project_m4_v3_zfac(const float mat[4][4],
@@ -177,7 +177,7 @@ MINLINE void negate_v2_v2(float r[2], const float a[2]);
 MINLINE void negate_v3(float r[3]);
 MINLINE void negate_v3_v3(float r[3], const float a[3]);
 MINLINE void negate_v4(float r[4]);
-MINLINE void negate_v4_v4(float r[4], const float a[3]);
+MINLINE void negate_v4_v4(float r[4], const float a[4]);
 
 MINLINE void negate_v3_short(short r[3]);
 MINLINE void negate_v3_db(double r[3]);
@@ -323,11 +323,11 @@ void flip_v2_v2v2(float v[2], const float v1[2], const float v2[2]);
 
 /********************************* Comparison ********************************/
 
-MINLINE bool is_zero_v2(const float a[3]) ATTR_WARN_UNUSED_RESULT;
+MINLINE bool is_zero_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT;
 MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT;
 MINLINE bool is_zero_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT;
 
-bool is_finite_v2(const float a[3]) ATTR_WARN_UNUSED_RESULT;
+bool is_finite_v2(const float a[2]) ATTR_WARN_UNUSED_RESULT;
 bool is_finite_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT;
 bool is_finite_v4(const float a[4]) ATTR_WARN_UNUSED_RESULT;
 
diff --git a/source/blender/blenlib/intern/uvproject.c b/source/blender/blenlib/intern/uvproject.c
index 329c4d48fe8..093d08e643d 100644
--- a/source/blender/blenlib/intern/uvproject.c
+++ b/source/blender/blenlib/intern/uvproject.c
@@ -134,7 +134,7 @@ void BLI_uvproject_from_view(float target[2],
 
 /* 'rotmat' can be `obedit->obmat` when uv project is used.
  * 'winx' and 'winy' can be from `scene->r.xsch/ysch` */
-ProjCameraInfo *BLI_uvproject_camera_info(Object *ob, float (*rotmat)[4], float winx, float winy)
+ProjCameraInfo *BLI_uvproject_camera_info(Object *ob, float rotmat[4][4], float winx, float winy)
 {
   ProjCameraInfo uci;
   Camera *camera = ob->data;
diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h
index 169b25a1358..419239d5b7a 100644
--- a/source/blender/editors/include/ED_screen.h
+++ b/source/blender/editors/include/ED_screen.h
@@ -162,7 +162,7 @@ void ED_area_tag_redraw_no_rebuild(ScrArea *area);
 void ED_area_tag_redraw_regiontype(ScrArea *area, int type);
 void ED_area_tag_refresh(ScrArea *area);
 void ED_area_do_refresh(struct bContext *C, ScrArea *area);
-struct AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[]);
+struct AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[2]);
 void ED_area_status_text(ScrArea *area, const char *str);
 void ED_area_newspace(struct bContext *C, ScrArea *area, int type, const bool skip_region_exit);
 void ED_area_prevspace(struct bContext *C, ScrArea *area);
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index e0d9971529f..bab7054a905 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -2137,7 +2137,7 @@ void uiTemplateComponentMenu(uiLayout *layout,
                              struct PointerRNA *ptr,
                              const char *propname,
                              const char *name);
-void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float *color);
+void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float color[4]);
 void uiTemplateCacheFile(uiLayout *layout,
                          const struct bContext *C,
                          struct PointerRNA *ptr,
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 1820c2f133c..c99c7f681b3 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -451,7 +451,7 @@ int UI_ThemeMenuShadowWidth(void);
 /* only for buttons in theme editor! */
 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
 
-void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
+void UI_make_axis_color(const unsigned char src_col[3], unsigned char dst_col[3], const char axis);
 
 #ifdef __cplusplus
 }
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 760fbe75688..6ca0f196280 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -7192,7 +7192,7 @@ void uiTemplateComponentMenu(uiLayout *layout,
 /** \name Node Socket Icon Template
  * \{ */
 
-void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float *color)
+void uiTemplateNodeSocket(uiLayout *layout, bContext *UNUSED(C), float color[4])
 {
   uiBlock *block = uiLayoutGetBlock(layout);
   UI_block_align_begin(block);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 358373ea4d1..967ad966320 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -2507,7 +2507,7 @@ static void view_doll

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list