summaryrefslogtreecommitdiff
path: root/lib/slists.h
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2015-02-21 11:39:45 +0100
commit7730553b7eeb33d21e5597f110334ca584ad532d (patch)
treec80bf6d48fc91bafd7f0aefc859a033d3b472c89 /lib/slists.h
parent0da562a7cb25ed2b8724248ad6f841b1831a09c3 (diff)
parentec2194fa7a20a2768ca0027b5f3c024f0a251866 (diff)
Merge remote-tracking branch 'origin/soft-int'
Diffstat (limited to 'lib/slists.h')
-rw-r--r--lib/slists.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/slists.h b/lib/slists.h
index 2334e36a..d98d02d2 100644
--- a/lib/slists.h
+++ b/lib/slists.h
@@ -68,10 +68,12 @@ typedef struct siterator {
#define SNODE (snode *)
#define SHEAD(list) ((void *)((list).head))
#define STAIL(list) ((void *)((list).tail))
-#define WALK_SLIST(n,list) for(n=SHEAD(list);(SNODE (n))->next; \
- n=(void *)((SNODE (n))->next))
+#define SNODE_NEXT(n) ((void *)((SNODE (n))->next))
+#define SNODE_VALID(n) ((SNODE (n))->next)
+
+#define WALK_SLIST(n,list) for(n=SHEAD(list); SNODE_VALID(n); n=SNODE_NEXT(n))
#define WALK_SLIST_DELSAFE(n,nxt,list) \
- for(n=SHEAD(list); nxt=(void *)((SNODE (n))->next); n=(void *) nxt)
+ for(n=SHEAD(list); nxt=SNODE_NEXT(n); n=(void *) nxt)
#define EMPTY_SLIST(list) (!(list).head->next)
void s_add_tail(slist *, snode *);