diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
commit | 90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch) | |
tree | e88cab4fb1358e962b19f658064ca8c9f8d29f5b /source/blender/blenlib/intern/voxel.c | |
parent | 08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff) | |
parent | b0b787ef38f9947b3176642556f5282eb3518f69 (diff) |
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'source/blender/blenlib/intern/voxel.c')
-rw-r--r-- | source/blender/blenlib/intern/voxel.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index 31ed116c40a..2b04a49e848 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -30,12 +30,7 @@ #include "BKE_utildefines.h" - -#if defined( _MSC_VER ) && !defined( __cplusplus ) -# define inline __inline -#endif // defined( _MSC_VER ) && !defined( __cplusplus ) - -static inline float D(float *data, int *res, int x, int y, int z) +BM_INLINE float D(float *data, int *res, int x, int y, int z) { CLAMP(x, 0, res[0]-1); CLAMP(y, 0, res[1]-1); @@ -57,7 +52,7 @@ float voxel_sample_nearest(float *data, int *res, float *co) } // returns highest integer <= x as integer (slightly faster than floor()) -inline int FLOORI(float x) +BM_INLINE int FLOORI(float x) { const int r = (int)x; return ((x >= 0.f) || (float)r == x) ? r : (r - 1); @@ -65,7 +60,7 @@ inline int FLOORI(float x) // clamp function, cannot use the CLAMPIS macro, it sometimes returns unwanted results apparently related to gcc optimization flag -fstrict-overflow which is enabled at -O2 // this causes the test (x + 2) < 0 with int x == 2147483647 to return false (x being an integer, x + 2 should wrap around to -2147483647 so the test < 0 should return true, which it doesn't) -inline int _clamp(int a, int b, int c) +BM_INLINE int _clamp(int a, int b, int c) { return (a < b) ? b : ((a > c) ? c : a); } |