[Mesa-dev] [PATCH] glsl/list: Add a foreach_list_typed_safe_reverse macro
Connor Abbott
cwabbott0 at gmail.com
Fri Nov 7 20:57:43 PST 2014
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...
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
More information about the mesa-dev
mailing list