Mesa (master): nvfx: Silence uninitialized variable warnings.

Vinson Lee vlee at kemper.freedesktop.org
Sun Aug 22 06:01:16 UTC 2010


Module: Mesa
Branch: master
Commit: 172953ef3a481612aa3bc9894941c2f9d34f509e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=172953ef3a481612aa3bc9894941c2f9d34f509e

Author: Vinson Lee <vlee at vmware.com>
Date:   Sat Aug 21 22:59:46 2010 -0700

nvfx: Silence uninitialized variable warnings.

Variables weren't initialized on the error paths.

---

 src/gallium/drivers/nvfx/nvfx_fragprog.c |    2 ++
 src/gallium/drivers/nvfx/nvfx_vertprog.c |    4 ++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/gallium/drivers/nvfx/nvfx_fragprog.c b/src/gallium/drivers/nvfx/nvfx_fragprog.c
index 6c8f5c4..db33ecd 100644
--- a/src/gallium/drivers/nvfx/nvfx_fragprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_fragprog.c
@@ -418,6 +418,8 @@ tgsi_src(struct nvfx_fpc *fpc, const struct tgsi_full_src_register *fsrc)
 		break;
 	default:
 		NOUVEAU_ERR("bad src file\n");
+		src.reg.index = 0;
+		src.reg.type = 0;
 		break;
 	}
 
diff --git a/src/gallium/drivers/nvfx/nvfx_vertprog.c b/src/gallium/drivers/nvfx/nvfx_vertprog.c
index b5dde25..38f3716 100644
--- a/src/gallium/drivers/nvfx/nvfx_vertprog.c
+++ b/src/gallium/drivers/nvfx/nvfx_vertprog.c
@@ -379,6 +379,8 @@ tgsi_src(struct nvfx_vpc *vpc, const struct tgsi_full_src_register *fsrc) {
 		break;
 	default:
 		NOUVEAU_ERR("bad src file\n");
+		src.reg.index = 0;
+		src.reg.type = 0;
 		break;
 	}
 
@@ -410,6 +412,8 @@ tgsi_dst(struct nvfx_vpc *vpc, const struct tgsi_full_dst_register *fdst) {
 		break;
 	default:
 		NOUVEAU_ERR("bad dst file %i\n", fdst->Register.File);
+		dst.index = 0;
+		dst.type = 0;
 		break;
 	}
 




More information about the mesa-commit mailing list