[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48834] trunk/blender/source/blender: code cleanup: use const for passing vectors

Campbell Barton ideasman42 at gmail.com
Wed Jul 11 14:42:03 CEST 2012


Revision: 48834
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48834
Author:   campbellbarton
Date:     2012-07-11 12:42:02 +0000 (Wed, 11 Jul 2012)
Log Message:
-----------
code cleanup: use const for passing vectors

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_kdopbvh.h
    trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
    trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
    trunk/blender/source/blender/ikplugin/intern/itasc_plugin.cpp

Modified: trunk/blender/source/blender/blenlib/BLI_kdopbvh.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_kdopbvh.h	2012-07-11 12:35:50 UTC (rev 48833)
+++ trunk/blender/source/blender/blenlib/BLI_kdopbvh.h	2012-07-11 12:42:02 UTC (rev 48834)
@@ -104,7 +104,7 @@
 
 int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
 
-float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3]);
+float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3]);
 
 /* range query */
 int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata);

Modified: trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-07-11 12:35:50 UTC (rev 48833)
+++ trunk/blender/source/blender/blenlib/intern/BLI_kdopbvh.c	2012-07-11 12:42:02 UTC (rev 48834)
@@ -1343,7 +1343,7 @@
 
 
 /* Determines the distance that the ray must travel to hit the bounding volume of the given node */
-static float ray_nearest_hit(BVHRayCastData *data, float *bv)
+static float ray_nearest_hit(BVHRayCastData *data, const float *bv)
 {
 	int i;
 
@@ -1521,7 +1521,7 @@
 	return data.hit.index;
 }
 
-float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3])
+float BLI_bvhtree_bb_raycast(const float *bv, const float light_start[3], const float light_end[3], float pos[3])
 {
 	BVHRayCastData data;
 	float dist = 0.0;

Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2012-07-11 12:35:50 UTC (rev 48833)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c	2012-07-11 12:42:02 UTC (rev 48834)
@@ -583,7 +583,7 @@
 }
 
 /* still use 2D X,Y space but this works for verts transformed by a perspective matrix, using their 4th component as a weight */
-static void barycentric_weights_v2_persp(float v1[4], float v2[4], float v3[4], float co[2], float w[3])
+static void barycentric_weights_v2_persp(const float v1[4], const float v2[4], const float v3[4], const float co[2], float w[3])
 {
 	float wtot_inv, wtot;
 
@@ -603,13 +603,17 @@
 		w[0] = w[1] = w[2] = 1.0f / 3.0f;
 }
 
-static float VecZDepthOrtho(float pt[2], float v1[3], float v2[3], float v3[3], float w[3])
+static float VecZDepthOrtho(const float pt[2],
+                            const float v1[3], const float v2[3], const float v3[3],
+                            float w[3])
 {
 	barycentric_weights_v2(v1, v2, v3, pt, w);
 	return (v1[2] * w[0]) + (v2[2] * w[1]) + (v3[2] * w[2]);
 }
 
-static float VecZDepthPersp(float pt[2], float v1[4], float v2[4], float v3[4], float w[3])
+static float VecZDepthPersp(const float pt[2],
+                            const float v1[4], const float v2[4], const float v3[4],
+                            float w[3])
 {
 	float wtot_inv, wtot;
 	float w_tmp[3];

Modified: trunk/blender/source/blender/ikplugin/intern/itasc_plugin.cpp
===================================================================
--- trunk/blender/source/blender/ikplugin/intern/itasc_plugin.cpp	2012-07-11 12:35:50 UTC (rev 48833)
+++ trunk/blender/source/blender/ikplugin/intern/itasc_plugin.cpp	2012-07-11 12:42:02 UTC (rev 48834)
@@ -1618,7 +1618,7 @@
 			timestep = sts / 1000.0;
 		}
 	}
-	// don't cache if we are reiterating because we don't want to distroy the cache unnecessarily
+	// don't cache if we are reiterating because we don't want to destroy the cache unnecessarily
 	ikscene->scene->update(timestamp, timestep, numstep, false, !reiterate, simulation);
 	if (reiterate) {
 		// how many times do we reiterate?




More information about the Bf-blender-cvs mailing list