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/blenlib/BLI_dlrbTree.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/blenlib/BLI_dlrbTree.h')
-rw-r--r-- | source/blender/blenlib/BLI_dlrbTree.h | 51 |
1 files changed, 28 insertions, 23 deletions
diff --git a/source/blender/blenlib/BLI_dlrbTree.h b/source/blender/blenlib/BLI_dlrbTree.h index c310eb0d2dc..222cdea10cc 100644 --- a/source/blender/blenlib/BLI_dlrbTree.h +++ b/source/blender/blenlib/BLI_dlrbTree.h @@ -38,32 +38,32 @@ /* Basic Layout for a Node */ typedef struct DLRBT_Node { - /* ListBase capabilities */ - struct DLRBT_Node *next, *prev; + /* ListBase capabilities */ + struct DLRBT_Node *next, *prev; - /* Tree Associativity settings */ - struct DLRBT_Node *left, *right; - struct DLRBT_Node *parent; + /* Tree Associativity settings */ + struct DLRBT_Node *left, *right; + struct DLRBT_Node *parent; - char tree_col; - /* ... for nice alignment, next item should usually be a char too... */ + char tree_col; + /* ... for nice alignment, next item should usually be a char too... */ } DLRBT_Node; /* Red/Black defines for tree_col */ typedef enum eDLRBT_Colors { - DLRBT_BLACK = 0, - DLRBT_RED, + DLRBT_BLACK = 0, + DLRBT_RED, } eDLRBT_Colors; /* -------- */ /* The Tree Data */ typedef struct DLRBT_Tree { - /* ListBase capabilities */ - void *first, *last; /* these should be based on DLRBT_Node-s */ + /* ListBase capabilities */ + void *first, *last; /* these should be based on DLRBT_Node-s */ - /* Root Node */ - void *root; /* this should be based on DLRBT_Node-s */ + /* Root Node */ + void *root; /* this should be based on DLRBT_Node-s */ } DLRBT_Tree; /* Callback Types --------------------------------- */ @@ -102,26 +102,29 @@ void BLI_dlrbTree_free(DLRBT_Tree *tree); /* Make sure the tree's Double-Linked list representation is valid */ void BLI_dlrbTree_linkedlist_sync(DLRBT_Tree *tree); - /* Searching ------------------------------------ */ /* Find the node which matches or is the closest to the requested node */ DLRBT_Node *BLI_dlrbTree_search(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data); /* Find the node which exactly matches the required data */ -DLRBT_Node *BLI_dlrbTree_search_exact(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data); +DLRBT_Node *BLI_dlrbTree_search_exact(DLRBT_Tree *tree, + DLRBT_Comparator_FP cmp_cb, + void *search_data); /* Find the node which occurs immediately before the best matching node */ -DLRBT_Node *BLI_dlrbTree_search_prev(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data); +DLRBT_Node *BLI_dlrbTree_search_prev(DLRBT_Tree *tree, + DLRBT_Comparator_FP cmp_cb, + void *search_data); /* Find the node which occurs immediately after the best matching node */ -DLRBT_Node *BLI_dlrbTree_search_next(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data); - +DLRBT_Node *BLI_dlrbTree_search_next(DLRBT_Tree *tree, + DLRBT_Comparator_FP cmp_cb, + void *search_data); /* Check whether there is a node matching the requested node */ short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void *search_data); - /* Node Operations (Managed) --------------------- */ /* These methods automate the process of adding/removing nodes from the BST, * using the supplied data and callbacks @@ -129,9 +132,11 @@ short BLI_dlrbTree_contains(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, void * /* Add the given data to the tree, and return the node added */ // NOTE: for duplicates, the update_cb is called (if available), and the existing node is returned -DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, DLRBT_Comparator_FP cmp_cb, - DLRBT_NAlloc_FP new_cb, DLRBT_NUpdate_FP update_cb, void *data); - +DLRBT_Node *BLI_dlrbTree_add(DLRBT_Tree *tree, + DLRBT_Comparator_FP cmp_cb, + DLRBT_NAlloc_FP new_cb, + DLRBT_NUpdate_FP update_cb, + void *data); /* Remove the given element from the tree and balance again */ // FIXME: this is not implemented yet... @@ -151,4 +156,4 @@ void BLI_dlrbTree_insert(DLRBT_Tree *tree, DLRBT_Node *node); /* ********************************************** */ -#endif /* __BLI_DLRBTREE_H__ */ +#endif /* __BLI_DLRBTREE_H__ */ |