glsl: Convert piles of foreach_iter to foreach_list_safe.

In these cases, we edit the list (or at least might be), so we use the
foreach_list_safe variant.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Kenneth Graunke
2013-11-22 02:10:15 -08:00
parent 5f7e778fa1
commit 838a6871bb
12 changed files with 36 additions and 36 deletions
+4 -4
View File
@@ -315,8 +315,8 @@ do_structure_splitting(exec_list *instructions)
visit_list_elements(&refs, instructions);
/* Trim out variables we can't split. */
foreach_iter(exec_list_iterator, iter, refs.variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list_safe(n, &refs.variable_list) {
variable_entry *entry = (variable_entry *) n;
if (debug) {
printf("structure %s@%p: decl %d, whole_access %d\n",
@@ -337,8 +337,8 @@ do_structure_splitting(exec_list *instructions)
/* Replace the decls of the structures to be split with their split
* components.
*/
foreach_iter(exec_list_iterator, iter, refs.variable_list) {
variable_entry *entry = (variable_entry *)iter.get();
foreach_list_safe(n, &refs.variable_list) {
variable_entry *entry = (variable_entry *) n;
const struct glsl_type *type = entry->var->type;
entry->mem_ctx = ralloc_parent(entry->var);