diff options
author | Richard Braun <rbraun@sceen.net> | 2018-01-04 22:10:51 +0100 |
---|---|---|
committer | Richard Braun <rbraun@sceen.net> | 2018-01-04 22:10:51 +0100 |
commit | 0e0f906c5eecc2b23f4bb3b7f505be216c88a121 (patch) | |
tree | 0255e05647e316c8adc78b77324e6b4d73d2e149 /src | |
parent | 37d1642922fd49c267da1f408843f5d36035a78e (diff) |
Slightly change the list interfaces
This change breaks API compatibility.
Diffstat (limited to 'src')
-rw-r--r-- | src/hlist.h | 8 | ||||
-rw-r--r-- | src/list.h | 8 | ||||
-rw-r--r-- | src/plist.c | 4 | ||||
-rw-r--r-- | src/slist.h | 8 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/hlist.h b/src/hlist.h index dd32112..ec2fba1 100644 --- a/src/hlist.h +++ b/src/hlist.h @@ -170,7 +170,7 @@ hlist_insert_head(struct hlist *list, struct hlist_node *node) * Insert a node before another node. */ static inline void -hlist_insert_before(struct hlist_node *next, struct hlist_node *node) +hlist_insert_before(struct hlist_node *node, struct hlist_node *next) { node->next = next; node->pprev = next->pprev; @@ -182,7 +182,7 @@ hlist_insert_before(struct hlist_node *next, struct hlist_node *node) * Insert a node after another node. */ static inline void -hlist_insert_after(struct hlist_node *prev, struct hlist_node *node) +hlist_insert_after(struct hlist_node *node, struct hlist_node *prev) { node->next = prev->next; node->pprev = &prev->next; @@ -331,7 +331,7 @@ hlist_llsync_insert_head(struct hlist *list, struct hlist_node *node) * Insert a node before another node. */ static inline void -hlist_llsync_insert_before(struct hlist_node *next, struct hlist_node *node) +hlist_llsync_insert_before(struct hlist_node *node, struct hlist_node *next) { node->next = next; node->pprev = next->pprev; @@ -343,7 +343,7 @@ hlist_llsync_insert_before(struct hlist_node *next, struct hlist_node *node) * Insert a node after another node. */ static inline void -hlist_llsync_insert_after(struct hlist_node *prev, struct hlist_node *node) +hlist_llsync_insert_after(struct hlist_node *node, struct hlist_node *prev) { node->next = prev->next; node->pprev = &prev->next; @@ -269,7 +269,7 @@ list_insert_tail(struct list *list, struct list *node) * Insert a node before another node. */ static inline void -list_insert_before(struct list *next, struct list *node) +list_insert_before(struct list *node, struct list *next) { list_add(next->prev, next, node); } @@ -278,7 +278,7 @@ list_insert_before(struct list *next, struct list *node) * Insert a node after another node. */ static inline void -list_insert_after(struct list *prev, struct list *node) +list_insert_after(struct list *node, struct list *prev) { list_add(prev, prev->next, node); } @@ -463,7 +463,7 @@ list_llsync_insert_tail(struct list *list, struct list *node) * Insert a node before another node. */ static inline void -list_llsync_insert_before(struct list *next, struct list *node) +list_llsync_insert_before(struct list *node, struct list *next) { list_llsync_add(next->prev, next, node); } @@ -472,7 +472,7 @@ list_llsync_insert_before(struct list *next, struct list *node) * Insert a node after another node. */ static inline void -list_llsync_insert_after(struct list *prev, struct list *node) +list_llsync_insert_after(struct list *node, struct list *prev) { list_llsync_add(prev, prev->next, node); } diff --git a/src/plist.c b/src/plist.c index 80c0b27..c2c7f01 100644 --- a/src/plist.c +++ b/src/plist.c @@ -45,12 +45,12 @@ plist_add(struct plist *plist, struct plist_node *pnode) if (list_end(&plist->prio_list, &next->prio_node) || (pnode->priority != next->priority)) { - list_insert_before(&next->prio_node, &pnode->prio_node); + list_insert_before(&pnode->prio_node, &next->prio_node); } else { list_init(&pnode->prio_node); } - list_insert_before(&next->node, &pnode->node); + list_insert_before(&pnode->node, &next->node); } void diff --git a/src/slist.h b/src/slist.h index 42fc54b..5dbe537 100644 --- a/src/slist.h +++ b/src/slist.h @@ -189,8 +189,8 @@ slist_insert_tail(struct slist *list, struct slist_node *node) * The prev node must be valid. */ static inline void -slist_insert_after(struct slist *list, struct slist_node *prev, - struct slist_node *node) +slist_insert_after(struct slist *list, struct slist_node *node, + struct slist_node *prev) { node->next = prev->next; prev->next = node; @@ -378,8 +378,8 @@ slist_llsync_insert_tail(struct slist *list, struct slist_node *node) * The prev node must be valid. */ static inline void -slist_llsync_insert_after(struct slist *list, struct slist_node *prev, - struct slist_node *node) +slist_llsync_insert_after(struct slist *list, struct slist_node *node, + struct slist_node *prev) { node->next = prev->next; llsync_store_ptr(prev->next, node); |