Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/avl.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-03-18 08:53:44 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-03-18 08:53:44 +0400
commitcdb9f71971062bfeaf4352621249f9d3d2408f1b (patch)
tree8e303d3b82c80bdea701bdaa1a5967b31b9d2018 /avl.h
parent7c11f6e91338eb73a1015606e55798d09369b2e8 (diff)
avl: fix type handling in container_of uses
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'avl.h')
-rw-r--r--avl.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/avl.h b/avl.h
index 46a396f..3a79e3a 100644
--- a/avl.h
+++ b/avl.h
@@ -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.