From 9ba948a4859da3308033fa6dc54f74433d7e6a21 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 27 Mar 2019 13:16:10 +1100 Subject: Cleanup: style, use braces for blenlib --- source/blender/blenlib/intern/convexhull_2d.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/blenlib/intern/convexhull_2d.c') diff --git a/source/blender/blenlib/intern/convexhull_2d.c b/source/blender/blenlib/intern/convexhull_2d.c index a59d44037f1..87471ea65a5 100644 --- a/source/blender/blenlib/intern/convexhull_2d.c +++ b/source/blender/blenlib/intern/convexhull_2d.c @@ -83,8 +83,10 @@ int BLI_convexhull_2d_sorted(const float (*points)[2], const int n, int r_points minmax = i - 1; if (minmax == n - 1) { /* degenerate case: all x-coords == xmin */ r_points[++top] = minmin; - if (points[minmax][1] != points[minmin][1]) /* a nontrivial segment */ + if (points[minmax][1] != points[minmin][1]) { + /* a nontrivial segment */ r_points[++top] = minmax; + } r_points[++top] = minmin; /* add polygon endpoint */ return top + 1; } @@ -168,13 +170,13 @@ static int pointref_cmp_yx(const void *a_, const void *b_) const struct PointRef *a = a_; const struct PointRef *b = b_; - if (a->pt[1] > b->pt[1]) return 1; - else if (a->pt[1] < b->pt[1]) return -1; + if (a->pt[1] > b->pt[1]) { return 1; } + else if (a->pt[1] < b->pt[1]) { return -1; } - if (a->pt[0] > b->pt[0]) return 1; - else if (a->pt[0] < b->pt[0]) return -1; + if (a->pt[0] > b->pt[0]) { return 1; } + else if (a->pt[0] < b->pt[0]) { return -1; } - else return 0; + else { return 0; } } /** -- cgit v1.2.3