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-29 22:14:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-07-29 22:14:20 +0400
commit7217927414407f8929a02c610fb06e61c0bff930 (patch)
treee1b473aa26d01cdf9f0f7597c8ac255be56362de /source/blender/blenlib/intern/math_base_inline.c
parentf608b3c44402ef5c58217481d93e7fa83c9cd7cf (diff)
add inline functions for max/min ints, good to use when the arguments are function calls (we had a few of these).
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r--source/blender/blenlib/intern/math_base_inline.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c
index b2d5392c596..97fc431d8fa 100644
--- a/source/blender/blenlib/intern/math_base_inline.c
+++ b/source/blender/blenlib/intern/math_base_inline.c
@@ -143,12 +143,20 @@ MINLINE float minf(float a, float b)
{
return (a < b) ? a : b;
}
-
MINLINE float maxf(float a, float b)
{
return (a > b) ? a : b;
}
+MINLINE int mini(int a, int b)
+{
+ return (a < b) ? a : b;
+}
+MINLINE int maxi(int a, int b)
+{
+ return (b < a) ? a : b;
+}
+
MINLINE float signf(float f)
{
return (f < 0.f) ? -1.f : 1.f;