mirror of
https://gitlab.nic.cz/labs/bird.git
synced 2024-11-17 16:48:43 +00:00
WALK_LIST_DELSAFE now actually works (it really couldn't since it didn't
reference list head at all).
This commit is contained in:
parent
c05ea56f8e
commit
d92882be9b
@ -20,12 +20,10 @@ typedef struct list { /* In fact two overlayed nodes */
|
|||||||
#define NODE (node *)
|
#define NODE (node *)
|
||||||
#define HEAD(list) ((void *)((list).head))
|
#define HEAD(list) ((void *)((list).head))
|
||||||
#define TAIL(list) ((void *)((list).tail))
|
#define TAIL(list) ((void *)((list).tail))
|
||||||
#define WALK_LIST(n,list) for((n)=HEAD(list);(NODE (n))->next; \
|
#define WALK_LIST(n,list) for(n=HEAD(list);(NODE (n))->next; \
|
||||||
n=(void *)((NODE (n))->next))
|
n=(void *)((NODE (n))->next))
|
||||||
#define WALK_LIST_DELSAFE(n,ne,list) \
|
#define WALK_LIST_DELSAFE(n,nxt,list) \
|
||||||
for( ne = (void *) (NODE n)->next; \
|
for(n=HEAD(list); nxt=(void *)((NODE (n))->next); n=(void *) nxt)
|
||||||
ne; \
|
|
||||||
ne = (void *) (NODE (n=ne))->next )
|
|
||||||
|
|
||||||
#define EMPTY_LIST(list) (!(list).head->next)
|
#define EMPTY_LIST(list) (!(list).head->next)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user