diff options
-rw-r--r-- | source/blender/blenlib/BLI_math_base.h | 3 | ||||
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenlib/BLI_math_base.h b/source/blender/blenlib/BLI_math_base.h index e6a72298ae7..cb3dc960042 100644 --- a/source/blender/blenlib/BLI_math_base.h +++ b/source/blender/blenlib/BLI_math_base.h @@ -129,6 +129,9 @@ MINLINE int max_iii(int a, int b, int c); MINLINE int min_iiii(int a, int b, int c, int d); MINLINE int max_iiii(int a, int b, int c, int d); +MINLINE size_t min_zz(size_t a, size_t b); +MINLINE size_t max_zz(size_t a, size_t b); + MINLINE int compare_ff(float a, float b, const float max_diff); MINLINE int compare_ff_relative(float a, float b, const float max_diff, const int max_ulps); diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 749c18fc0ce..9202efce7b4 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -315,6 +315,15 @@ MINLINE int max_iiii(int a, int b, int c, int d) return max_ii(max_iii(a, b, c), d); } +MINLINE size_t min_zz(size_t a, size_t b) +{ + return (a < b) ? a : b; +} +MINLINE size_t max_zz(size_t a, size_t b) +{ + return (b < a) ? a : b; +} + /** * Almost-equal for IEEE floats, using absolute difference method. * |