Merge branch 'develop' of lirent/libcdsb into master

This commit is contained in:
Gregory Lirent 2022-08-24 13:53:18 +03:00 committed by Gogs
commit 13fe620925
5 changed files with 16 additions and 16 deletions

View File

@ -21,10 +21,10 @@ extern void* libcdsb_builtin_rbtree_node_create(void* value, rbnode_t* paren
extern void libcdsb_builtin_rbtree_node_fixup (rbnode_t** root, rbnode_t* node) Nonnull__(1,2);
extern rbnode_t* libcdsb_builtin_rbtree_node_delete(rbnode_t** root, rbnode_t* node) Nonnull__(1,2);
extern stack_t libcdsb_builtin_rbtree_iter_inorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_preorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_postorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_inorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_preorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_postorder (rbnode_t** root, bool reverse);
extern stack_t libcdsb_builtin_rbtree_iter_breadth_first(rbnode_t** root, bool reverse);
#define rbnode_empty ((rbnode_t*)LIBCDSB_BUILTIN_RBTREE_NODE_EMPTY)
#define rbnode_create(v, p, c) ((rbnode_t*)libcdsb_builtin_rbtree_node_create(v, p, c, sizeof(rbnode_t)))
@ -34,9 +34,9 @@ extern stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool re
#define rbnode_is_empty(n) ((n) == rbnode_empty)
#define rbnode_is_root(n) rbnode_is_empty((n)->parent)
#define rbiter_inorder libcdsb_builtin_rbtree_iter_inorder
#define rbiter_preorder libcdsb_builtin_rbtree_iter_preorder
#define rbiter_postorder libcdsb_builtin_rbtree_iter_postorder
#define rbiter_breath_first libcdsb_builtin_rbtree_iter_breath_first
#define rbiter_inorder libcdsb_builtin_rbtree_iter_inorder
#define rbiter_preorder libcdsb_builtin_rbtree_iter_preorder
#define rbiter_postorder libcdsb_builtin_rbtree_iter_postorder
#define rbiter_breadth_first libcdsb_builtin_rbtree_iter_breadth_first
#endif /* LIBCDSB_SRC_INTERNAL_RBTREE_H */

View File

@ -89,7 +89,7 @@ int libcdsb_map_foreach(map_t* x, void* data, map_access_callback callback, rbfo
default:
case RBFOREACH_BREADTH_FIRST: if (reverse || flush) {
iter = miter_breath_first(&x->root, type&RBFOREACH_REVERSE);
iter = miter_breadth_first(&x->root, type&RBFOREACH_REVERSE);
break;
} else return libcdsb_builtin_foreach(x, data, callback);
}

View File

@ -35,9 +35,9 @@ static_assert(offsetof(struct libcdsb_set, type) == offsetof(struct l
#define mnode_is_empty(n) ((n) == mnode_empty)
#define mnode_is_root(n) mnode_is_empty((n)->parent)
#define miter_inorder(x, reverse) rbiter_inorder((void*)x, reverse)
#define miter_preorder(x, reverse) rbiter_preorder((void*)x, reverse)
#define miter_postorder(x, reverse) rbiter_postorder((void*)x, reverse)
#define miter_breath_first(x, reverse) rbiter_breath_first((void*)x, reverse)
#define miter_inorder(x, reverse) rbiter_inorder((void*)x, reverse)
#define miter_preorder(x, reverse) rbiter_preorder((void*)x, reverse)
#define miter_postorder(x, reverse) rbiter_postorder((void*)x, reverse)
#define miter_breadth_first(x, reverse) rbiter_breadth_first((void*)x, reverse)
#endif /* LIBCDSB_SRC_MAP_INCLUDE_H */

View File

@ -316,7 +316,7 @@ stack_t libcdsb_builtin_rbtree_iter_postorder(rbnode_t** root, bool reverse) {
}
stack_t libcdsb_builtin_rbtree_iter_breath_first(rbnode_t** root, bool reverse) {
stack_t libcdsb_builtin_rbtree_iter_breadth_first(rbnode_t** root, bool reverse) {
stack_t z, *top, *bot, *cur;
rbnode_t* n;

View File

@ -86,10 +86,10 @@ int libcdsb_vset_foreach(set_t* x, void* data, vset_access_callback callback, rb
case RBFOREACH_INORDER: iter = rbiter_inorder (&x->root, reverse); break;
case RBFOREACH_PREORDER: iter = rbiter_preorder (&x->root, reverse); break;
case RBFOREACH_POSTORDER: iter = rbiter_postorder(&x->root, reverse); break;
default:
case RBFOREACH_BREADTH_FIRST: if (reverse || flush) {
iter = rbiter_breath_first(&x->root, type&RBFOREACH_REVERSE);
iter = rbiter_breadth_first(&x->root, type&RBFOREACH_REVERSE);
break;
} else return libcdsb_builtin_foreach(x, data, callback);
}