diff options
author | Connor Abbott <cwabbott0@gmail.com> | 2014-07-08 12:21:00 -0700 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2014-07-15 11:16:16 -0700 |
commit | 58270c2fac493497ed7923830f49051a53e86a07 (patch) | |
tree | ca7bbef19c575c452b524b8432beedcda30e8fee /src/glsl/ir_reader.cpp | |
parent | 7b0f69225afb362ec2681d9b36eae2d035b10c00 (diff) |
exec_list: Make various places use the new length() method.
Instead of hand-rolling it.
v2 [mattst88]: Rename get_size to length. Expand comment in ir_reader.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Connor Abbott <connor.abbott@intel.com>
Diffstat (limited to 'src/glsl/ir_reader.cpp')
-rw-r--r-- | src/glsl/ir_reader.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/glsl/ir_reader.cpp b/src/glsl/ir_reader.cpp index 4017bdd736..e3566e1d69 100644 --- a/src/glsl/ir_reader.cpp +++ b/src/glsl/ir_reader.cpp @@ -723,10 +723,9 @@ ir_reader::read_expression(s_expression *expr) ir_read_error(expr, "invalid operator: %s", s_op->value()); return NULL; } - - int num_operands = -3; /* skip "expression" <type> <operation> */ - foreach_in_list(s_expression, e, &((s_list *) expr)->subexpressions) - ++num_operands; + + /* Skip "expression" <type> <operation> by subtracting 3. */ + int num_operands = (int) ((s_list *) expr)->subexpressions.length() - 3; int expected_operands = ir_expression::get_num_operands(op); if (num_operands != expected_operands) { |