i965: Silence uninitialized variable warning.
authorVinson Lee <vlee@vmware.com>
Thu, 9 Dec 2010 22:17:17 +0000 (14:17 -0800)
committerVinson Lee <vlee@vmware.com>
Thu, 9 Dec 2010 22:17:17 +0000 (14:17 -0800)
Fixes this GCC warning.
brw_fs.cpp: In function 'brw_reg brw_reg_from_fs_reg(fs_reg*)':
brw_fs.cpp:3255: warning: 'brw_reg' may be used uninitialized in this function

src/mesa/drivers/dri/i965/brw_fs.cpp

index 6bb195b48778fd16e8aa8d40cbbb299f2360e3db..c3cbe0df618bc869530655e6dff181b0faef1ddd 100644 (file)
@@ -3280,6 +3280,7 @@ static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg)
         break;
       default:
         assert(!"not reached");
+        brw_reg = brw_null_reg();
         break;
       }
       break;
@@ -3294,6 +3295,10 @@ static struct brw_reg brw_reg_from_fs_reg(fs_reg *reg)
       assert(!"not reached");
       brw_reg = brw_null_reg();
       break;
+   default:
+      assert(!"not reached");
+      brw_reg = brw_null_reg();
+      break;
    }
    if (reg->abs)
       brw_reg = brw_abs(brw_reg);