diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:17:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-17 07:21:24 +0300 |
commit | e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch) | |
tree | 8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/bmesh/intern/bmesh_query_inline.h | |
parent | b3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff) |
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/bmesh/intern/bmesh_query_inline.h')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query_inline.h | 105 |
1 files changed, 48 insertions, 57 deletions
diff --git a/source/blender/bmesh/intern/bmesh_query_inline.h b/source/blender/bmesh/intern/bmesh_query_inline.h index 582aa55b600..90919cc361b 100644 --- a/source/blender/bmesh/intern/bmesh_query_inline.h +++ b/source/blender/bmesh/intern/bmesh_query_inline.h @@ -18,7 +18,6 @@ * \ingroup bmesh */ - #ifndef __BMESH_QUERY_INLINE_H__ #define __BMESH_QUERY_INLINE_H__ @@ -26,56 +25,54 @@ * Returns whether or not a given vertex is * is part of a given edge. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE + bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) { - return (ELEM(v, e->v1, e->v2)); + return (ELEM(v, e->v1, e->v2)); } /** * Returns whether or not a given edge is part of a given loop. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) -BLI_INLINE bool BM_edge_in_loop(const BMEdge *e, const BMLoop *l) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE + bool BM_edge_in_loop(const BMEdge *e, const BMLoop *l) { - return (l->e == e || l->prev->e == e); + return (l->e == e || l->prev->e == e); } /** * Returns whether or not two vertices are in * a given edge */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3) -BLI_INLINE bool BM_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2, 3) BLI_INLINE + bool BM_verts_in_edge(const BMVert *v1, const BMVert *v2, const BMEdge *e) { - return ((e->v1 == v1 && e->v2 == v2) || - (e->v1 == v2 && e->v2 == v1)); + return ((e->v1 == v1 && e->v2 == v2) || (e->v1 == v2 && e->v2 == v1)); } /** * Given a edge and one of its vertices, returns * the other vertex. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) -BLI_INLINE BMVert *BM_edge_other_vert(BMEdge *e, const BMVert *v) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE BMVert *BM_edge_other_vert(BMEdge *e, + const BMVert *v) { - if (e->v1 == v) { - return e->v2; - } - else if (e->v2 == v) { - return e->v1; - } - return NULL; + if (e->v1 == v) { + return e->v2; + } + else if (e->v2 == v) { + return e->v1; + } + return NULL; } /** * Tests whether or not the edge is part of a wire. * (ie: has no faces attached to it) */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) { - return (e->l == NULL); + return (e->l == NULL); } /** @@ -84,17 +81,16 @@ BLI_INLINE bool BM_edge_is_wire(const BMEdge *e) */ #if 1 /* fast path for checking manifold */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) { - const BMLoop *l = e->l; - return (l && (l->radial_next != l) && /* not 0 or 1 face users */ - (l->radial_next->radial_next == l)); /* 2 face users */ + const BMLoop *l = e->l; + return (l && (l->radial_next != l) && /* not 0 or 1 face users */ + (l->radial_next->radial_next == l)); /* 2 face users */ } #else BLI_INLINE int BM_edge_is_manifold(BMEdge *e) { - return (BM_edge_face_count(e) == 2); + return (BM_edge_face_count(e) == 2); } #endif @@ -102,14 +98,13 @@ BLI_INLINE int BM_edge_is_manifold(BMEdge *e) * Tests that the edge is manifold and * that both its faces point the same way. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) { - const BMLoop *l = e->l; - const BMLoop *l_other; - return (l && ((l_other = l->radial_next) != l) && /* not 0 or 1 face users */ - (l_other->radial_next == l) && /* 2 face users */ - (l_other->v != l->v)); + const BMLoop *l = e->l; + const BMLoop *l_other; + return (l && ((l_other = l->radial_next) != l) && /* not 0 or 1 face users */ + (l_other->radial_next == l) && /* 2 face users */ + (l_other->v != l->v)); } /** @@ -118,48 +113,44 @@ BLI_INLINE bool BM_edge_is_contiguous(const BMEdge *e) */ #if 1 /* fast path for checking boundary */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) { - const BMLoop *l = e->l; - return (l && (l->radial_next == l)); + const BMLoop *l = e->l; + return (l && (l->radial_next == l)); } #else BLI_INLINE int BM_edge_is_boundary(BMEdge *e) { - return (BM_edge_face_count(e) == 1); + return (BM_edge_face_count(e) == 1); } #endif /** * Tests whether one loop is next to another within the same face. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) -BLI_INLINE bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2) BLI_INLINE + bool BM_loop_is_adjacent(const BMLoop *l_a, const BMLoop *l_b) { - BLI_assert(l_a->f == l_b->f); - BLI_assert(l_a != l_b); - return (ELEM(l_b, l_a->next, l_a->prev)); + BLI_assert(l_a->f == l_b->f); + BLI_assert(l_a != l_b); + return (ELEM(l_b, l_a->next, l_a->prev)); } -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_loop_is_manifold(const BMLoop *l) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_loop_is_manifold(const BMLoop *l) { - return ((l != l->radial_next) && - (l == l->radial_next->radial_next)); + return ((l != l->radial_next) && (l == l->radial_next->radial_next)); } /** * Check if we have a single wire edge user. */ -ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) -BLI_INLINE bool BM_vert_is_wire_endpoint(const BMVert *v) +ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) BLI_INLINE bool BM_vert_is_wire_endpoint(const BMVert *v) { - const BMEdge *e = v->e; - if (e && e->l == NULL) { - return (BM_DISK_EDGE_NEXT(e, v) == e); - } - return false; + const BMEdge *e = v->e; + if (e && e->l == NULL) { + return (BM_DISK_EDGE_NEXT(e, v) == e); + } + return false; } #endif /* __BMESH_QUERY_INLINE_H__ */ |