[Mesa-dev] [PATCH 2/3] glsl: tidy up int declaration

Timothy Arceri tarceri at itsqueeze.com
Wed Jun 21 10:12:12 UTC 2017


---
 src/compiler/glsl/opt_algebraic.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp
index a5a1029..b44ab59 100644
--- a/src/compiler/glsl/opt_algebraic.cpp
+++ b/src/compiler/glsl/opt_algebraic.cpp
@@ -306,38 +306,37 @@ ir_algebraic_visitor::swizzle_if_required(ir_expression *expr,
 				     expr->type->vector_elements);
    } else
       return operand;
 }
 
 ir_rvalue *
 ir_algebraic_visitor::handle_expression(ir_expression *ir)
 {
    ir_constant *op_const[4] = {NULL, NULL, NULL, NULL};
    ir_expression *op_expr[4] = {NULL, NULL, NULL, NULL};
-   unsigned int i;
 
    if (ir->operation == ir_binop_mul &&
        ir->operands[0]->type->is_matrix() &&
        ir->operands[1]->type->is_vector()) {
       ir_expression *matrix_mul = ir->operands[0]->as_expression();
 
       if (matrix_mul && matrix_mul->operation == ir_binop_mul &&
          matrix_mul->operands[0]->type->is_matrix() &&
          matrix_mul->operands[1]->type->is_matrix()) {
 
          return mul(matrix_mul->operands[0],
                     mul(matrix_mul->operands[1], ir->operands[1]));
       }
    }
 
    assert(ir->get_num_operands() <= 4);
-   for (i = 0; i < ir->get_num_operands(); i++) {
+   for (unsigned i = 0; i < ir->get_num_operands(); i++) {
       if (ir->operands[i]->type->is_matrix())
 	 return ir;
 
       op_const[i] = ir->operands[i]->constant_expression_value();
       op_expr[i] = ir->operands[i]->as_expression();
    }
 
    if (this->mem_ctx == NULL)
       this->mem_ctx = ralloc_parent(ir);
 
-- 
2.9.4



More information about the mesa-dev mailing list