summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_reader.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-11-22 01:25:42 -0800
committerKenneth Graunke <[email protected]>2014-01-13 11:38:19 -0800
commit5f7e778fa1b1e969a1b15e3650dec49b0026ed08 (patch)
tree40bd6e3e5175ccd2ca49a783b7680ee2c947b775 /src/glsl/ir_reader.cpp
parentfb6d9798a0c6eefd512f5b0f19eed34af8f4f257 (diff)
glsl: Convert piles of foreach_iter to the newer foreach_list macro.
foreach_iter and exec_list_iterators have been deprecated for some time now; we just hadn't ever bothered to convert code to the newer foreach_list and foreach_list_safe macros. In these cases, we aren't editing the list, so we can use foreach_list rather than foreach_list_safe. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r--src/glsl/ir_reader.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp
index 7970112ec51..f5185d28484 100644
--- a/src/glsl/ir_reader.cpp
+++ b/src/glsl/ir_reader.cpp
@@ -170,8 +170,8 @@ ir_reader::scan_for_prototypes(exec_list *instructions, s_expression *expr)
return;
}
- foreach_iter(exec_list_iterator, it, list->subexpressions) {
- s_list *sub = SX_AS_LIST(it.get());
+ foreach_list(n, &list->subexpressions) {
+ s_list *sub = SX_AS_LIST(n);
if (sub == NULL)
continue; // not a (function ...); ignore it.
@@ -315,8 +315,8 @@ ir_reader::read_instructions(exec_list *instructions, s_expression *expr,
return;
}
- foreach_iter(exec_list_iterator, it, list->subexpressions) {
- s_expression *sub = (s_expression*) it.get();
+ foreach_list(n, &list->subexpressions) {
+ s_expression *sub = (s_expression *) n;
ir_instruction *ir = read_instruction(sub, loop_ctx);
if (ir != NULL) {
/* Global variable declarations should be moved to the top, before
@@ -403,8 +403,8 @@ ir_reader::read_declaration(s_expression *expr)
ir_variable *var = new(mem_ctx) ir_variable(type, s_name->value(),
ir_var_auto);
- foreach_iter(exec_list_iterator, it, s_quals->subexpressions) {
- s_symbol *qualifier = SX_AS_SYMBOL(it.get());
+ foreach_list(n, &s_quals->subexpressions) {
+ s_symbol *qualifier = SX_AS_SYMBOL(n);
if (qualifier == NULL) {
ir_read_error(expr, "qualifier list must contain only symbols");
return NULL;
@@ -656,8 +656,8 @@ ir_reader::read_call(s_expression *expr)
exec_list parameters;
- foreach_iter(exec_list_iterator, it, params->subexpressions) {
- s_expression *expr = (s_expression*) it.get();
+ foreach_list(n, &params->subexpressions) {
+ s_expression *expr = (s_expression *) n;
ir_rvalue *param = read_rvalue(expr);
if (param == NULL) {
ir_read_error(expr, "when reading parameter to function call");
@@ -796,8 +796,8 @@ ir_reader::read_constant(s_expression *expr)
if (type->is_array()) {
unsigned elements_supplied = 0;
exec_list elements;
- foreach_iter(exec_list_iterator, it, values->subexpressions) {
- s_expression *elt = (s_expression *) it.get();
+ foreach_list(n, &values->subexpressions) {
+ s_expression *elt = (s_expression *) n;
ir_constant *ir_elt = read_constant(elt);
if (ir_elt == NULL)
return NULL;
@@ -817,13 +817,13 @@ ir_reader::read_constant(s_expression *expr)
// Read in list of values (at most 16).
unsigned k = 0;
- foreach_iter(exec_list_iterator, it, values->subexpressions) {
+ foreach_list(n, &values->subexpressions) {
if (k >= 16) {
ir_read_error(values, "expected at most 16 numbers");
return NULL;
}
- s_expression *expr = (s_expression*) it.get();
+ s_expression *expr = (s_expression *) n;
if (type->base_type == GLSL_TYPE_FLOAT) {
s_number *value = SX_AS_NUMBER(expr);