i965: Silence GCC maybe-uninitialized warning.
authorVinson Lee <vlee@freedesktop.org>
Sat, 7 Mar 2015 06:08:00 +0000 (22:08 -0800)
committerVinson Lee <vlee@freedesktop.org>
Tue, 10 Mar 2015 00:28:39 +0000 (17:28 -0700)
brw_shader.cpp: In function ‘bool brw_saturate_immediate(brw_reg_type, brw_reg*)’:
brw_shader.cpp:618:31: warning: ‘sat_imm.brw_saturate_immediate(brw_reg_type, brw_reg*)::<anonymous union>::ud’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       reg->dw1.ud = sat_imm.ud;
                               ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
src/mesa/drivers/dri/i965/brw_shader.cpp

index f2b4d824218d40a56b3a528dc7baae5e32c3b879..ff0ef4b8f82d6b5103655ac3d7a288b8e676cd9d 100644 (file)
@@ -584,7 +584,7 @@ brw_saturate_immediate(enum brw_reg_type type, struct brw_reg *reg)
       unsigned ud;
       int d;
       float f;
-   } imm = { reg->dw1.ud }, sat_imm;
+   } imm = { reg->dw1.ud }, sat_imm = { 0 };
 
    switch (type) {
    case BRW_REGISTER_TYPE_UD: