From cfb7aee017d95137e19b7b006d9393b5d6a935d4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 7 Jul 2012 22:51:57 +0000 Subject: style cleanup --- source/blender/blenlib/intern/voxel.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib/intern/voxel.c') diff --git a/source/blender/blenlib/intern/voxel.c b/source/blender/blenlib/intern/voxel.c index 3a8705bbbba..bc775cb8f0c 100644 --- a/source/blender/blenlib/intern/voxel.c +++ b/source/blender/blenlib/intern/voxel.c @@ -56,15 +56,18 @@ float BLI_voxel_sample_nearest(float *data, const int res[3], const float co[3]) return D(data, res, xi, yi, zi); } -// returns highest integer <= x as integer (slightly faster than floor()) +/* returns highest integer <= x as integer (slightly faster than floor()) */ BLI_INLINE int FLOORI(float x) { const int r = (int)x; return ((x >= 0.f) || (float)r == x) ? r : (r - 1); } -// 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) +/* 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) */ BLI_INLINE int _clamp(int a, int b, int c) { return (a < b) ? b : ((a > c) ? c : a); -- cgit v1.2.3