From e5fb267af59e9beea66c88e32d9809824c062886 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 1 Jun 2010 19:57:47 +0100 Subject: [PATCH] Make FOR_LIST_NODE and use it for FOR_CONN --- innduct.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/innduct.h b/innduct.h index ddd17e6..273fb5e 100644 --- a/innduct.h +++ b/innduct.h @@ -84,8 +84,10 @@ #define DUMPV(fmt,pfx,v) fprintf(f, " " #v "=" fmt, pfx v); -#define FOR_CONN(conn) \ - for ((conn)=LIST_HEAD(conns); (conn); (conn)=LIST_NEXT((conn))) +#define FOR_LIST_NODE(nodevar, list) \ + for ((nodevar)=LIST_HEAD(list); (nodevar); (nodevar)=LIST_NEXT((nodevar))) + +#define FOR_CONN(conn) FOR_LIST_NODE(conn, conns) /*----- doubly linked lists -----*/ -- 2.30.2