r600g: Silence uninitialized variable warnings.
authorVinson Lee <vlee@vmware.com>
Sun, 26 Sep 2010 21:34:05 +0000 (14:34 -0700)
committerVinson Lee <vlee@vmware.com>
Sun, 26 Sep 2010 21:34:05 +0000 (14:34 -0700)
Fixes these GCC warnings.
r600_shader.c: In function 'tgsi_tex':
r600_shader.c:1611: warning: 'src2_chan' may be used uninitialized in this function
r600_shader.c:1611: warning: 'src_chan' may be used uninitialized in this function

src/gallium/drivers/r600/r600_shader.c

index 3274f3be71a235a6382c947268193705ee58bdd4..0c27bb7d87999d32500a170b9d2d8e697e1d7d00 100644 (file)
@@ -1631,6 +1631,11 @@ static int tgsi_tex(struct r600_shader_ctx *ctx)
                                src_chan = 1;
                                src2_chan = 2;
                                break;
+                       default:
+                               assert(0);
+                               src_chan = 0;
+                               src2_chan = 0;
+                               break;
                        }
                        r = tgsi_src(ctx, &inst->Src[0], &alu.src[0]);
                        if (r)