diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-29 22:14:20 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-29 22:14:20 +0400 |
commit | 7217927414407f8929a02c610fb06e61c0bff930 (patch) | |
tree | e1b473aa26d01cdf9f0f7597c8ac255be56362de /source/blender/blenlib/intern/math_base_inline.c | |
parent | f608b3c44402ef5c58217481d93e7fa83c9cd7cf (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.c | 10 |
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; |