diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:16:10 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-27 05:17:30 +0300 |
commit | 9ba948a4859da3308033fa6dc54f74433d7e6a21 (patch) | |
tree | 0bd6e95eb59d9af03aa32d925c68e1cbebecc246 /source/blender/blenlib/intern/boxpack_2d.c | |
parent | 337eb8c1de4c57c34520b467d79779153335eecb (diff) |
Cleanup: style, use braces for blenlib
Diffstat (limited to 'source/blender/blenlib/intern/boxpack_2d.c')
-rw-r--r-- | source/blender/blenlib/intern/boxpack_2d.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c index 357fa57b144..c90038b78a1 100644 --- a/source/blender/blenlib/intern/boxpack_2d.c +++ b/source/blender/blenlib/intern/boxpack_2d.c @@ -214,8 +214,8 @@ static int box_areasort(const void *p1, const void *p2) const float a1 = box_area(b1); const float a2 = box_area(b2); - if (a1 < a2) return 1; - else if (a1 > a2) return -1; + if (a1 < a2) { return 1; } + else if (a1 > a2) { return -1; } return 0; } @@ -240,9 +240,9 @@ static int vertex_sort(const void *p1, const void *p2, void *vs_ctx_p) #ifdef USE_FREE_STRIP /* push free verts to the end so we can strip */ - if (UNLIKELY(v1->free == 0 && v2->free == 0)) return 0; - else if (UNLIKELY(v1->free == 0)) return 1; - else if (UNLIKELY(v2->free == 0)) return -1; + if (UNLIKELY(v1->free == 0 && v2->free == 0)) { return 0; } + else if (UNLIKELY(v1->free == 0)) { return 1; } + else if (UNLIKELY(v2->free == 0)) { return -1; } #endif a1 = max_ff(v1->x + vs_ctx->box_width, v1->y + vs_ctx->box_height); @@ -254,8 +254,8 @@ static int vertex_sort(const void *p1, const void *p2, void *vs_ctx_p) #endif /* sort largest to smallest */ - if (a1 > a2) return 1; - else if (a1 < a2) return -1; + if (a1 > a2) { return 1; } + else if (a1 < a2) { return -1; } return 0; } /** \} */ @@ -365,8 +365,9 @@ void BLI_box_pack_2d(BoxPack *boxarray, const uint len, float *r_tot_x, float *r #endif } - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { vertex_pack_indices[i] = box->v[i + 1]->index; + } verts_pack_len = 3; box++; /* next box, needed for the loop below */ /* ...done packing the first box */ |