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.
This commit is contained in:
2020-08-07 11:23:02 +02:00
parent e0c51b466f
commit a29686eeb3
59 changed files with 1079 additions and 1350 deletions

View File

@@ -64,14 +64,14 @@ static int oedge_cmp(const void *a1, const void *a2)
if (x1->verts[0] > x2->verts[0]) {
return 1;
}
else if (x1->verts[0] < x2->verts[0]) {
if (x1->verts[0] < x2->verts[0]) {
return -1;
}
if (x1->verts[1] > x2->verts[1]) {
return 1;
}
else if (x1->verts[1] < x2->verts[1]) {
if (x1->verts[1] < x2->verts[1]) {
return -1;
}
@@ -79,7 +79,7 @@ static int oedge_cmp(const void *a1, const void *a2)
if (x1->e_half > x2->e_half) {
return 1;
}
else if (x1->e_half < x2->e_half) {
if (x1->e_half < x2->e_half) {
return -1;
}
/* Should never get here, no two edges should be the same. */
@@ -141,7 +141,7 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2],
if ((area_2x_123 >= 0.0f) != (area_2x_134 >= 0.0f)) {
break;
}
else if ((fabsf(area_2x_123) <= eps_zero_area) || (fabsf(area_2x_134) <= eps_zero_area)) {
if ((fabsf(area_2x_123) <= eps_zero_area) || (fabsf(area_2x_134) <= eps_zero_area)) {
break;
}
@@ -150,11 +150,10 @@ float BLI_polyfill_beautify_quad_rotate_calc_ex(const float v1[2],
if (lock_degenerate) {
break;
}
else {
return -FLT_MAX; /* always rotate */
}
return -FLT_MAX; /* always rotate */
}
else if ((fabsf(area_2x_234) <= eps_zero_area) || (fabsf(area_2x_241) <= eps_zero_area)) {
if ((fabsf(area_2x_234) <= eps_zero_area) || (fabsf(area_2x_241) <= eps_zero_area)) {
return -FLT_MAX; /* always rotate */
}