[Mesa-dev] [PATCH 01/16] glsl: Add typed foreach_in_list/_reverse macros.

Ian Romanick idr at freedesktop.org
Mon Jun 30 11:36:14 PDT 2014


Patches 1 through 10, 12, 13, and 16 are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

Patches 14 and 15 are

Acked-by: Ian Romanick <ian.d.romanick at intel.com>

We're still discussing patch 11 on IRC. :)

On 06/25/2014 11:51 AM, Matt Turner wrote:
> ---
>  src/glsl/list.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/src/glsl/list.h b/src/glsl/list.h
> index 576bc14..914ce96 100644
> --- a/src/glsl/list.h
> +++ b/src/glsl/list.h
> @@ -573,6 +573,16 @@ inline void exec_node::insert_before(exec_list *before)
>  	; (__node)->next != NULL 			\
>  	; (__node) = (__node)->next)
>  
> +#define foreach_in_list(__type, __inst, __list)      \
> +   for (__type *(__inst) = (__type *)(__list)->head; \
> +        !(__inst)->is_tail_sentinel();               \
> +        (__inst) = (__type *)(__inst)->next)
> +
> +#define foreach_in_list_reverse(__type, __inst, __list) \
> +   for (__type *(__inst) = (__type *)(__list)->head;    \
> +        !(__inst)->is_head_sentinel();                  \
> +        (__inst) = (__type *)(__inst)->prev)
> +
>  /**
>   * Iterate through two lists at once.  Stops at the end of the shorter list.
>   *
> 



More information about the mesa-dev mailing list