[Mesa-dev] [PATCH] exec_list: add a list_foreach_typed_reverse() macro
Ian Romanick
idr at freedesktop.org
Thu Aug 7 16:20:58 PDT 2014
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
But you should wait to push it until you push a patch that uses it...
otherwise some may send a patch to remove the unused macro. :)
On 07/30/2014 03:52 PM, Connor Abbott wrote:
> Signed-off-by: Connor Abbott <connor.abbott at intel.com>
> ---
> src/glsl/list.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/src/glsl/list.h b/src/glsl/list.h
> index 3ee6cda..c402f48 100644
> --- a/src/glsl/list.h
> +++ b/src/glsl/list.h
> @@ -644,6 +644,12 @@ inline void exec_node::insert_before(exec_list *before)
> (__node)->__field.next != NULL; \
> (__node) = exec_node_data(__type, (__node)->__field.next, __field))
>
> +#define foreach_list_typed_reverse(__type, __node, __field, __list) \
> + for (__type * __node = \
> + exec_node_data(__type, (__list)->tail_pred, __field); \
> + (__node)->__field.prev != NULL; \
> + (__node) = exec_node_data(__type, (__node)->__field.prev, __field))
> +
> #define foreach_list_typed_safe(__type, __node, __field, __list) \
> for (__type * __node = \
> exec_node_data(__type, (__list)->head, __field), \
>
More information about the mesa-dev
mailing list