src/video/SDL_fillrect.c
changeset 7680 6ab959ebea26
parent 7679 b1fe132bc6a4
child 7682 f182a912606a
     1.1 --- a/src/video/SDL_fillrect.c	Wed Aug 21 10:12:16 2013 -0300
     1.2 +++ b/src/video/SDL_fillrect.c	Wed Aug 21 10:13:12 2013 -0300
     1.3 @@ -196,11 +196,14 @@
     1.4  static void
     1.5  SDL_FillRect1MMX(Uint8 *pixels, int pitch, Uint32 color, int w, int h)
     1.6  {
     1.7 +    int i, n;
     1.8 +    Uint8 *p = NULL;
     1.9 +    
    1.10      MMX_BEGIN;
    1.11  
    1.12      while (h--) {
    1.13 -        int i, n = w;
    1.14 -        Uint8 *p = pixels;
    1.15 +        n = w;
    1.16 +        p = pixels;
    1.17  
    1.18          if (n > 63) {
    1.19              int adjust = 8 - ((uintptr_t)p & 7);
    1.20 @@ -231,9 +234,12 @@
    1.21  static void
    1.22  SDL_FillRect1(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
    1.23  {
    1.24 +    int n;
    1.25 +    Uint8 *p = NULL;
    1.26 +    
    1.27      while (h--) {
    1.28 -        int n = w;
    1.29 -        Uint8 *p = pixels;
    1.30 +        n = w;
    1.31 +        p = pixels;
    1.32  
    1.33          if (n > 3) {
    1.34              switch ((uintptr_t) p & 3) {
    1.35 @@ -267,9 +273,12 @@
    1.36  static void
    1.37  SDL_FillRect2(Uint8 * pixels, int pitch, Uint32 color, int w, int h)
    1.38  {
    1.39 +    int n;
    1.40 +    Uint8 *p = NULL;
    1.41 +    
    1.42      while (h--) {
    1.43 -        int n = w;
    1.44 -        Uint16 *p = (Uint16 *) pixels;
    1.45 +        n = w;
    1.46 +        p = (Uint16 *) pixels;
    1.47  
    1.48          if (n > 1) {
    1.49              if ((uintptr_t) p & 2) {
    1.50 @@ -291,10 +300,12 @@
    1.51      Uint8 r = (Uint8) ((color >> 16) & 0xFF);
    1.52      Uint8 g = (Uint8) ((color >> 8) & 0xFF);
    1.53      Uint8 b = (Uint8) (color & 0xFF);
    1.54 +    int n;
    1.55 +    Uint8 *p = NULL;
    1.56  
    1.57      while (h--) {
    1.58 -        int n = w;
    1.59 -        Uint8 *p = pixels;
    1.60 +        n = w;
    1.61 +        p = pixels;
    1.62  
    1.63          while (n--) {
    1.64              *p++ = r;