diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 16:21:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-05-31 16:22:52 +0300 |
commit | aba4e6810f8b4d0e459137b64e061a2cadc457d1 (patch) | |
tree | 2b6159c7ba0f23c020600b71276772fa4a882b5b /source/blender/blenlib/intern/math_base_inline.c | |
parent | 72a563cdee8fef198a200ff65b57ddb847c01795 (diff) |
Cleanup: style, use braces in source/ (include disabled blocks)
Diffstat (limited to 'source/blender/blenlib/intern/math_base_inline.c')
-rw-r--r-- | source/blender/blenlib/intern/math_base_inline.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/blenlib/intern/math_base_inline.c b/source/blender/blenlib/intern/math_base_inline.c index 221a27f69ed..8f30255a08b 100644 --- a/source/blender/blenlib/intern/math_base_inline.c +++ b/source/blender/blenlib/intern/math_base_inline.c @@ -230,23 +230,29 @@ MINLINE unsigned power_of_2_min_u(unsigned x) #define _round_clamp_fl_impl(arg, ty, min, max) \ { \ float r = floorf(arg + 0.5f); \ - if (UNLIKELY(r <= (float)min)) \ + if (UNLIKELY(r <= (float)min)) { \ return (ty)min; \ - else if (UNLIKELY(r >= (float)max)) \ + } \ + else if (UNLIKELY(r >= (float)max)) { \ return (ty)max; \ - else \ + } \ + else { \ return (ty)r; \ + } \ } #define _round_clamp_db_impl(arg, ty, min, max) \ { \ double r = floor(arg + 0.5); \ - if (UNLIKELY(r <= (double)min)) \ + if (UNLIKELY(r <= (double)min)) { \ return (ty)min; \ - else if (UNLIKELY(r >= (double)max)) \ + } \ + else if (UNLIKELY(r >= (double)max)) { \ return (ty)max; \ - else \ + } \ + else { \ return (ty)r; \ + } \ } #define _round_fl_impl(arg, ty) \ |