diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 13:30:43 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2020-08-07 14:38:06 +0300 |
commit | 1b272a649b40e99dba4185167f6cee7cbece1942 (patch) | |
tree | 2785f52c566b36cbdcbf9355f698dc520ffbb482 /source/blender/blenkernel/intern/gpencil_geom.c | |
parent | cfc6f9eb18e701f5be601b95c45004e8cf7fbc81 (diff) |
Cleanup: Blenkernel, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/blenkernel` module.
No functional changes.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_geom.c')
-rw-r--r-- | source/blender/blenkernel/intern/gpencil_geom.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c index 14eb6bb4f4c..672d65f1585 100644 --- a/source/blender/blenkernel/intern/gpencil_geom.c +++ b/source/blender/blenkernel/intern/gpencil_geom.c @@ -245,24 +245,23 @@ static int stroke_march_next_point(const bGPDstroke *gps, return 0; } - else { - float ratio = remaining_march / remaining_till_next; - interp_v3_v3v3(result, step_start, point, ratio); - *pressure = interpf( - gps->points[next_point_index].pressure, gps->points[next_point_index - 1].pressure, ratio); - *strength = interpf( - gps->points[next_point_index].strength, gps->points[next_point_index - 1].strength, ratio); - interp_v4_v4v4(vert_color, - gps->points[next_point_index - 1].vert_color, - gps->points[next_point_index].vert_color, - ratio); - - *index_from = next_point_index - 1; - *index_to = next_point_index; - *ratio_result = ratio; - return next_point_index; - } + float ratio = remaining_march / remaining_till_next; + interp_v3_v3v3(result, step_start, point, ratio); + *pressure = interpf( + gps->points[next_point_index].pressure, gps->points[next_point_index - 1].pressure, ratio); + *strength = interpf( + gps->points[next_point_index].strength, gps->points[next_point_index - 1].strength, ratio); + interp_v4_v4v4(vert_color, + gps->points[next_point_index - 1].vert_color, + gps->points[next_point_index].vert_color, + ratio); + + *index_from = next_point_index - 1; + *index_to = next_point_index; + *ratio_result = ratio; + + return next_point_index; } static int stroke_march_next_point_no_interp(const bGPDstroke *gps, @@ -306,11 +305,10 @@ static int stroke_march_next_point_no_interp(const bGPDstroke *gps, copy_v3_v3(result, &pt->x); return 0; } - else { - float ratio = remaining_march / remaining_till_next; - interp_v3_v3v3(result, step_start, point, ratio); - return next_point_index; - } + + float ratio = remaining_march / remaining_till_next; + interp_v3_v3v3(result, step_start, point, ratio); + return next_point_index; } static int stroke_march_count(const bGPDstroke *gps, const float dist) @@ -1352,10 +1350,9 @@ bool BKE_gpencil_stroke_trim(bGPDstroke *gps) if ((lambda <= 0.0f) || (lambda >= 1.0f)) { continue; } - else { - intersect = true; - break; - } + + intersect = true; + break; } } } |