i965: Quiet another compiler warning about uninitialized values.
authorEric Anholt <eric@anholt.net>
Wed, 11 Feb 2015 22:54:33 +0000 (14:54 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 13 Feb 2015 00:33:16 +0000 (16:33 -0800)
The compiler can't tell that we're always going to hit the first if block
on the first time through the loop.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_vec4.cpp

index ee740520e2b0dced2a5e39786ba2bb136ecc9db2..fda8552d841e136c1e59609b16ec31558e9cc762 100644 (file)
@@ -378,9 +378,9 @@ vec4_visitor::opt_vector_float()
    int last_reg = -1, last_reg_offset = -1;
    enum register_file last_reg_file = BAD_FILE;
 
-   int remaining_channels;
+   int remaining_channels = 0;
    uint8_t imm[4];
-   int inst_count;
+   int inst_count = 0;
    vec4_instruction *imm_inst[4];
 
    foreach_block_and_inst_safe(block, vec4_instruction, inst, cfg) {