X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=blobdiff_plain;f=avl.h;h=2591de342e4b8c32c540bc52ca84ee4b597272b2;hp=46a396f2d6d55191d9e3117f563726c0d4ac8a23;hb=bbdfee8182c5c8d3704f343c6402bd68dd05071e;hpb=3041e8ce9b128480317b91eb97fe64914d975a59 diff --git a/avl.h b/avl.h index 46a396f..2591de3 100644 --- a/avl.h +++ b/avl.h @@ -62,7 +62,7 @@ struct avl_node { * this must be the first element of an avl_node to * make casting for lists easier */ - struct list_entity list; + struct list_head list; /** * Pointer to parent node in tree, NULL if root node @@ -113,7 +113,7 @@ struct avl_tree { * Head of linked list node for supporting easy iteration * and multiple elments with the same key. */ - struct list_entity list_head; + struct list_head list_head; /** * pointer to the root node of the avl tree, NULL if tree is empty @@ -267,7 +267,7 @@ __avl_find_element(const struct avl_tree *tree, const void *key, size_t offset, * (automatically converted to type 'element') */ #define avl_first_element(tree, element, node_member) \ - container_of((tree)->list_head.next, typeof(*(element)), node_member) + container_of((tree)->list_head.next, typeof(*(element)), node_member.list) /** * @param tree pointer to tree @@ -279,7 +279,7 @@ __avl_find_element(const struct avl_tree *tree, const void *key, size_t offset, * (automatically converted to type 'element') */ #define avl_last_element(tree, element, node_member) \ - container_of((tree)->list_head.prev, typeof(*(element)), node_member) + container_of((tree)->list_head.prev, typeof(*(element)), node_member.list) /** * This function must not be called for the last element of @@ -292,7 +292,7 @@ __avl_find_element(const struct avl_tree *tree, const void *key, size_t offset, * (automatically converted to type 'element') */ #define avl_next_element(element, node_member) \ - container_of((&(element)->node_member.list)->next, typeof(*(element)), node_member) + container_of((&(element)->node_member.list)->next, typeof(*(element)), node_member.list) /** * This function must not be called for the first element of @@ -305,7 +305,7 @@ __avl_find_element(const struct avl_tree *tree, const void *key, size_t offset, * (automatically converted to type 'element') */ #define avl_prev_element(element, node_member) \ - container_of((&(element)->node_member.list)->prev, typeof(*(element)), node_member) + container_of((&(element)->node_member.list)->prev, typeof(*(element)), node_member.list) /** * Loop over a block of elements of a tree, used similar to a for() command.