diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 12:23:02 +0300 |
commit | a29686eeb3af051a00fbb8a8b9be06bcd050ec8c (patch) | |
tree | 9da60e7257e3e2dafda3e9b565b77c9c6f37675b /source/blender/blenlib/intern/bitmap_draw_2d.c | |
parent | e0c51b466f3b23a1fc114690be2b008e19637ea6 (diff) |
Cleanup: Blenlib, Clang-Tidy else-after-return fixes (incomplete)
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenlib` module. Not all warnings are
addressed in this commit.
No functional changes.
Diffstat (limited to 'source/blender/blenlib/intern/bitmap_draw_2d.c')
-rw-r--r-- | source/blender/blenlib/intern/bitmap_draw_2d.c | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/source/blender/blenlib/intern/bitmap_draw_2d.c b/source/blender/blenlib/intern/bitmap_draw_2d.c index 17debb38326..33250105c79 100644 --- a/source/blender/blenlib/intern/bitmap_draw_2d.c +++ b/source/blender/blenlib/intern/bitmap_draw_2d.c @@ -316,27 +316,25 @@ static int draw_poly_v2i_n__span_y_sort(const void *a_p, const void *b_p, void * if (co_a[1] < co_b[1]) { return -1; } - else if (co_a[1] > co_b[1]) { + if (co_a[1] > co_b[1]) { return 1; } - else if (co_a[0] < co_b[0]) { + if (co_a[0] < co_b[0]) { return -1; } - else if (co_a[0] > co_b[0]) { + if (co_a[0] > co_b[0]) { return 1; } - else { - /* co_a & co_b are identical, use the line closest to the x-min */ - const int *co = co_a; - co_a = verts[a[1]]; - co_b = verts[b[1]]; - int ord = (((co_b[0] - co[0]) * (co_a[1] - co[1])) - ((co_a[0] - co[0]) * (co_b[1] - co[1]))); - if (ord > 0) { - return -1; - } - if (ord < 0) { - return 1; - } + /* co_a & co_b are identical, use the line closest to the x-min */ + const int *co = co_a; + co_a = verts[a[1]]; + co_b = verts[b[1]]; + int ord = (((co_b[0] - co[0]) * (co_a[1] - co[1])) - ((co_a[0] - co[0]) * (co_b[1] - co[1]))); + if (ord > 0) { + return -1; + } + if (ord < 0) { + return 1; } return 0; } |