Mesa (master): r300/compiler: Move declaration before code.
Vinson Lee
vlee at kemper.freedesktop.org
Wed Sep 29 21:05:34 UTC 2010
Module: Mesa
Branch: master
Commit: ae664daa25ac230e3a97cae0b82b7cd3c392c4bb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae664daa25ac230e3a97cae0b82b7cd3c392c4bb
Author: Vinson Lee <vlee at vmware.com>
Date: Wed Sep 29 14:04:06 2010 -0700
r300/compiler: Move declaration before code.
Fixes these GCC warnings on linux-x86 build.
r500_fragprog.c: In function ‘r500_transform_IF’:
r500_fragprog.c:45: warning: ISO C90 forbids mixed declarations and code
r500_fragprog.c: In function ‘r500FragmentProgramDump’:
r500_fragprog.c:256: warning: ISO C90 forbids mixed declarations and code
---
src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c
index 627ce37..289bb87 100644
--- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c
+++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c
@@ -39,10 +39,12 @@ int r500_transform_IF(
struct rc_instruction * inst,
void* data)
{
+ struct rc_instruction * inst_mov;
+
if (inst->U.I.Opcode != RC_OPCODE_IF)
return 0;
- struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev);
+ inst_mov = rc_insert_new_instruction(c, inst->Prev);
inst_mov->U.I.Opcode = RC_OPCODE_MOV;
inst_mov->U.I.DstReg.WriteMask = 0;
inst_mov->U.I.WriteALUResult = RC_ALURESULT_W;
@@ -251,12 +253,11 @@ void r500FragmentProgramDump(struct radeon_compiler *c, void *user)
{
struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)c;
struct r500_fragment_program_code *code = &compiler->code->code.r500;
- fprintf(stderr, "R500 Fragment Program:\n--------\n");
-
int n, i;
uint32_t inst;
uint32_t inst0;
char *str = NULL;
+ fprintf(stderr, "R500 Fragment Program:\n--------\n");
for (n = 0; n < code->inst_end+1; n++) {
inst0 = inst = code->inst[n].inst0;
More information about the mesa-commit
mailing list