Re: [Mesa-dev] [PATCH 08/13] util/list: Add C99-based iterator macros

2015-05-05 Thread Jason Ekstrand
On Tue, May 5, 2015 at 11:13 AM, Neil Roberts wrote: > Jason Ekstrand writes: > >> +#define list_for_each_entry(type, pos, head, member)\ >> + for (type *pos = container_of((head)->next, pos, member);\ >> + &pos->member != (head);

Re: [Mesa-dev] [PATCH 08/13] util/list: Add C99-based iterator macros

2015-05-05 Thread Neil Roberts
Jason Ekstrand writes: > +#define list_for_each_entry(type, pos, head, member)\ > + for (type *pos = container_of((head)->next, pos, member);\ > + &pos->member != (head); \ > + pos = container_of(pos->member.next, p

[Mesa-dev] [PATCH 08/13] util/list: Add C99-based iterator macros

2015-04-27 Thread Jason Ekstrand
--- src/util/list.h | 33 + 1 file changed, 33 insertions(+) diff --git a/src/util/list.h b/src/util/list.h index 9dcf671..6144b0c 100644 --- a/src/util/list.h +++ b/src/util/list.h @@ -141,6 +141,39 @@ static inline void list_delinit(struct list_head *item) #defi