From be8f42912a1f8d46c79c25ee75e1674ba2b27652 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 27 Mar 2008 14:25:39 -0700 Subject: [PATCH] Fix LIST_FOR_EACH_SAFE macro. The previous definition had a syntax error that prevented it from working. --- include/list.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 */ -- 2.30.2