[Bf-blender-cvs] [69d127c] master: Code cleanup: use const for array args

Campbell Barton noreply at git.blender.org
Thu Apr 17 16:30:36 CEST 2014


Commit: 69d127cadefbd9da6f8f11e3e32b77baebd20ea4
Author: Campbell Barton
Date:   Thu Apr 17 21:14:34 2014 +1000
https://developer.blender.org/rB69d127cadefbd9da6f8f11e3e32b77baebd20ea4

Code cleanup: use const for array args

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

M	source/blender/editors/space_view3d/drawvolume.c
M	source/blender/editors/space_view3d/view3d_intern.h
M	source/blender/editors/space_view3d/view3d_view.c

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

diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c
index 32e21a0..f3088ce 100644
--- a/source/blender/editors/space_view3d/drawvolume.c
+++ b/source/blender/editors/space_view3d/drawvolume.c
@@ -116,8 +116,8 @@ static bool convex(const float p0[3], const float up[3], const float a[3], const
 }
 
 void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
-                       GPUTexture *tex, float min[3], float max[3],
-                       int res[3], float dx, float UNUSED(base_scale), float viewnormal[3],
+                       GPUTexture *tex, const float min[3], const float max[3],
+                       const int res[3], float dx, float UNUSED(base_scale), const float viewnormal[3],
                        GPUTexture *tex_shadow, GPUTexture *tex_flame)
 {
 	const float ob_sizei[3] = {
@@ -410,9 +410,9 @@ void draw_smoke_volume(SmokeDomainSettings *sds, Object *ob,
 	}
 
 	if (!GPU_non_power_of_two_support()) {
-		cor[0] = (float)res[0] / (float)power_of_2_max_i(res[0]);
-		cor[1] = (float)res[1] / (float)power_of_2_max_i(res[1]);
-		cor[2] = (float)res[2] / (float)power_of_2_max_i(res[2]);
+		cor[0] = (float)res[0] / (float)power_of_2_max_u(res[0]);
+		cor[1] = (float)res[1] / (float)power_of_2_max_u(res[1]);
+		cor[2] = (float)res[2] / (float)power_of_2_max_u(res[2]);
 	}
 
 	cor[0] /= size[0];
diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h
index 3e7c97a..3f5d35a 100644
--- a/source/blender/editors/space_view3d/view3d_intern.h
+++ b/source/blender/editors/space_view3d/view3d_intern.h
@@ -204,8 +204,9 @@ void VIEW3D_OT_game_start(struct wmOperatorType *ot);
 bool ED_view3d_boundbox_clip_ex(RegionView3D *rv3d, const struct BoundBox *bb, float obmat[4][4]);
 bool ED_view3d_boundbox_clip(RegionView3D *rv3d, const struct BoundBox *bb);
 
-void ED_view3d_smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar, struct Object *, struct Object *,
-                           float *ofs, float *quat, float *dist, float *lens,
+void ED_view3d_smooth_view(struct bContext *C, struct View3D *v3d, struct ARegion *ar,
+                           struct Object *camera_old, struct Object *camera,
+                           const float *ofs, const float *quat, const float *dist, const float *lens,
                            const int smooth_viewtx);
 
 void setwinmatrixview3d(ARegion *ar, View3D *v3d, rctf *rect);
@@ -259,8 +260,8 @@ extern const char *view3d_context_dir[]; /* doc access */
 
 /* draw_volume.c */
 void draw_smoke_volume(struct SmokeDomainSettings *sds, struct Object *ob,
-                       struct GPUTexture *tex, float min[3], float max[3],
-                       int res[3], float dx, float base_scale, float viewnormal[3],
+                       struct GPUTexture *tex, const float min[3], const float max[3],
+                       const int res[3], float dx, float base_scale, const float viewnormal[3],
                        struct GPUTexture *tex_shadow, struct GPUTexture *tex_flame);
 
 //#define SMOKE_DEBUG_VELOCITY
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index fdfce06..5c3eb57 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -164,7 +164,7 @@ static void view3d_smooth_view_state_restore(const struct SmoothView3DState *sms
 /* will start timer if appropriate */
 /* the arguments are the desired situation */
 void ED_view3d_smooth_view(bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Object *camera,
-                           float *ofs, float *quat, float *dist, float *lens,
+                           const float *ofs, const float *quat, const float *dist, const float *lens,
                            const int smooth_viewtx)
 {
 	wmWindowManager *wm = CTX_wm_manager(C);




More information about the Bf-blender-cvs mailing list