From: Ben Pfaff Date: Thu, 27 Mar 2008 21:25:39 +0000 (-0700) Subject: Fix LIST_FOR_EACH_SAFE macro. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be8f42912a1f8d46c79c25ee75e1674ba2b27652;p=openvswitch Fix LIST_FOR_EACH_SAFE macro. The previous definition had a syntax error that prevented it from working. --- diff --git a/include/list.h b/include/list.h index 6bf934bd..09b60989 100644 --- a/include/list.h +++ b/include/list.h @@ -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 */