Fix LIST_FOR_EACH_SAFE macro.
authorBen Pfaff <blp@nicira.com>
Thu, 27 Mar 2008 21:25:39 +0000 (14:25 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 28 Mar 2008 00:50:33 +0000 (17:50 -0700)
The previous definition had a syntax error that prevented it from
working.

include/list.h

index 6bf934bd12d80ed515ee797aeeb310ec7f970513..09b609898fd94416fc5a272eb2cf27dd23a2fdaa 100644 (file)
@@ -43,11 +43,12 @@ bool list_is_empty(const struct list *);
     for (ITER = LIST_ELEM__((LIST)->next, STRUCT, MEMBER, LIST);    \
          ITER != NULL;                                              \
          ITER = LIST_ELEM__((ITER)->MEMBER.next, STRUCT, MEMBER, LIST))
-#define LIST_FOR_EACH_SAFE(ITER, NEXT, STRUCT, MEMBER, LIST)            \
-    for (ITER = LIST_ELEM__((LIST)->next, STRUCT, MEMBER, LIST);        \
-         (ITER != NULL                                                  \
-          ? (NEXT = LIST_ELEM__((ITER)->MEMBER.next, STRUCT, MEMBER, LIST), 1) \
-          : 0),                                                         \
+#define LIST_FOR_EACH_SAFE(ITER, NEXT, STRUCT, MEMBER, LIST)        \
+    for (ITER = LIST_ELEM__((LIST)->next, STRUCT, MEMBER, LIST);    \
+         (ITER != NULL                                              \
+          ? (NEXT = LIST_ELEM__((ITER)->MEMBER.next,                \
+                                STRUCT, MEMBER, LIST), 1)           \
+          : 0);                                                     \
          ITER = NEXT)
 
 #endif /* list.h */