[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [40286] trunk/blender/source/blender: use const and array size in function definitions, no functional change.

Campbell Barton ideasman42 at gmail.com
Sat Sep 17 10:14:44 CEST 2011


Revision: 40286
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=40286
Author:   campbellbarton
Date:     2011-09-17 08:14:43 +0000 (Sat, 17 Sep 2011)
Log Message:
-----------
use const and array size in function definitions, no functional change.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/BLI_voxel.h
    trunk/blender/source/blender/blenlib/intern/voxel.c
    trunk/blender/source/blender/render/intern/include/voxeldata.h
    trunk/blender/source/blender/render/intern/source/voxeldata.c

Modified: trunk/blender/source/blender/blenlib/BLI_voxel.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_voxel.h	2011-09-17 07:28:19 UTC (rev 40285)
+++ trunk/blender/source/blender/blenlib/BLI_voxel.h	2011-09-17 08:14:43 UTC (rev 40286)
@@ -36,9 +36,9 @@
 #define V_I(x, y, z, res) ( (z)*(res)[1]*(res)[0] + (y)*(res)[0] + (x) )
 
 /* all input coordinates must be in bounding box 0.0 - 1.0 */
-float voxel_sample_nearest(float *data, int *res, float *co);
-float voxel_sample_trilinear(float *data, int *res, float *co);
-float voxel_sample_triquadratic(float *data, int *res, float *co);
-float voxel_sample_tricubic(float *data, int *res, float *co, int bspline);
+float voxel_sample_nearest(float *data, const int res[3], const float co[3]);
+float voxel_sample_trilinear(float *data, const int res[3], const float co[3]);
+float voxel_sample_triquadratic(float *data, const int res[3], const float co[3]);
+float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline);
 
 #endif /* BLI_VOXEL_H */

Modified: trunk/blender/source/blender/blenlib/intern/voxel.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/voxel.c	2011-09-17 07:28:19 UTC (rev 40285)
+++ trunk/blender/source/blender/blenlib/intern/voxel.c	2011-09-17 08:14:43 UTC (rev 40286)
@@ -36,7 +36,7 @@
 
 
 
-BM_INLINE float D(float *data,  int *res, int x, int y, int z)
+BM_INLINE float D(float *data, const int res[3], int x, int y, int z)
 {
 	CLAMP(x, 0, res[0]-1);
 	CLAMP(y, 0, res[1]-1);
@@ -46,7 +46,7 @@
 
 /* *** nearest neighbour *** */
 /* input coordinates must be in bounding box 0.0 - 1.0 */
-float voxel_sample_nearest(float *data, int *res, float *co)
+float voxel_sample_nearest(float *data, const int res[3], const float co[3])
 {
 	int xi, yi, zi;
 	
@@ -71,7 +71,7 @@
 	return (a < b) ? b : ((a > c) ? c : a);
 }
 
-float voxel_sample_trilinear(float *data, int *res, float *co)
+float voxel_sample_trilinear(float *data, const int res[3], const float co[3])
 {
 	if (data) {
 	
@@ -103,7 +103,7 @@
 }
 	
 
-float voxel_sample_triquadratic(float *data, int *res, float *co)
+float voxel_sample_triquadratic(float *data, const int res[3], const float co[3])
 {
 	if (data) {
 
@@ -133,7 +133,7 @@
 	return 0.f;
 }
 
-float voxel_sample_tricubic(float *data, int *res, float *co, int bspline)
+float voxel_sample_tricubic(float *data, const int res[3], const float co[3], int bspline)
 {
 	if (data) {
 

Modified: trunk/blender/source/blender/render/intern/include/voxeldata.h
===================================================================
--- trunk/blender/source/blender/render/intern/include/voxeldata.h	2011-09-17 07:28:19 UTC (rev 40285)
+++ trunk/blender/source/blender/render/intern/include/voxeldata.h	2011-09-17 08:14:43 UTC (rev 40286)
@@ -45,6 +45,6 @@
 
 void make_voxeldata(struct Render *re);
 void free_voxeldata(struct Render *re);
-int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres);
+int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texres);
 
 #endif /* VOXELDATA_H */

Modified: trunk/blender/source/blender/render/intern/source/voxeldata.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/voxeldata.c	2011-09-17 07:28:19 UTC (rev 40285)
+++ trunk/blender/source/blender/render/intern/source/voxeldata.c	2011-09-17 08:14:43 UTC (rev 40286)
@@ -383,7 +383,7 @@
 	
 }
 
-int voxeldatatex(struct Tex *tex, float *texvec, struct TexResult *texres)
+int voxeldatatex(struct Tex *tex, const float texvec[3], struct TexResult *texres)
 {	 
 	int retval = TEX_INT;
 	VoxelData *vd = tex->vd;	




More information about the Bf-blender-cvs mailing list