src/video/SDL_stretch.c
changeset 7037 3fedf1f25b94
parent 6885 700f1b25f77f
child 7208 414ad123be9b
     1.1 --- a/src/video/SDL_stretch.c	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/src/video/SDL_stretch.c	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -102,14 +102,12 @@
     1.4          store = STORE_WORD;
     1.5          break;
     1.6      default:
     1.7 -        SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
     1.8 -        return (-1);
     1.9 +        return SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
    1.10      }
    1.11  #ifdef HAVE_MPROTECT
    1.12      /* Make the code writeable */
    1.13      if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_WRITE) < 0) {
    1.14 -        SDL_SetError("Couldn't make copy buffer writeable");
    1.15 -        return (-1);
    1.16 +        return SDL_SetError("Couldn't make copy buffer writeable");
    1.17      }
    1.18  #endif
    1.19      pos = 0x10000;
    1.20 @@ -141,8 +139,7 @@
    1.21  #ifdef HAVE_MPROTECT
    1.22      /* Make the code executable but not writeable */
    1.23      if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) {
    1.24 -        SDL_SetError("Couldn't make copy buffer executable");
    1.25 -        return (-1);
    1.26 +        return SDL_SetError("Couldn't make copy buffer executable");
    1.27      }
    1.28  #endif
    1.29      last.status = 0;
    1.30 @@ -224,8 +221,7 @@
    1.31      const int bpp = dst->format->BytesPerPixel;
    1.32  
    1.33      if (src->format->BitsPerPixel != dst->format->BitsPerPixel) {
    1.34 -        SDL_SetError("Only works with same format surfaces");
    1.35 -        return (-1);
    1.36 +        return SDL_SetError("Only works with same format surfaces");
    1.37      }
    1.38  
    1.39      /* Verify the blit rectangles */
    1.40 @@ -233,8 +229,7 @@
    1.41          if ((srcrect->x < 0) || (srcrect->y < 0) ||
    1.42              ((srcrect->x + srcrect->w) > src->w) ||
    1.43              ((srcrect->y + srcrect->h) > src->h)) {
    1.44 -            SDL_SetError("Invalid source blit rectangle");
    1.45 -            return (-1);
    1.46 +            return SDL_SetError("Invalid source blit rectangle");
    1.47          }
    1.48      } else {
    1.49          full_src.x = 0;
    1.50 @@ -247,8 +242,7 @@
    1.51          if ((dstrect->x < 0) || (dstrect->y < 0) ||
    1.52              ((dstrect->x + dstrect->w) > dst->w) ||
    1.53              ((dstrect->y + dstrect->h) > dst->h)) {
    1.54 -            SDL_SetError("Invalid destination blit rectangle");
    1.55 -            return (-1);
    1.56 +            return SDL_SetError("Invalid destination blit rectangle");
    1.57          }
    1.58      } else {
    1.59          full_dst.x = 0;
    1.60 @@ -262,8 +256,7 @@
    1.61      dst_locked = 0;
    1.62      if (SDL_MUSTLOCK(dst)) {
    1.63          if (SDL_LockSurface(dst) < 0) {
    1.64 -            SDL_SetError("Unable to lock destination surface");
    1.65 -            return (-1);
    1.66 +            return SDL_SetError("Unable to lock destination surface");
    1.67          }
    1.68          dst_locked = 1;
    1.69      }
    1.70 @@ -274,8 +267,7 @@
    1.71              if (dst_locked) {
    1.72                  SDL_UnlockSurface(dst);
    1.73              }
    1.74 -            SDL_SetError("Unable to lock source surface");
    1.75 -            return (-1);
    1.76 +            return SDL_SetError("Unable to lock source surface");
    1.77          }
    1.78          src_locked = 1;
    1.79      }