More fixes for -Wdeclaration-after-statement
authorGabriel Jacobo <gabomdq@gmail.com>
Wed, 21 Aug 2013 10:13:12 -0300
changeset 7680 6ab959ebea26
parent 7679 b1fe132bc6a4
child 7681 92591e0b84b8
More fixes for -Wdeclaration-after-statement
src/video/SDL_fillrect.c
--- a/src/video/SDL_fillrect.c	Wed Aug 21 10:12:16 2013 -0300
+++ b/src/video/SDL_fillrect.c	Wed Aug 21 10:13:12 2013 -0300
@@ -196,11 +196,14 @@
 static void
 SDL_FillRect1MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
 {
+    int i, n;
+    Uint8 *p = NULL;
+    
     MMX_BEGIN;
 
     while (h--) {
-        int i, n = w;
-        Uint8 *p = pixels;
+        n = w;
+        p = pixels;
 
         if (n > 63) {
             int adjust = 8 - ((uintptr_t)p & 7);
@@ -231,9 +234,12 @@
 static void
 SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
 {
+    int n;
+    Uint8 *p = NULL;
+    
     while (h--) {
-        int n = w;
-        Uint8 *p = pixels;
+        n = w;
+        p = pixels;
 
         if (n > 3) {
             switch ((uintptr_t) p & 3) {
@@ -267,9 +273,12 @@
 static void
 SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
 {
+    int n;
+    Uint8 *p = NULL;
+    
     while (h--) {
-        int n = w;
-        Uint16 *p = (Uint16 *) pixels;
+        n = w;
+        p = (Uint16 *) pixels;
 
         if (n > 1) {
             if ((uintptr_t) p & 2) {
@@ -291,10 +300,12 @@
     Uint8 r = (Uint8) ((color >> 16) & 0xFF);
     Uint8 g = (Uint8) ((color >> 8) & 0xFF);
     Uint8 b = (Uint8) (color & 0xFF);
+    int n;
+    Uint8 *p = NULL;
 
     while (h--) {
-        int n = w;
-        Uint8 *p = pixels;
+        n = w;
+        p = pixels;
 
         while (n--) {
             *p++ = r;