OSDN Git Service

r300/compiler: Move declaration before code.
authorVinson Lee <vlee@vmware.com>
Wed, 29 Sep 2010 18:19:55 +0000 (11:19 -0700)
committerVinson Lee <vlee@vmware.com>
Wed, 29 Sep 2010 18:19:55 +0000 (11:19 -0700)
Fixes this GCC warning on linux-x86 build.
radeon_emulate_loops.c: In function ‘rc_emulate_loops’:
radeon_emulate_loops.c:517: warning: ISO C90 forbids mixed declarations and code

src/mesa/drivers/dri/r300/compiler/radeon_emulate_loops.c

index 02a52f9..205eecd 100644 (file)
@@ -511,11 +511,12 @@ void rc_emulate_loops(struct radeon_compiler *c, void *user)
         * loops are unrolled first.
         */
        for( i = s->LoopCount - 1; i >= 0; i-- ){
+               unsigned int iterations;
+
                if(!s->Loops[i].EndLoop){
                        continue;
                }
-               unsigned int iterations = loop_max_possible_iterations(
-                                       s->C, &s->Loops[i]);
+               iterations = loop_max_possible_iterations(s->C, &s->Loops[i]);
                unroll_loop(s->C, &s->Loops[i], iterations);
        }
 }