diff options
author | Bastien Montagne <bastien@blender.org> | 2020-04-14 12:29:10 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-04-14 12:29:46 +0300 |
commit | 6e272b9ba429dc7f4fc7724f19254b1021a9559b (patch) | |
tree | 8395a317e3bb985af0bddd0347c6bc7550f1f307 /source/blender/blenlib/intern/math_base_inline.c | |
parent | 47084bac9f3c4c95b6fa3e3c3d5b1e661b2bec47 (diff) |
BLI_math: add min/max utils for chars.
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index c4b68e9164c..e0cac508d28 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -524,6 +524,15 @@ MINLINE size_t max_zz(size_t a, size_t b) return (b < a) ? a : b; } +MINLINE char min_cc(char a, char b) +{ + return (a < b) ? a : b; +} +MINLINE char max_cc(char a, char b) +{ + return (b < a) ? a : b; +} + MINLINE int clamp_i(int value, int min, int max) { return min_ii(max_ii(value, min), max); |