diff options
author | Connor Abbott <[email protected]> | 2014-07-21 17:11:53 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-01-15 07:18:57 -0800 |
commit | ab2ae6385410c7cca3cdbda300b0e72f38a5d8e3 (patch) | |
tree | d06655671549f3e5abeb96a589cd523e5b7ec282 /src/glsl/list.h | |
parent | 84ef2d4156da1ce85ec7e825982541ce499f351e (diff) |
exec_list: add a list_foreach_typed_reverse() macro
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/glsl/list.h')
-rw-r--r-- | src/glsl/list.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/list.h b/src/glsl/list.h index 995c666ea5c..924c7296fa7 100644 --- a/src/glsl/list.h +++ b/src/glsl/list.h @@ -665,6 +665,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), \ |