diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-09-17 12:14:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-09-17 12:14:43 +0400 |
commit | f3e182231d04b006af9f0adf74faf3bb24cc4242 (patch) | |
tree | 7cc7346509de755a127af08e22a729875f05d4b3 | |
parent | ec4181701fdddf9da5e8e50583f129320e2f4cae (diff) |
use const and array size in function definitions, no functional change.
-rw-r--r-- | source/blender/blenlib/BLI_voxel.h | 8 | ||||
-rw-r--r-- | source/blender/blenlib/intern/voxel.c | 10 | ||||
-rw-r--r-- | source/blender/render/intern/include/voxeldata.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/voxeldata.c | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenlib/BLI_voxel.h b/source/blender/blenlib/BLI_voxel.h index 41f8bfab729..8dd95a897ae 100644 --- a/source/blender/blenlib/BLI_voxel.h +++ b/source/blender/blenlib/BLI_voxel.h @@ -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 */ diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index d11386ff606..6d912be71d3 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -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 @@ BM_INLINE float D(float *data, int *res, int x, int y, int z) /* *** 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 @@ BM_INLINE int _clamp(int a, int b, int c) 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_trilinear(float *data, int *res, float *co) } -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 @@ float voxel_sample_triquadratic(float *data, int *res, float *co) 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) { diff --git a/source/blender/render/intern/include/voxeldata.h b/source/blender/render/intern/include/voxeldata.h index e9991a2a19c..aa3fd104ecf 100644 --- a/source/blender/render/intern/include/voxeldata.h +++ b/source/blender/render/intern/include/voxeldata.h @@ -45,6 +45,6 @@ typedef struct VoxelDataHeader 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 */ diff --git a/source/blender/render/intern/source/voxeldata.c b/source/blender/render/intern/source/voxeldata.c index 2ba346ae4c5..b63ece80119 100644 --- a/source/blender/render/intern/source/voxeldata.c +++ b/source/blender/render/intern/source/voxeldata.c @@ -383,7 +383,7 @@ void make_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) { int retval = TEX_INT; VoxelData *vd = tex->vd; |