Mesa (master): r300/compiler: Move declaration before code.

Vinson Lee vlee at kemper.freedesktop.org
Wed Sep 29 20:41:28 UTC 2010


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

Author: Vinson Lee <vlee at vmware.com>
Date:   Wed Sep 29 13:40:45 2010 -0700

r300/compiler: Move declaration before code.

Fixes this GCC warning on linux-x86 build.
radeon_rename_regs.c: In function ‘rc_rename_regs’:
radeon_rename_regs.c:112: warning: ISO C90 forbids mixed declarations and code

---

 .../drivers/dri/r300/compiler/radeon_rename_regs.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
index 31d25f9..60e228b 100644
--- a/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
+++ b/src/mesa/drivers/dri/r300/compiler/radeon_rename_regs.c
@@ -104,13 +104,14 @@ void rc_rename_regs(struct radeon_compiler *c, void *user)
 					inst != &c->Program.Instructions;
 					inst = inst->Next) {
 		const struct rc_opcode_info * info;
+		unsigned int old_index, temp_index;
+		struct rc_dst_register * dst;
 		if(inst->Type != RC_INSTRUCTION_NORMAL) {
 			rc_error(c, "%s only works with normal instructions.",
 								__FUNCTION__);
 			return;
 		}
-		unsigned int old_index, temp_index;
-		struct rc_dst_register * dst = &inst->U.I.DstReg;
+		dst = &inst->U.I.DstReg;
 		info = rc_get_opcode_info(inst->U.I.Opcode);
 		if(!info->HasDstReg || dst->File != RC_FILE_TEMPORARY) {
 			continue;




More information about the mesa-commit mailing list