[Mesa-dev] [PATCH] glsl/list: Add a foreach_list_typed_safe_reverse macro
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 7 21:40:59 PST 2014
On Fri, Nov 7, 2014 at 8:57 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
> FWIW, Ian commented on my patch to add foreach_list_typed_reverse that
> we shouldn't merge it until it had users so people wouldn't try to
> remove it -- it seems like this has the same issue. So either merge
> both of them at the same time, or neither until NIR gets merged...
>
Fair enough. This at least gets it on the list for review.
>
> Connor
>
>
> On Fri, Nov 7, 2014 at 9:32 PM, Jason Ekstrand <jason at jlekstrand.net>
> wrote:
> > ---
> > src/glsl/list.h | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> > diff --git a/src/glsl/list.h b/src/glsl/list.h
> > index 1d18ec9..1fb9178 100644
> > --- a/src/glsl/list.h
> > +++ b/src/glsl/list.h
> > @@ -673,4 +673,13 @@ inline void exec_node::insert_before(exec_list
> *before)
> > __node = __next, __next =
> \
> > exec_node_data(__type, (__next)->__field.next, __field))
> >
> > +#define foreach_list_typed_safe_reverse(__type, __node, __field,
> __list) \
> > + for (__type * __node =
> \
> > + exec_node_data(__type, (__list)->tail_pred, __field),
> \
> > + * __prev =
> \
> > + exec_node_data(__type, (__node)->__field.prev, __field);
> \
> > + __prev != NULL;
> \
> > + __node = __prev, __prev =
> \
> > + exec_node_data(__type, (__prev)->__field.prev, __field))
> > +
> > #endif /* LIST_CONTAINER_H */
> > --
> > 2.1.0
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141107/a2237146/attachment-0001.html>
More information about the mesa-dev
mailing list