diff options
author | Robert Bragg <[email protected]> | 2017-02-23 14:45:10 +0000 |
---|---|---|
committer | Robert Bragg <[email protected]> | 2017-03-09 13:45:50 +0000 |
commit | a98ffe24772e041687ae1e5706951a7d630ee35b (patch) | |
tree | ca128c2ae284d4e1184944e23bb4f4f2b2d4664a /src | |
parent | e56550565e868e4b5de2112e4bc2fa8650a51309 (diff) |
exec_list: Add a foreach_list_typed_from macro
This allows iterating list nodes from a given start point instead of
necessarily the list head.
Signed-off-by: Robert Bragg <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Acked-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/list.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/compiler/glsl/list.h b/src/compiler/glsl/list.h index 6afb9dcef94..47f53b865b3 100644 --- a/src/compiler/glsl/list.h +++ b/src/compiler/glsl/list.h @@ -699,6 +699,11 @@ 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_from(__type, __node, __field, __list, __start) \ + for (__type * __node = exec_node_data(__type, (__start), __field); \ + (__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_sentinel.prev, __field); \ |