]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
WALK_LIST_DELSAFE now actually works (it really couldn't since it didn't
authorMartin Mares <mj@ucw.cz>
Sat, 17 Oct 1998 11:02:39 +0000 (11:02 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 17 Oct 1998 11:02:39 +0000 (11:02 +0000)
reference list head at all).

lib/lists.h

index 7fd697e5d39dc58e7888c027ff5b94dbc323a417..2d91ca55584f02326cc5c3f592a61aea21b7e1b1 100644 (file)
@@ -20,12 +20,10 @@ typedef struct list {                       /* In fact two overlayed nodes */
 #define NODE (node *)
 #define HEAD(list) ((void *)((list).head))
 #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))
-#define WALK_LIST_DELSAFE(n,ne,list) \
-    for( ne = (void *) (NODE n)->next; \
-         ne; \
-         ne = (void *) (NODE (n=ne))->next )
+#define WALK_LIST_DELSAFE(n,nxt,list) \
+     for(n=HEAD(list); nxt=(void *)((NODE (n))->next); n=(void *) nxt)
 
 #define EMPTY_LIST(list) (!(list).head->next)