summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVinson Lee <[email protected]>2010-09-29 14:04:06 -0700
committerVinson Lee <[email protected]>2010-09-29 14:04:06 -0700
commitae664daa25ac230e3a97cae0b82b7cd3c392c4bb (patch)
treecafdd646788304252cfb0a1f5110435ba268941c
parenta4f296d6180d1990916c8e874adb587f6d8cdb7d (diff)
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
-rw-r--r--src/mesa/drivers/dri/r300/compiler/r500_fragprog.c7
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 627ce374ef1..289bb87ae59 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;