Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-07-08 02:51:57 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-08 02:51:57 +0400
commitcfb7aee017d95137e19b7b006d9393b5d6a935d4 (patch)
tree005a1981af6c5a0f36959d73479cc69137842eb4 /source/blender/blenlib/intern/voxel.c
parentd58ce290e1e4dcb8d0b96259fdf29c854bfaef49 (diff)
style cleanup
Diffstat (limited to 'source/blender/blenlib/intern/voxel.c')
-rw-r--r--source/blender/blenlib/intern/voxel.c9
1 files changed, 6 insertions, 3 deletions
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);