Make SDL_SetError and friends unconditionally return -1.
authorRyan C. Gordon <icculus@icculus.org>
Sun, 31 Mar 2013 12:48:50 -0400
changeset 70373fedf1f25b94
parent 7036 8c891504e325
child 7038 7f22b9ba218f
Make SDL_SetError and friends unconditionally return -1.

This lets us change things like this...

if (Failed) {
SDL_SetError("We failed");
return -1;
}

...into this...

if (Failed) {
return SDL_SetError("We failed");
}


Fixes Bugzilla #1778.
include/SDL_error.h
src/SDL.c
src/SDL_error.c
src/audio/SDL_audiocvt.c
src/audio/SDL_wave.c
src/audio/directsound/SDL_directsound.c
src/audio/sun/SDL_sunaudio.c
src/core/android/SDL_android.cpp
src/core/windows/SDL_windows.c
src/core/windows/SDL_windows.h
src/events/SDL_events.c
src/events/SDL_gesture.c
src/events/SDL_mouse.c
src/events/SDL_touch.c
src/file/SDL_rwops.c
src/haptic/SDL_haptic.c
src/haptic/darwin/SDL_syshaptic.c
src/haptic/linux/SDL_syshaptic.c
src/haptic/windows/SDL_syshaptic.c
src/joystick/SDL_gamecontroller.c
src/joystick/SDL_joystick.c
src/joystick/android/SDL_androidjoystick.c
src/joystick/beos/SDL_bejoystick.cc
src/joystick/bsd/SDL_sysjoystick.c
src/joystick/darwin/SDL_sysjoystick.c
src/joystick/dummy/SDL_sysjoystick.c
src/joystick/iphoneos/SDL_sysjoystick.m
src/joystick/linux/SDL_sysjoystick.c
src/joystick/psp/SDL_sysjoystick.c
src/joystick/windows/SDL_dxjoystick.c
src/joystick/windows/SDL_mmjoystick.c
src/main/beos/SDL_BeApp.cc
src/render/SDL_render.c
src/render/SDL_yuv_sw.c
src/render/direct3d/SDL_render_d3d.c
src/render/opengl/SDL_render_gl.c
src/render/opengles/SDL_render_gles.c
src/render/opengles2/SDL_render_gles2.c
src/render/psp/SDL_render_psp.c
src/render/software/SDL_blendfillrect.c
src/render/software/SDL_blendline.c
src/render/software/SDL_blendpoint.c
src/render/software/SDL_drawline.c
src/render/software/SDL_drawpoint.c
src/render/software/SDL_render_sw.c
src/test/SDL_test_fuzzer.c
src/thread/beos/SDL_syssem.c
src/thread/beos/SDL_systhread.c
src/thread/generic/SDL_syscond.c
src/thread/generic/SDL_sysmutex.c
src/thread/generic/SDL_syssem.c
src/thread/generic/SDL_systhread.c
src/thread/psp/SDL_syscond.c
src/thread/psp/SDL_sysmutex.c
src/thread/psp/SDL_syssem.c
src/thread/psp/SDL_systhread.c
src/thread/pthread/SDL_syscond.c
src/thread/pthread/SDL_sysmutex.c
src/thread/pthread/SDL_syssem.c
src/thread/pthread/SDL_systhread.c
src/thread/windows/SDL_sysmutex.c
src/thread/windows/SDL_syssem.c
src/thread/windows/SDL_systhread.c
src/video/SDL_RLEaccel.c
src/video/SDL_blit.c
src/video/SDL_fillrect.c
src/video/SDL_pixels.c
src/video/SDL_stretch.c
src/video/SDL_surface.c
src/video/SDL_video.c
src/video/android/SDL_androidgl.c
src/video/android/SDL_androidwindow.c
src/video/bwindow/SDL_bframebuffer.cc
src/video/bwindow/SDL_bmodes.cc
src/video/cocoa/SDL_cocoamodes.m
src/video/cocoa/SDL_cocoamouse.m
src/video/cocoa/SDL_cocoaopengl.m
src/video/cocoa/SDL_cocoawindow.m
src/video/directfb/SDL_DirectFB_opengl.c
src/video/directfb/SDL_DirectFB_render.c
src/video/directfb/SDL_DirectFB_window.c
src/video/dummy/SDL_nullframebuffer.c
src/video/pandora/SDL_pandora.c
src/video/psp/SDL_pspgl.c
src/video/psp/SDL_pspvideo.c
src/video/uikit/SDL_uikitmodes.m
src/video/uikit/SDL_uikitopengles.m
src/video/uikit/SDL_uikitvideo.m
src/video/uikit/SDL_uikitwindow.m
src/video/windows/SDL_windowsclipboard.c
src/video/windows/SDL_windowsevents.c
src/video/windows/SDL_windowsframebuffer.c
src/video/windows/SDL_windowsmodes.c
src/video/windows/SDL_windowsmouse.c
src/video/windows/SDL_windowsopengl.c
src/video/windows/SDL_windowsvideo.c
src/video/windows/SDL_windowswindow.c
src/video/x11/SDL_x11clipboard.c
src/video/x11/SDL_x11framebuffer.c
src/video/x11/SDL_x11messagebox.c
src/video/x11/SDL_x11modes.c
src/video/x11/SDL_x11opengl.c
src/video/x11/SDL_x11opengles.c
src/video/x11/SDL_x11shape.c
src/video/x11/SDL_x11video.c
src/video/x11/SDL_x11window.c
     1.1 --- a/include/SDL_error.h	Fri Mar 29 21:29:57 2013 -0400
     1.2 +++ b/include/SDL_error.h	Sun Mar 31 12:48:50 2013 -0400
     1.3 @@ -39,7 +39,8 @@
     1.4  #endif
     1.5  
     1.6  /* Public functions */
     1.7 -extern DECLSPEC void SDLCALL SDL_SetError(const char *fmt, ...);
     1.8 +/* SDL_SetError() unconditionally returns -1. */
     1.9 +extern DECLSPEC int SDLCALL SDL_SetError(const char *fmt, ...);
    1.10  extern DECLSPEC const char *SDLCALL SDL_GetError(void);
    1.11  extern DECLSPEC void SDLCALL SDL_ClearError(void);
    1.12  
    1.13 @@ -62,7 +63,8 @@
    1.14      SDL_UNSUPPORTED,
    1.15      SDL_LASTERROR
    1.16  } SDL_errorcode;
    1.17 -extern DECLSPEC void SDLCALL SDL_Error(SDL_errorcode code);
    1.18 +/* SDL_Error() unconditionally returns -1. */
    1.19 +extern DECLSPEC int SDLCALL SDL_Error(SDL_errorcode code);
    1.20  /*@}*//*Internal error functions*/
    1.21  
    1.22  /* Ends C function definitions when using C++ */
     2.1 --- a/src/SDL.c	Fri Mar 29 21:29:57 2013 -0400
     2.2 +++ b/src/SDL.c	Sun Mar 31 12:48:50 2013 -0400
     2.3 @@ -109,8 +109,7 @@
     2.4          }
     2.5          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_TIMER);
     2.6  #else
     2.7 -        SDL_SetError("SDL not built with timer support");
     2.8 -        return (-1);
     2.9 +        return SDL_SetError("SDL not built with timer support");
    2.10  #endif
    2.11      }
    2.12  
    2.13 @@ -124,8 +123,7 @@
    2.14          }
    2.15          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_VIDEO);
    2.16  #else
    2.17 -        SDL_SetError("SDL not built with video support");
    2.18 -        return (-1);
    2.19 +        return SDL_SetError("SDL not built with video support");
    2.20  #endif
    2.21      }
    2.22  
    2.23 @@ -139,8 +137,7 @@
    2.24          }
    2.25          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_AUDIO);
    2.26  #else
    2.27 -        SDL_SetError("SDL not built with audio support");
    2.28 -        return (-1);
    2.29 +        return SDL_SetError("SDL not built with audio support");
    2.30  #endif
    2.31      }
    2.32  
    2.33 @@ -159,8 +156,7 @@
    2.34          }
    2.35          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_JOYSTICK);
    2.36  #else
    2.37 -        SDL_SetError("SDL not built with joystick support");
    2.38 -        return (-1);
    2.39 +        return SDL_SetError("SDL not built with joystick support");
    2.40  #endif
    2.41      }
    2.42  
    2.43 @@ -173,8 +169,7 @@
    2.44          }
    2.45          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_GAMECONTROLLER);
    2.46  #else
    2.47 -        SDL_SetError("SDL not built with joystick support");
    2.48 -        return (-1);
    2.49 +        return SDL_SetError("SDL not built with joystick support");
    2.50  #endif
    2.51      }
    2.52  
    2.53 @@ -188,8 +183,7 @@
    2.54          }
    2.55          SDL_PrivateSubsystemRefCountIncr(SDL_INIT_HAPTIC);
    2.56  #else
    2.57 -        SDL_SetError("SDL not built with haptic (force feedback) support");
    2.58 -        return (-1);
    2.59 +        return SDL_SetError("SDL not built with haptic (force feedback) support");
    2.60  #endif
    2.61      }
    2.62  
     3.1 --- a/src/SDL_error.c	Fri Mar 29 21:29:57 2013 -0400
     3.2 +++ b/src/SDL_error.c	Sun Mar 31 12:48:50 2013 -0400
     3.3 @@ -49,14 +49,14 @@
     3.4  
     3.5  /* Public functions */
     3.6  
     3.7 -void
     3.8 +int
     3.9  SDL_SetError(const char *fmt, ...)
    3.10  {
    3.11      va_list ap;
    3.12      SDL_error *error;
    3.13  
    3.14      /* Ignore call if invalid format pointer was passed */
    3.15 -    if (fmt == NULL) return;
    3.16 +    if (fmt == NULL) return -1;
    3.17      
    3.18      /* Copy in the key, mark error as valid */
    3.19      error = SDL_GetErrBuf();
    3.20 @@ -112,6 +112,8 @@
    3.21  
    3.22      /* If we are in debug mode, print out an error message */
    3.23      SDL_LogError(SDL_LOG_CATEGORY_ERROR, "%s", SDL_GetError());
    3.24 +
    3.25 +    return -1;
    3.26  }
    3.27  
    3.28  /* This function has a bit more overhead than most error functions
    3.29 @@ -216,28 +218,22 @@
    3.30  }
    3.31  
    3.32  /* Very common errors go here */
    3.33 -void
    3.34 +int
    3.35  SDL_Error(SDL_errorcode code)
    3.36  {
    3.37      switch (code) {
    3.38      case SDL_ENOMEM:
    3.39 -        SDL_SetError("Out of memory");
    3.40 -        break;
    3.41 +        return SDL_SetError("Out of memory");
    3.42      case SDL_EFREAD:
    3.43 -        SDL_SetError("Error reading from datastream");
    3.44 -        break;
    3.45 +        return SDL_SetError("Error reading from datastream");
    3.46      case SDL_EFWRITE:
    3.47 -        SDL_SetError("Error writing to datastream");
    3.48 -        break;
    3.49 +        return SDL_SetError("Error writing to datastream");
    3.50      case SDL_EFSEEK:
    3.51 -        SDL_SetError("Error seeking in datastream");
    3.52 -        break;
    3.53 +        return SDL_SetError("Error seeking in datastream");
    3.54      case SDL_UNSUPPORTED:
    3.55 -        SDL_SetError("That operation is not supported");
    3.56 -        break;
    3.57 +        return SDL_SetError("That operation is not supported");
    3.58      default:
    3.59 -        SDL_SetError("Unknown SDL error");
    3.60 -        break;
    3.61 +        return SDL_SetError("Unknown SDL error");
    3.62      }
    3.63  }
    3.64  
     4.1 --- a/src/audio/SDL_audiocvt.c	Fri Mar 29 21:29:57 2013 -0400
     4.2 +++ b/src/audio/SDL_audiocvt.c	Sun Mar 31 12:48:50 2013 -0400
     4.3 @@ -970,28 +970,23 @@
     4.4  
     4.5      /* Sanity check target pointer */
     4.6      if (cvt == NULL) {
     4.7 -        SDL_InvalidParamError("cvt");
     4.8 -        return -1;
     4.9 +        return SDL_InvalidParamError("cvt");
    4.10      }
    4.11      
    4.12      /* there are no unsigned types over 16 bits, so catch this up front. */
    4.13      if ((SDL_AUDIO_BITSIZE(src_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(src_fmt))) {
    4.14 -        SDL_SetError("Invalid source format");
    4.15 -        return -1;
    4.16 +        return SDL_SetError("Invalid source format");
    4.17      }
    4.18      if ((SDL_AUDIO_BITSIZE(dst_fmt) > 16) && (!SDL_AUDIO_ISSIGNED(dst_fmt))) {
    4.19 -        SDL_SetError("Invalid destination format");
    4.20 -        return -1;
    4.21 +        return SDL_SetError("Invalid destination format");
    4.22      }
    4.23  
    4.24      /* prevent possible divisions by zero, etc. */
    4.25      if ((src_channels == 0) || (dst_channels == 0)) {
    4.26 -        SDL_SetError("Source or destination channels is zero");
    4.27 -        return -1;
    4.28 +        return SDL_SetError("Source or destination channels is zero");
    4.29      }
    4.30      if ((src_rate == 0) || (dst_rate == 0)) {
    4.31 -        SDL_SetError("Source or destination rate is zero");
    4.32 -        return -1;
    4.33 +        return SDL_SetError("Source or destination rate is zero");
    4.34      }
    4.35  #ifdef DEBUG_CONVERT
    4.36      printf("Build format %04x->%04x, channels %u->%u, rate %d->%d\n",
     5.1 --- a/src/audio/SDL_wave.c	Fri Mar 29 21:29:57 2013 -0400
     5.2 +++ b/src/audio/SDL_wave.c	Sun Mar 31 12:48:50 2013 -0400
     5.3 @@ -134,8 +134,7 @@
     5.4          MS_ADPCM_state.wavefmt.channels * sizeof(Sint16);
     5.5      *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
     5.6      if (*audio_buf == NULL) {
     5.7 -        SDL_Error(SDL_ENOMEM);
     5.8 -        return (-1);
     5.9 +        return SDL_OutOfMemory();
    5.10      }
    5.11      decoded = *audio_buf;
    5.12  
    5.13 @@ -359,8 +358,7 @@
    5.14          IMA_ADPCM_state.wavefmt.channels * sizeof(Sint16);
    5.15      *audio_buf = (Uint8 *) SDL_malloc(*audio_len);
    5.16      if (*audio_buf == NULL) {
    5.17 -        SDL_Error(SDL_ENOMEM);
    5.18 -        return (-1);
    5.19 +        return SDL_OutOfMemory();
    5.20      }
    5.21      decoded = *audio_buf;
    5.22  
    5.23 @@ -620,14 +618,12 @@
    5.24      chunk->length = SDL_ReadLE32(src);
    5.25      chunk->data = (Uint8 *) SDL_malloc(chunk->length);
    5.26      if (chunk->data == NULL) {
    5.27 -        SDL_Error(SDL_ENOMEM);
    5.28 -        return (-1);
    5.29 +        return SDL_OutOfMemory();
    5.30      }
    5.31      if (SDL_RWread(src, chunk->data, chunk->length, 1) != 1) {
    5.32 -        SDL_Error(SDL_EFREAD);
    5.33          SDL_free(chunk->data);
    5.34          chunk->data = NULL;
    5.35 -        return (-1);
    5.36 +        return SDL_Error(SDL_EFREAD);
    5.37      }
    5.38      return (chunk->length);
    5.39  }
     6.1 --- a/src/audio/directsound/SDL_directsound.c	Fri Mar 29 21:29:57 2013 -0400
     6.2 +++ b/src/audio/directsound/SDL_directsound.c	Sun Mar 31 12:48:50 2013 -0400
     6.3 @@ -95,7 +95,7 @@
     6.4                              (SDL_wcslen(S)+1)*sizeof(WCHAR));
     6.5  }
     6.6  
     6.7 -static void
     6.8 +static int
     6.9  SetDSerror(const char *function, int code)
    6.10  {
    6.11      static const char *error;
    6.12 @@ -145,8 +145,7 @@
    6.13          SDL_snprintf(errbuf, SDL_arraysize(errbuf), "%s: %s", function,
    6.14                       error);
    6.15      }
    6.16 -    SDL_SetError("%s", errbuf);
    6.17 -    return;
    6.18 +    return SDL_SetError("%s", errbuf);
    6.19  }
    6.20  
    6.21  
    6.22 @@ -380,16 +379,14 @@
    6.23      format.dwBufferBytes = numchunks * chunksize;
    6.24      if ((format.dwBufferBytes < DSBSIZE_MIN) ||
    6.25          (format.dwBufferBytes > DSBSIZE_MAX)) {
    6.26 -        SDL_SetError("Sound buffer size must be between %d and %d",
    6.27 -                     DSBSIZE_MIN / numchunks, DSBSIZE_MAX / numchunks);
    6.28 -        return (-1);
    6.29 +        return SDL_SetError("Sound buffer size must be between %d and %d",
    6.30 +                            DSBSIZE_MIN / numchunks, DSBSIZE_MAX / numchunks);
    6.31      }
    6.32      format.dwReserved = 0;
    6.33      format.lpwfxFormat = wavefmt;
    6.34      result = IDirectSound_CreateSoundBuffer(sndObj, &format, sndbuf, NULL);
    6.35      if (result != DS_OK) {
    6.36 -        SetDSerror("DirectSound CreateSoundBuffer", result);
    6.37 -        return (-1);
    6.38 +        return SetDSerror("DirectSound CreateSoundBuffer", result);
    6.39      }
    6.40      IDirectSoundBuffer_SetFormat(*sndbuf, wavefmt);
    6.41  
     7.1 --- a/src/audio/sun/SDL_sunaudio.c	Fri Mar 29 21:29:57 2013 -0400
     7.2 +++ b/src/audio/sun/SDL_sunaudio.c	Sun Mar 31 12:48:50 2013 -0400
     7.3 @@ -332,8 +332,7 @@
     7.4          this->hidden->frequency = 8;
     7.5          this->hidden->ulaw_buf = (Uint8 *) SDL_malloc(this->hidden->fragsize);
     7.6          if (this->hidden->ulaw_buf == NULL) {
     7.7 -            SDL_OutOfMemory();
     7.8 -            return (-1);
     7.9 +            return SDL_OutOfMemory();
    7.10          }
    7.11          this->spec.channels = 1;
    7.12      } else {
    7.13 @@ -353,8 +352,7 @@
    7.14      /* Allocate mixing buffer */
    7.15      this->hidden->mixbuf = (Uint8 *) SDL_AllocAudioMem(this->spec.size);
    7.16      if (this->hidden->mixbuf == NULL) {
    7.17 -        SDL_OutOfMemory();
    7.18 -        return (-1);
    7.19 +        return SDL_OutOfMemory();
    7.20      }
    7.21      SDL_memset(this->hidden->mixbuf, this->spec.silence, this->spec.size);
    7.22  
     8.1 --- a/src/core/android/SDL_android.cpp	Fri Mar 29 21:29:57 2013 -0400
     8.2 +++ b/src/core/android/SDL_android.cpp	Sun Mar 31 12:48:50 2013 -0400
     8.3 @@ -811,8 +811,7 @@
     8.4      JNIEnv *mEnv = Android_JNI_GetEnv();
     8.5  
     8.6      if (!refs.init(mEnv)) {
     8.7 -        SDL_SetError("Failed to allocate enough JVM local references");
     8.8 -        return -1;
     8.9 +        return SDL_SetError("Failed to allocate enough JVM local references");
    8.10      }
    8.11  
    8.12      if (ctx) {
    8.13 @@ -875,8 +874,7 @@
    8.14                  offset = ctx->hidden.androidio.offset + ctx->hidden.androidio.size + offset;
    8.15                  break;
    8.16              default:
    8.17 -                SDL_SetError("Unknown value for 'whence'");
    8.18 -                return -1;
    8.19 +                return SDL_SetError("Unknown value for 'whence'");
    8.20          }
    8.21          whence = SEEK_SET;
    8.22  
    8.23 @@ -897,14 +895,12 @@
    8.24                  newPosition = ctx->hidden.androidio.size + offset;
    8.25                  break;
    8.26              default:
    8.27 -                SDL_SetError("Unknown value for 'whence'");
    8.28 -                return -1;
    8.29 +                return SDL_SetError("Unknown value for 'whence'");
    8.30          }
    8.31  
    8.32          /* Validate the new position */
    8.33          if (newPosition < 0) {
    8.34 -            SDL_Error(SDL_EFSEEK);
    8.35 -            return -1;
    8.36 +            return SDL_Error(SDL_EFSEEK);
    8.37          }
    8.38          if (newPosition > ctx->hidden.androidio.size) {
    8.39              newPosition = ctx->hidden.androidio.size;
     9.1 --- a/src/core/windows/SDL_windows.c	Fri Mar 29 21:29:57 2013 -0400
     9.2 +++ b/src/core/windows/SDL_windows.c	Sun Mar 31 12:48:50 2013 -0400
     9.3 @@ -29,7 +29,7 @@
     9.4  #include <objbase.h>  /* for CoInitialize/CoUninitialize */
     9.5  
     9.6  /* Sets an error message based on GetLastError() */
     9.7 -void
     9.8 +int
     9.9  WIN_SetError(const char *prefix)
    9.10  {
    9.11      TCHAR buffer[1024];
    9.12 @@ -39,6 +39,7 @@
    9.13      message = WIN_StringToUTF8(buffer);
    9.14      SDL_SetError("%s%s%s", prefix ? prefix : "", prefix ? ": " : "", message);
    9.15      SDL_free(message);
    9.16 +    return -1;
    9.17  }
    9.18  
    9.19  HRESULT
    10.1 --- a/src/core/windows/SDL_windows.h	Fri Mar 29 21:29:57 2013 -0400
    10.2 +++ b/src/core/windows/SDL_windows.h	Sun Mar 31 12:48:50 2013 -0400
    10.3 @@ -43,8 +43,8 @@
    10.4  #define WIN_UTF8ToString(S) SDL_iconv_string("ASCII", "UTF-8", (char *)(S), SDL_strlen(S)+1)
    10.5  #endif
    10.6  
    10.7 -/* Sets an error message based on GetLastError() */
    10.8 -extern void WIN_SetError(const char *prefix);
    10.9 +/* Sets an error message based on GetLastError(). Always return -1. */
   10.10 +extern int WIN_SetError(const char *prefix);
   10.11  
   10.12  /* Wrap up the oddities of CoInitialize() into a common function. */
   10.13  extern HRESULT WIN_CoInitialize(void);
    11.1 --- a/src/events/SDL_events.c	Fri Mar 29 21:29:57 2013 -0400
    11.2 +++ b/src/events/SDL_events.c	Sun Mar 31 12:48:50 2013 -0400
    11.3 @@ -244,8 +244,7 @@
    11.4          }
    11.5          SDL_UnlockMutex(SDL_EventQ.lock);
    11.6      } else {
    11.7 -        SDL_SetError("Couldn't lock event queue");
    11.8 -        used = -1;
    11.9 +        return SDL_SetError("Couldn't lock event queue");
   11.10      }
   11.11      return (used);
   11.12  }
    12.1 --- a/src/events/SDL_gesture.c	Fri Mar 29 21:29:57 2013 -0400
    12.2 +++ b/src/events/SDL_gesture.c	Sun Mar 31 12:48:50 2013 -0400
    12.3 @@ -158,8 +158,7 @@
    12.4              }
    12.5          }
    12.6      }
    12.7 -    SDL_SetError("Unknown gestureId");
    12.8 -    return -1;
    12.9 +    return SDL_SetError("Unknown gestureId");
   12.10  }
   12.11  
   12.12  //path is an already sampled set of points
   12.13 @@ -176,8 +175,7 @@
   12.14                                            (index + 1) *
   12.15                                            sizeof(SDL_DollarTemplate));
   12.16      if (!dollarTemplate) {
   12.17 -        SDL_OutOfMemory();
   12.18 -        return -1;
   12.19 +        return SDL_OutOfMemory();
   12.20      }
   12.21      inTouch->dollarTemplate = dollarTemplate;
   12.22  
   12.23 @@ -419,8 +417,7 @@
   12.24                                                                       sizeof(SDL_GestureTouch));
   12.25  
   12.26      if (!gestureTouch) {
   12.27 -        SDL_OutOfMemory();
   12.28 -        return -1;
   12.29 +        return SDL_OutOfMemory();
   12.30      }
   12.31  
   12.32      SDL_gestureTouch = gestureTouch;
    13.1 --- a/src/events/SDL_mouse.c	Fri Mar 29 21:29:57 2013 -0400
    13.2 +++ b/src/events/SDL_mouse.c	Sun Mar 31 12:48:50 2013 -0400
    13.3 @@ -413,8 +413,7 @@
    13.4      }
    13.5  
    13.6      if (!mouse->SetRelativeMouseMode) {
    13.7 -        SDL_Unsupported();
    13.8 -        return -1;
    13.9 +        return SDL_Unsupported();
   13.10      }
   13.11  
   13.12      if (mouse->SetRelativeMouseMode(enabled) < 0) {
    14.1 --- a/src/events/SDL_touch.c	Fri Mar 29 21:29:57 2013 -0400
    14.2 +++ b/src/events/SDL_touch.c	Sun Mar 31 12:48:50 2013 -0400
    14.3 @@ -141,8 +141,7 @@
    14.4      touchDevices = (SDL_Touch **) SDL_realloc(SDL_touchDevices,
    14.5                                        (SDL_num_touch + 1) * sizeof(*touchDevices));
    14.6      if (!touchDevices) {
    14.7 -        SDL_OutOfMemory();
    14.8 -        return -1;
    14.9 +        return SDL_OutOfMemory();
   14.10      }
   14.11  
   14.12      SDL_touchDevices = touchDevices;
   14.13 @@ -150,8 +149,7 @@
   14.14  
   14.15      SDL_touchDevices[index] = (SDL_Touch *) SDL_malloc(sizeof(*SDL_touchDevices[index]));
   14.16      if (!SDL_touchDevices[index]) {
   14.17 -        SDL_OutOfMemory();
   14.18 -        return -1;
   14.19 +        return SDL_OutOfMemory();
   14.20      }
   14.21  
   14.22      /* we're setting the touch properties */
   14.23 @@ -176,14 +174,12 @@
   14.24          SDL_Finger **new_fingers;
   14.25          new_fingers = (SDL_Finger **)SDL_realloc(touch->fingers, (touch->max_fingers+1)*sizeof(*touch->fingers));
   14.26          if (!new_fingers) {
   14.27 -            SDL_OutOfMemory();
   14.28 -            return -1;
   14.29 +            return SDL_OutOfMemory();
   14.30          }
   14.31          touch->fingers = new_fingers;
   14.32          touch->fingers[touch->max_fingers] = (SDL_Finger *)SDL_malloc(sizeof(*finger));
   14.33          if (!touch->fingers[touch->max_fingers]) {
   14.34 -            SDL_OutOfMemory();
   14.35 -            return -1;
   14.36 +            return SDL_OutOfMemory();
   14.37          }
   14.38          touch->max_fingers++;
   14.39      }
    15.1 --- a/src/file/SDL_rwops.c	Fri Mar 29 21:29:57 2013 -0400
    15.2 +++ b/src/file/SDL_rwops.c	Sun Mar 31 12:48:50 2013 -0400
    15.3 @@ -87,8 +87,7 @@
    15.4      context->hidden.windowsio.buffer.data =
    15.5          (char *) SDL_malloc(READAHEAD_BUFFER_SIZE);
    15.6      if (!context->hidden.windowsio.buffer.data) {
    15.7 -        SDL_OutOfMemory();
    15.8 -        return -1;
    15.9 +        return SDL_OutOfMemory();
   15.10      }
   15.11      /* Do not open a dialog box if failure */
   15.12      old_error_mode =
   15.13 @@ -124,13 +123,11 @@
   15.14      LARGE_INTEGER size;
   15.15  
   15.16      if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
   15.17 -        SDL_SetError("windows_file_size: invalid context/file not opened");
   15.18 -        return -1;
   15.19 +        return SDL_SetError("windows_file_size: invalid context/file not opened");
   15.20      }
   15.21  
   15.22      if (!GetFileSizeEx(context->hidden.windowsio.h, &size)) {
   15.23 -        WIN_SetError("windows_file_size");
   15.24 -        return -1;
   15.25 +        return WIN_SetError("windows_file_size");
   15.26      }
   15.27  
   15.28      return size.QuadPart;
   15.29 @@ -143,8 +140,7 @@
   15.30      LARGE_INTEGER windowsoffset;
   15.31  
   15.32      if (!context || context->hidden.windowsio.h == INVALID_HANDLE_VALUE) {
   15.33 -        SDL_SetError("windows_file_seek: invalid context/file not opened");
   15.34 -        return -1;
   15.35 +        return SDL_SetError("windows_file_seek: invalid context/file not opened");
   15.36      }
   15.37  
   15.38      /* FIXME: We may be able to satisfy the seek within buffered data */
   15.39 @@ -164,14 +160,12 @@
   15.40          windowswhence = FILE_END;
   15.41          break;
   15.42      default:
   15.43 -        SDL_SetError("windows_file_seek: Unknown value for 'whence'");
   15.44 -        return -1;
   15.45 +        return SDL_SetError("windows_file_seek: Unknown value for 'whence'");
   15.46      }
   15.47  
   15.48      windowsoffset.QuadPart = offset;
   15.49      if (!SetFilePointerEx(context->hidden.windowsio.h, windowsoffset, &windowsoffset, windowswhence)) {
   15.50 -        WIN_SetError("windows_file_seek");
   15.51 -        return -1;
   15.52 +        return WIN_SetError("windows_file_seek");
   15.53      }
   15.54      return windowsoffset.QuadPart;
   15.55  }
   15.56 @@ -325,8 +319,7 @@
   15.57          return (ftell(context->hidden.stdio.fp));
   15.58      }
   15.59  #endif
   15.60 -    SDL_Error(SDL_EFSEEK);
   15.61 -    return (-1);
   15.62 +    return SDL_Error(SDL_EFSEEK);
   15.63  }
   15.64  
   15.65  static size_t SDLCALL
   15.66 @@ -361,8 +354,7 @@
   15.67          if (context->hidden.stdio.autoclose) {
   15.68              /* WARNING:  Check the return value here! */
   15.69              if (fclose(context->hidden.stdio.fp) != 0) {
   15.70 -                SDL_Error(SDL_EFWRITE);
   15.71 -                status = -1;
   15.72 +                status = SDL_Error(SDL_EFWRITE);
   15.73              }
   15.74          }
   15.75          SDL_FreeRW(context);
   15.76 @@ -395,8 +387,7 @@
   15.77          newpos = context->hidden.mem.stop + offset;
   15.78          break;
   15.79      default:
   15.80 -        SDL_SetError("Unknown value for 'whence'");
   15.81 -        return (-1);
   15.82 +        return SDL_SetError("Unknown value for 'whence'");
   15.83      }
   15.84      if (newpos < context->hidden.mem.base) {
   15.85          newpos = context->hidden.mem.base;
    16.1 --- a/src/haptic/SDL_haptic.c	Fri Mar 29 21:29:57 2013 -0400
    16.2 +++ b/src/haptic/SDL_haptic.c	Sun Mar 31 12:48:50 2013 -0400
    16.3 @@ -447,8 +447,7 @@
    16.4  
    16.5      /* Check to see if effect is supported */
    16.6      if (SDL_HapticEffectSupported(haptic, effect) == SDL_FALSE) {
    16.7 -        SDL_SetError("Haptic: Effect not supported by haptic device.");
    16.8 -        return -1;
    16.9 +        return SDL_SetError("Haptic: Effect not supported by haptic device.");
   16.10      }
   16.11  
   16.12      /* See if there's a free slot */
   16.13 @@ -467,8 +466,7 @@
   16.14          }
   16.15      }
   16.16  
   16.17 -    SDL_SetError("Haptic: Device has no free space left.");
   16.18 -    return -1;
   16.19 +    return SDL_SetError("Haptic: Device has no free space left.");
   16.20  }
   16.21  
   16.22  /*
   16.23 @@ -497,8 +495,7 @@
   16.24  
   16.25      /* Can't change type dynamically. */
   16.26      if (data->type != haptic->effects[effect].effect.type) {
   16.27 -        SDL_SetError("Haptic: Updating effect type is illegal.");
   16.28 -        return -1;
   16.29 +        return SDL_SetError("Haptic: Updating effect type is illegal.");
   16.30      }
   16.31  
   16.32      /* Updates the effect */
   16.33 @@ -579,8 +576,7 @@
   16.34      }
   16.35  
   16.36      if ((haptic->supported & SDL_HAPTIC_STATUS) == 0) {
   16.37 -        SDL_SetError("Haptic: Device does not support status queries.");
   16.38 -        return -1;
   16.39 +        return SDL_SetError("Haptic: Device does not support status queries.");
   16.40      }
   16.41  
   16.42      return SDL_SYS_HapticGetEffectStatus(haptic, &haptic->effects[effect]);
   16.43 @@ -600,13 +596,11 @@
   16.44      }
   16.45  
   16.46      if ((haptic->supported & SDL_HAPTIC_GAIN) == 0) {
   16.47 -        SDL_SetError("Haptic: Device does not support setting gain.");
   16.48 -        return -1;
   16.49 +        return SDL_SetError("Haptic: Device does not support setting gain.");
   16.50      }
   16.51  
   16.52      if ((gain < 0) || (gain > 100)) {
   16.53 -        SDL_SetError("Haptic: Gain must be between 0 and 100.");
   16.54 -        return -1;
   16.55 +        return SDL_SetError("Haptic: Gain must be between 0 and 100.");
   16.56      }
   16.57  
   16.58      /* We use the envvar to get the maximum gain. */
   16.59 @@ -644,13 +638,11 @@
   16.60      }
   16.61  
   16.62      if ((haptic->supported & SDL_HAPTIC_AUTOCENTER) == 0) {
   16.63 -        SDL_SetError("Haptic: Device does not support setting autocenter.");
   16.64 -        return -1;
   16.65 +        return SDL_SetError("Haptic: Device does not support setting autocenter.");
   16.66      }
   16.67  
   16.68      if ((autocenter < 0) || (autocenter > 100)) {
   16.69 -        SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
   16.70 -        return -1;
   16.71 +        return SDL_SetError("Haptic: Autocenter must be between 0 and 100.");
   16.72      }
   16.73  
   16.74      if (SDL_SYS_HapticSetAutocenter(haptic, autocenter) < 0) {
   16.75 @@ -671,8 +663,7 @@
   16.76      }
   16.77  
   16.78      if ((haptic->supported & SDL_HAPTIC_PAUSE) == 0) {
   16.79 -        SDL_SetError("Haptic: Device does not support setting pausing.");
   16.80 -        return -1;
   16.81 +        return SDL_SetError("Haptic: Device does not support setting pausing.");
   16.82      }
   16.83  
   16.84      return SDL_SYS_HapticPause(haptic);
   16.85 @@ -773,8 +764,7 @@
   16.86      }
   16.87  
   16.88      if (haptic->rumble_id < 0) {
   16.89 -        SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
   16.90 -        return -1;
   16.91 +        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
   16.92      }
   16.93  
   16.94      /* Clamp strength. */
   16.95 @@ -805,8 +795,7 @@
   16.96      }
   16.97  
   16.98      if (haptic->rumble_id < 0) {
   16.99 -        SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
  16.100 -        return -1;
  16.101 +        return SDL_SetError("Haptic: Rumble effect not initialized on haptic device");
  16.102      }
  16.103  
  16.104      return SDL_HapticStopEffect(haptic, haptic->rumble_id);
    17.1 --- a/src/haptic/darwin/SDL_syshaptic.c	Fri Mar 29 21:29:57 2013 -0400
    17.2 +++ b/src/haptic/darwin/SDL_syshaptic.c	Sun Mar 31 12:48:50 2013 -0400
    17.3 @@ -160,15 +160,13 @@
    17.4      /* Get HID devices. */
    17.5      match = IOServiceMatching(kIOHIDDeviceKey);
    17.6      if (match == NULL) {
    17.7 -        SDL_SetError("Haptic: Failed to get IOServiceMatching.");
    17.8 -        return -1;
    17.9 +        return SDL_SetError("Haptic: Failed to get IOServiceMatching.");
   17.10      }
   17.11  
   17.12      /* Now search I/O Registry for matching devices. */
   17.13      result = IOServiceGetMatchingServices(kIOMasterPortDefault, match, &iter);
   17.14      if (result != kIOReturnSuccess) {
   17.15 -        SDL_SetError("Haptic: Couldn't create a HID object iterator.");
   17.16 -        return -1;
   17.17 +        return SDL_SetError("Haptic: Couldn't create a HID object iterator.");
   17.18      }
   17.19      /* IOServiceGetMatchingServices consumes dictionary. */
   17.20  
   17.21 @@ -257,8 +255,7 @@
   17.22      ret = IORegistryEntryCreateCFProperties(dev, &hidProperties,
   17.23                                              kCFAllocatorDefault, kNilOptions);
   17.24      if ((ret != KERN_SUCCESS) || !hidProperties) {
   17.25 -        SDL_SetError("Haptic: Unable to create CFProperties.");
   17.26 -        return -1;
   17.27 +        return SDL_SetError("Haptic: Unable to create CFProperties.");
   17.28      }
   17.29  
   17.30      /* Mac OS X currently is not mirroring all USB properties to HID page so need to look at USB device page also
   17.31 @@ -289,17 +286,15 @@
   17.32              if (refCF) {
   17.33                  if (!CFStringGetCString(refCF, name, 256,
   17.34                                          CFStringGetSystemEncoding())) {
   17.35 -                    SDL_SetError
   17.36 +                    return SDL_SetError
   17.37                          ("Haptic: CFStringGetCString error retrieving pDevice->product.");
   17.38 -                    return -1;
   17.39                  }
   17.40              }
   17.41  
   17.42              CFRelease(usbProperties);
   17.43          } else {
   17.44 -            SDL_SetError
   17.45 +            return SDL_SetError
   17.46                  ("Haptic: IORegistryEntryCreateCFProperties failed to create usbProperties.");
   17.47 -            return -1;
   17.48          }
   17.49  
   17.50          /* Release stuff. */
   17.51 @@ -310,8 +305,7 @@
   17.52              SDL_SetError("Haptic: IOObjectRelease error with parent1.");
   17.53          }
   17.54      } else {
   17.55 -        SDL_SetError("Haptic: Error getting registry entries.");
   17.56 -        return -1;
   17.57 +        return SDL_SetError("Haptic: Error getting registry entries.");
   17.58      }
   17.59  
   17.60      return 0;
   17.61 @@ -336,8 +330,7 @@
   17.62  
   17.63      ret = FFDeviceGetForceFeedbackCapabilities(device, &features);
   17.64      if (ret != FF_OK) {
   17.65 -        SDL_SetError("Haptic: Unable to get device's supported features.");
   17.66 -        return -1;
   17.67 +        return SDL_SetError("Haptic: Unable to get device's supported features.");
   17.68      }
   17.69  
   17.70      supported = 0;
   17.71 @@ -366,9 +359,8 @@
   17.72      if (ret == FF_OK)
   17.73          supported |= SDL_HAPTIC_GAIN;
   17.74      else if (ret != FFERR_UNSUPPORTED) {
   17.75 -        SDL_SetError("Haptic: Unable to get if device supports gain: %s.",
   17.76 -                     FFStrError(ret));
   17.77 -        return -1;
   17.78 +        return SDL_SetError("Haptic: Unable to get if device supports gain: %s.",
   17.79 +                            FFStrError(ret));
   17.80      }
   17.81  
   17.82      /* Checks if supports autocenter. */
   17.83 @@ -377,10 +369,9 @@
   17.84      if (ret == FF_OK)
   17.85          supported |= SDL_HAPTIC_AUTOCENTER;
   17.86      else if (ret != FFERR_UNSUPPORTED) {
   17.87 -        SDL_SetError
   17.88 +        return SDL_SetError
   17.89              ("Haptic: Unable to get if device supports autocenter: %s.",
   17.90               FFStrError(ret));
   17.91 -        return -1;
   17.92      }
   17.93  
   17.94      /* Check for axes, we have an artificial limit on axes */
   17.95 @@ -625,8 +616,7 @@
   17.96      /* Has axes. */
   17.97      rglDir = SDL_malloc(sizeof(LONG) * naxes);
   17.98      if (rglDir == NULL) {
   17.99 -        SDL_OutOfMemory();
  17.100 -        return -1;
  17.101 +        return SDL_OutOfMemory();
  17.102      }
  17.103      SDL_memset(rglDir, 0, sizeof(LONG) * naxes);
  17.104      effect->rglDirection = rglDir;
  17.105 @@ -654,8 +644,7 @@
  17.106          return 0;
  17.107  
  17.108      default:
  17.109 -        SDL_SetError("Haptic: Unknown direction type.");
  17.110 -        return -1;
  17.111 +        return SDL_SetError("Haptic: Unknown direction type.");
  17.112      }
  17.113  }
  17.114  
  17.115 @@ -695,8 +684,7 @@
  17.116      /* Envelope. */
  17.117      envelope = SDL_malloc(sizeof(FFENVELOPE));
  17.118      if (envelope == NULL) {
  17.119 -        SDL_OutOfMemory();
  17.120 -        return -1;
  17.121 +        return SDL_OutOfMemory();
  17.122      }
  17.123      SDL_memset(envelope, 0, sizeof(FFENVELOPE));
  17.124      dest->lpEnvelope = envelope;
  17.125 @@ -707,8 +695,7 @@
  17.126      if (dest->cAxes > 0) {
  17.127          axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
  17.128          if (axes == NULL) {
  17.129 -            SDL_OutOfMemory();
  17.130 -            return -1;
  17.131 +            return SDL_OutOfMemory();
  17.132          }
  17.133          axes[0] = haptic->hwdata->axes[0];      /* Always at least one axis. */
  17.134          if (dest->cAxes > 1) {
  17.135 @@ -727,8 +714,7 @@
  17.136          hap_constant = &src->constant;
  17.137          constant = SDL_malloc(sizeof(FFCONSTANTFORCE));
  17.138          if (constant == NULL) {
  17.139 -            SDL_OutOfMemory();
  17.140 -            return -1;
  17.141 +            return SDL_OutOfMemory();
  17.142          }
  17.143          SDL_memset(constant, 0, sizeof(FFCONSTANTFORCE));
  17.144  
  17.145 @@ -771,8 +757,7 @@
  17.146          hap_periodic = &src->periodic;
  17.147          periodic = SDL_malloc(sizeof(FFPERIODIC));
  17.148          if (periodic == NULL) {
  17.149 -            SDL_OutOfMemory();
  17.150 -            return -1;
  17.151 +            return SDL_OutOfMemory();
  17.152          }
  17.153          SDL_memset(periodic, 0, sizeof(FFPERIODIC));
  17.154  
  17.155 @@ -817,8 +802,7 @@
  17.156          hap_condition = &src->condition;
  17.157          condition = SDL_malloc(sizeof(FFCONDITION) * dest->cAxes);
  17.158          if (condition == NULL) {
  17.159 -            SDL_OutOfMemory();
  17.160 -            return -1;
  17.161 +            return SDL_OutOfMemory();
  17.162          }
  17.163          SDL_memset(condition, 0, sizeof(FFCONDITION));
  17.164  
  17.165 @@ -860,8 +844,7 @@
  17.166          hap_ramp = &src->ramp;
  17.167          ramp = SDL_malloc(sizeof(FFRAMPFORCE));
  17.168          if (ramp == NULL) {
  17.169 -            SDL_OutOfMemory();
  17.170 -            return -1;
  17.171 +            return SDL_OutOfMemory();
  17.172          }
  17.173          SDL_memset(ramp, 0, sizeof(FFRAMPFORCE));
  17.174  
  17.175 @@ -899,8 +882,7 @@
  17.176          hap_custom = &src->custom;
  17.177          custom = SDL_malloc(sizeof(FFCUSTOMFORCE));
  17.178          if (custom == NULL) {
  17.179 -            SDL_OutOfMemory();
  17.180 -            return -1;
  17.181 +            return SDL_OutOfMemory();
  17.182          }
  17.183          SDL_memset(custom, 0, sizeof(FFCUSTOMFORCE));
  17.184  
  17.185 @@ -944,8 +926,7 @@
  17.186  
  17.187  
  17.188      default:
  17.189 -        SDL_SetError("Haptic: Unknown effect type.");
  17.190 -        return -1;
  17.191 +        return SDL_SetError("Haptic: Unknown effect type.");
  17.192      }
  17.193  
  17.194      return 0;
  17.195 @@ -1150,9 +1131,8 @@
  17.196      /* Run the effect. */
  17.197      ret = FFEffectStart(effect->hweffect->ref, iter, 0);
  17.198      if (ret != FF_OK) {
  17.199 -        SDL_SetError("Haptic: Unable to run the effect: %s.",
  17.200 -                     FFStrError(ret));
  17.201 -        return -1;
  17.202 +        return SDL_SetError("Haptic: Unable to run the effect: %s.",
  17.203 +                            FFStrError(ret));
  17.204      }
  17.205  
  17.206      return 0;
  17.207 @@ -1169,9 +1149,8 @@
  17.208  
  17.209      ret = FFEffectStop(effect->hweffect->ref);
  17.210      if (ret != FF_OK) {
  17.211 -        SDL_SetError("Haptic: Unable to stop the effect: %s.",
  17.212 -                     FFStrError(ret));
  17.213 -        return -1;
  17.214 +        return SDL_SetError("Haptic: Unable to stop the effect: %s.",
  17.215 +                            FFStrError(ret));
  17.216      }
  17.217  
  17.218      return 0;
  17.219 @@ -1236,8 +1215,7 @@
  17.220          FFDeviceSetForceFeedbackProperty(haptic->hwdata->device,
  17.221                                           FFPROP_FFGAIN, &val);
  17.222      if (ret != FF_OK) {
  17.223 -        SDL_SetError("Haptic: Error setting gain: %s.", FFStrError(ret));
  17.224 -        return -1;
  17.225 +        return SDL_SetError("Haptic: Error setting gain: %s.", FFStrError(ret));
  17.226      }
  17.227  
  17.228      return 0;
  17.229 @@ -1262,9 +1240,8 @@
  17.230      ret = FFDeviceSetForceFeedbackProperty(haptic->hwdata->device,
  17.231                                             FFPROP_AUTOCENTER, &val);
  17.232      if (ret != FF_OK) {
  17.233 -        SDL_SetError("Haptic: Error setting autocenter: %s.",
  17.234 -                     FFStrError(ret));
  17.235 -        return -1;
  17.236 +        return SDL_SetError("Haptic: Error setting autocenter: %s.",
  17.237 +                            FFStrError(ret));
  17.238      }
  17.239  
  17.240      return 0;
  17.241 @@ -1282,8 +1259,7 @@
  17.242      ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
  17.243                                             FFSFFC_PAUSE);
  17.244      if (ret != FF_OK) {
  17.245 -        SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
  17.246 -        return -1;
  17.247 +        return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
  17.248      }
  17.249  
  17.250      return 0;
  17.251 @@ -1301,8 +1277,7 @@
  17.252      ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
  17.253                                             FFSFFC_CONTINUE);
  17.254      if (ret != FF_OK) {
  17.255 -        SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
  17.256 -        return -1;
  17.257 +        return SDL_SetError("Haptic: Error pausing device: %s.", FFStrError(ret));
  17.258      }
  17.259  
  17.260      return 0;
  17.261 @@ -1320,8 +1295,7 @@
  17.262      ret = FFDeviceSendForceFeedbackCommand(haptic->hwdata->device,
  17.263                                             FFSFFC_STOPALL);
  17.264      if (ret != FF_OK) {
  17.265 -        SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret));
  17.266 -        return -1;
  17.267 +        return SDL_SetError("Haptic: Error stopping device: %s.", FFStrError(ret));
  17.268      }
  17.269  
  17.270      return 0;
    18.1 --- a/src/haptic/linux/SDL_syshaptic.c	Fri Mar 29 21:29:57 2013 -0400
    18.2 +++ b/src/haptic/linux/SDL_syshaptic.c	Sun Mar 31 12:48:50 2013 -0400
    18.3 @@ -92,9 +92,8 @@
    18.4      /* Ask device for what it has. */
    18.5      ret = 0;
    18.6      if (ioctl(fd, EVIOCGBIT(EV_FF, sizeof(features)), features) < 0) {
    18.7 -        SDL_SetError("Haptic: Unable to get device's features: %s",
    18.8 -                     strerror(errno));
    18.9 -        return -1;
   18.10 +        return SDL_SetError("Haptic: Unable to get device's features: %s",
   18.11 +                            strerror(errno));
   18.12      }
   18.13  
   18.14      /* Convert supported features to SDL_HAPTIC platform-neutral features. */
   18.15 @@ -309,9 +308,8 @@
   18.16      /* Open the character device */
   18.17      fd = open(SDL_hapticlist[haptic->index].fname, O_RDWR, 0);
   18.18      if (fd < 0) {
   18.19 -        SDL_SetError("Haptic: Unable to open %s: %s",
   18.20 -                     SDL_hapticlist[haptic->index], strerror(errno));
   18.21 -        return -1;
   18.22 +        return SDL_SetError("Haptic: Unable to open %s: %s",
   18.23 +                            SDL_hapticlist[haptic->index], strerror(errno));
   18.24      }
   18.25  
   18.26      /* Try to create the haptic. */
   18.27 @@ -340,9 +338,8 @@
   18.28          /* Open the device. */
   18.29          fd = open(SDL_hapticlist[i].fname, O_RDWR, 0);
   18.30          if (fd < 0) {
   18.31 -            SDL_SetError("Haptic: Unable to open %s: %s",
   18.32 -                         SDL_hapticlist[i], strerror(errno));
   18.33 -            return -1;
   18.34 +            return SDL_SetError("Haptic: Unable to open %s: %s",
   18.35 +                                SDL_hapticlist[i], strerror(errno));
   18.36          }
   18.37  
   18.38          /* Is it a mouse? */
   18.39 @@ -405,15 +402,13 @@
   18.40          }
   18.41      }
   18.42      if (i >= MAX_HAPTICS) {
   18.43 -        SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities");
   18.44 -        return -1;
   18.45 +        return SDL_SetError("Haptic: Joystick doesn't have Haptic capabilities");
   18.46      }
   18.47  
   18.48      fd = open(joystick->hwdata->fname, O_RDWR, 0);
   18.49      if (fd < 0) {
   18.50 -        SDL_SetError("Haptic: Unable to open %s: %s",
   18.51 -                     joystick->hwdata->fname, strerror(errno));
   18.52 -        return -1;
   18.53 +        return SDL_SetError("Haptic: Unable to open %s: %s",
   18.54 +                            joystick->hwdata->fname, strerror(errno));
   18.55      }
   18.56      ret = SDL_SYS_HapticOpenFromFD(haptic, fd); /* Already closes on error. */
   18.57      if (ret < 0) {
   18.58 @@ -544,8 +539,7 @@
   18.59          return (Uint16) tmp;
   18.60  
   18.61      default:
   18.62 -        SDL_SetError("Haptic: Unsupported direction type.");
   18.63 -        return (Uint16) - 1;
   18.64 +        return (Uint16) SDL_SetError("Haptic: Unsupported direction type.");
   18.65      }
   18.66  
   18.67      return 0;
   18.68 @@ -733,8 +727,7 @@
   18.69  
   18.70  
   18.71      default:
   18.72 -        SDL_SetError("Haptic: Unknown effect type.");
   18.73 -        return -1;
   18.74 +        return SDL_SetError("Haptic: Unknown effect type.");
   18.75      }
   18.76  
   18.77      return 0;
   18.78 @@ -754,8 +747,7 @@
   18.79      effect->hweffect = (struct haptic_hweffect *)
   18.80          SDL_malloc(sizeof(struct haptic_hweffect));
   18.81      if (effect->hweffect == NULL) {
   18.82 -        SDL_OutOfMemory();
   18.83 -        return -1;
   18.84 +        return SDL_OutOfMemory();
   18.85      }
   18.86  
   18.87      /* Prepare the ff_effect */
   18.88 @@ -802,9 +794,8 @@
   18.89  
   18.90      /* See if it can be uploaded. */
   18.91      if (ioctl(haptic->hwdata->fd, EVIOCSFF, &linux_effect) < 0) {
   18.92 -        SDL_SetError("Haptic: Error updating the effect: %s",
   18.93 -                     strerror(errno));
   18.94 -        return -1;
   18.95 +        return SDL_SetError("Haptic: Error updating the effect: %s",
   18.96 +                            strerror(errno));
   18.97      }
   18.98  
   18.99      /* Copy the new effect into memory. */
  18.100 @@ -831,8 +822,7 @@
  18.101      run.value = (iterations > INT_MAX) ? INT_MAX : iterations;
  18.102  
  18.103      if (write(haptic->hwdata->fd, (const void *) &run, sizeof(run)) < 0) {
  18.104 -        SDL_SetError("Haptic: Unable to run the effect: %s", strerror(errno));
  18.105 -        return -1;
  18.106 +        return SDL_SetError("Haptic: Unable to run the effect: %s", strerror(errno));
  18.107      }
  18.108  
  18.109      return 0;
  18.110 @@ -852,9 +842,8 @@
  18.111      stop.value = 0;
  18.112  
  18.113      if (write(haptic->hwdata->fd, (const void *) &stop, sizeof(stop)) < 0) {
  18.114 -        SDL_SetError("Haptic: Unable to stop the effect: %s",
  18.115 -                     strerror(errno));
  18.116 -        return -1;
  18.117 +        return SDL_SetError("Haptic: Unable to stop the effect: %s",
  18.118 +                            strerror(errno));
  18.119      }
  18.120  
  18.121      return 0;
  18.122 @@ -891,8 +880,7 @@
  18.123      ie.code = effect->hweffect->effect.id;
  18.124  
  18.125      if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
  18.126 -        SDL_SetError("Haptic: Error getting device status.");
  18.127 -        return -1;
  18.128 +        return SDL_SetError("Haptic: Error getting device status.");
  18.129      }
  18.130  
  18.131      return 0;
  18.132 @@ -915,8 +903,7 @@
  18.133      ie.value = (0xFFFFUL * gain) / 100;
  18.134  
  18.135      if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
  18.136 -        SDL_SetError("Haptic: Error setting gain: %s", strerror(errno));
  18.137 -        return -1;
  18.138 +        return SDL_SetError("Haptic: Error setting gain: %s", strerror(errno));
  18.139      }
  18.140  
  18.141      return 0;
  18.142 @@ -936,8 +923,7 @@
  18.143      ie.value = (0xFFFFUL * autocenter) / 100;
  18.144  
  18.145      if (write(haptic->hwdata->fd, &ie, sizeof(ie)) < 0) {
  18.146 -        SDL_SetError("Haptic: Error setting autocenter: %s", strerror(errno));
  18.147 -        return -1;
  18.148 +        return SDL_SetError("Haptic: Error setting autocenter: %s", strerror(errno));
  18.149      }
  18.150  
  18.151      return 0;
  18.152 @@ -977,9 +963,8 @@
  18.153          if (haptic->effects[i].hweffect != NULL) {
  18.154              ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]);
  18.155              if (ret < 0) {
  18.156 -                SDL_SetError
  18.157 +                return SDL_SetError
  18.158                      ("Haptic: Error while trying to stop all playing effects.");
  18.159 -                return -1;
  18.160              }
  18.161          }
  18.162      }
    19.1 --- a/src/haptic/windows/SDL_syshaptic.c	Fri Mar 29 21:29:57 2013 -0400
    19.2 +++ b/src/haptic/windows/SDL_syshaptic.c	Sun Mar 31 12:48:50 2013 -0400
    19.3 @@ -87,7 +87,7 @@
    19.4  /*
    19.5   * Prototypes.
    19.6   */
    19.7 -static void DI_SetError(const char *str, HRESULT err);
    19.8 +static int DI_SetError(const char *str, HRESULT err);
    19.9  static int DI_GUIDIsSame(const GUID * a, const GUID * b);
   19.10  static int SDL_SYS_HapticOpenFromInstance(SDL_Haptic * haptic,
   19.11                                            DIDEVICEINSTANCE instance);
   19.12 @@ -110,14 +110,14 @@
   19.13  /* 
   19.14   * Like SDL_SetError but for DX error codes.
   19.15   */
   19.16 -static void
   19.17 +static int
   19.18  DI_SetError(const char *str, HRESULT err)
   19.19  {
   19.20      /*
   19.21         SDL_SetError("Haptic: %s - %s: %s", str,
   19.22         DXGetErrorString8A(err), DXGetErrorDescription8A(err));
   19.23       */
   19.24 -    SDL_SetError("Haptic error %s", str);
   19.25 +    return SDL_SetError("Haptic error %s", str);
   19.26  }
   19.27  
   19.28  
   19.29 @@ -142,8 +142,7 @@
   19.30      HINSTANCE instance;
   19.31  
   19.32      if (dinput != NULL) {       /* Already open. */
   19.33 -        SDL_SetError("Haptic: SubSystem already open.");
   19.34 -        return -1;
   19.35 +        return SDL_SetError("Haptic: SubSystem already open.");
   19.36      }
   19.37  
   19.38      /* Clear all the memory. */
   19.39 @@ -153,8 +152,7 @@
   19.40  
   19.41      ret = WIN_CoInitialize();
   19.42      if (FAILED(ret)) {
   19.43 -        DI_SetError("Coinitialize", ret);
   19.44 -        return -1;
   19.45 +        return DI_SetError("Coinitialize", ret);
   19.46      }
   19.47  
   19.48      coinitialized = SDL_TRUE;
   19.49 @@ -163,23 +161,20 @@
   19.50                             &IID_IDirectInput8, (LPVOID) & dinput);
   19.51      if (FAILED(ret)) {
   19.52          SDL_SYS_HapticQuit();
   19.53 -        DI_SetError("CoCreateInstance", ret);
   19.54 -        return -1;
   19.55 +        return DI_SetError("CoCreateInstance", ret);
   19.56      }
   19.57  
   19.58      /* Because we used CoCreateInstance, we need to Initialize it, first. */
   19.59      instance = GetModuleHandle(NULL);
   19.60      if (instance == NULL) {
   19.61          SDL_SYS_HapticQuit();
   19.62 -        SDL_SetError("GetModuleHandle() failed with error code %d.",
   19.63 -                     GetLastError());
   19.64 -        return -1;
   19.65 +        return SDL_SetError("GetModuleHandle() failed with error code %d.",
   19.66 +                            GetLastError());
   19.67      }
   19.68      ret = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
   19.69      if (FAILED(ret)) {
   19.70          SDL_SYS_HapticQuit();
   19.71 -        DI_SetError("Initializing DirectInput device", ret);
   19.72 -        return -1;
   19.73 +        return DI_SetError("Initializing DirectInput device", ret);
   19.74      }
   19.75  
   19.76      /* Look for haptic devices. */
   19.77 @@ -191,8 +186,7 @@
   19.78                                     DIEDFL_ATTACHEDONLY);
   19.79      if (FAILED(ret)) {
   19.80          SDL_SYS_HapticQuit();
   19.81 -        DI_SetError("Enumerating DirectInput devices", ret);
   19.82 -        return -1;
   19.83 +        return DI_SetError("Enumerating DirectInput devices", ret);
   19.84      }
   19.85  
   19.86      if (!env || SDL_atoi(env)) {
   19.87 @@ -411,8 +405,7 @@
   19.88      haptic->effects = (struct haptic_effect *)
   19.89          SDL_malloc(sizeof(struct haptic_effect) * haptic->neffects);
   19.90      if (haptic->effects == NULL) {
   19.91 -        SDL_OutOfMemory();
   19.92 -        return -1;
   19.93 +        return SDL_OutOfMemory();
   19.94      }
   19.95      /* Clear the memory */
   19.96      SDL_memset(haptic->effects, 0,
   19.97 @@ -422,8 +415,7 @@
   19.98      if (haptic->hwdata == NULL) {
   19.99          SDL_free(haptic->effects);
  19.100          haptic->effects = NULL;
  19.101 -        SDL_OutOfMemory();
  19.102 -        return -1;
  19.103 +        return SDL_OutOfMemory();
  19.104      }
  19.105      SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
  19.106  
  19.107 @@ -690,8 +682,7 @@
  19.108      haptic->hwdata = (struct haptic_hwdata *)
  19.109          SDL_malloc(sizeof(*haptic->hwdata));
  19.110      if (haptic->hwdata == NULL) {
  19.111 -        SDL_OutOfMemory();
  19.112 -        return -1;
  19.113 +        return SDL_OutOfMemory();
  19.114      }
  19.115      SDL_memset(haptic->hwdata, 0, sizeof(*haptic->hwdata));
  19.116  
  19.117 @@ -809,8 +800,7 @@
  19.118      /* Has axes. */
  19.119      rglDir = SDL_malloc(sizeof(LONG) * naxes);
  19.120      if (rglDir == NULL) {
  19.121 -        SDL_OutOfMemory();
  19.122 -        return -1;
  19.123 +        return SDL_OutOfMemory();
  19.124      }
  19.125      SDL_memset(rglDir, 0, sizeof(LONG) * naxes);
  19.126      effect->rglDirection = rglDir;
  19.127 @@ -838,8 +828,7 @@
  19.128          return 0;
  19.129  
  19.130      default:
  19.131 -        SDL_SetError("Haptic: Unknown direction type.");
  19.132 -        return -1;
  19.133 +        return SDL_SetError("Haptic: Unknown direction type.");
  19.134      }
  19.135  }
  19.136  
  19.137 @@ -875,8 +864,7 @@
  19.138      /* Envelope. */
  19.139      envelope = SDL_malloc(sizeof(DIENVELOPE));
  19.140      if (envelope == NULL) {
  19.141 -        SDL_OutOfMemory();
  19.142 -        return -1;
  19.143 +        return SDL_OutOfMemory();
  19.144      }
  19.145      SDL_memset(envelope, 0, sizeof(DIENVELOPE));
  19.146      dest->lpEnvelope = envelope;
  19.147 @@ -887,8 +875,7 @@
  19.148      if (dest->cAxes > 0) {
  19.149          axes = SDL_malloc(sizeof(DWORD) * dest->cAxes);
  19.150          if (axes == NULL) {
  19.151 -            SDL_OutOfMemory();
  19.152 -            return -1;
  19.153 +            return SDL_OutOfMemory();
  19.154          }
  19.155          axes[0] = haptic->hwdata->axes[0];      /* Always at least one axis. */
  19.156          if (dest->cAxes > 1) {
  19.157 @@ -907,8 +894,7 @@
  19.158          hap_constant = &src->constant;
  19.159          constant = SDL_malloc(sizeof(DICONSTANTFORCE));
  19.160          if (constant == NULL) {
  19.161 -            SDL_OutOfMemory();
  19.162 -            return -1;
  19.163 +            return SDL_OutOfMemory();
  19.164          }
  19.165          SDL_memset(constant, 0, sizeof(DICONSTANTFORCE));
  19.166  
  19.167 @@ -951,8 +937,7 @@
  19.168          hap_periodic = &src->periodic;
  19.169          periodic = SDL_malloc(sizeof(DIPERIODIC));
  19.170          if (periodic == NULL) {
  19.171 -            SDL_OutOfMemory();
  19.172 -            return -1;
  19.173 +            return SDL_OutOfMemory();
  19.174          }
  19.175          SDL_memset(periodic, 0, sizeof(DIPERIODIC));
  19.176  
  19.177 @@ -997,8 +982,7 @@
  19.178          hap_condition = &src->condition;
  19.179          condition = SDL_malloc(sizeof(DICONDITION) * dest->cAxes);
  19.180          if (condition == NULL) {
  19.181 -            SDL_OutOfMemory();
  19.182 -            return -1;
  19.183 +            return SDL_OutOfMemory();
  19.184          }
  19.185          SDL_memset(condition, 0, sizeof(DICONDITION));
  19.186  
  19.187 @@ -1040,8 +1024,7 @@
  19.188          hap_ramp = &src->ramp;
  19.189          ramp = SDL_malloc(sizeof(DIRAMPFORCE));
  19.190          if (ramp == NULL) {
  19.191 -            SDL_OutOfMemory();
  19.192 -            return -1;
  19.193 +            return SDL_OutOfMemory();
  19.194          }
  19.195          SDL_memset(ramp, 0, sizeof(DIRAMPFORCE));
  19.196  
  19.197 @@ -1079,8 +1062,7 @@
  19.198          hap_custom = &src->custom;
  19.199          custom = SDL_malloc(sizeof(DICUSTOMFORCE));
  19.200          if (custom == NULL) {
  19.201 -            SDL_OutOfMemory();
  19.202 -            return -1;
  19.203 +            return SDL_OutOfMemory();
  19.204          }
  19.205          SDL_memset(custom, 0, sizeof(DICUSTOMFORCE));
  19.206  
  19.207 @@ -1124,8 +1106,7 @@
  19.208  
  19.209  
  19.210      default:
  19.211 -        SDL_SetError("Haptic: Unknown effect type.");
  19.212 -        return -1;
  19.213 +        return SDL_SetError("Haptic: Unknown effect type.");
  19.214      }
  19.215  
  19.216      return 0;
  19.217 @@ -1358,8 +1339,7 @@
  19.218      /* Run the effect. */
  19.219      ret = IDirectInputEffect_Start(effect->hweffect->ref, iter, 0);
  19.220      if (FAILED(ret)) {
  19.221 -        DI_SetError("Running the effect", ret);
  19.222 -        return -1;
  19.223 +        return DI_SetError("Running the effect", ret);
  19.224      }
  19.225  
  19.226      return 0;
  19.227 @@ -1381,8 +1361,7 @@
  19.228  
  19.229      ret = IDirectInputEffect_Stop(effect->hweffect->ref);
  19.230      if (FAILED(ret)) {
  19.231 -        DI_SetError("Unable to stop effect", ret);
  19.232 -        return -1;
  19.233 +        return DI_SetError("Unable to stop effect", ret);
  19.234      }
  19.235  
  19.236      return 0;
  19.237 @@ -1424,8 +1403,7 @@
  19.238  
  19.239      ret = IDirectInputEffect_GetEffectStatus(effect->hweffect->ref, &status);
  19.240      if (FAILED(ret)) {
  19.241 -        DI_SetError("Getting effect status", ret);
  19.242 -        return -1;
  19.243 +        return DI_SetError("Getting effect status", ret);
  19.244      }
  19.245  
  19.246      if (status == 0)
  19.247 @@ -1454,8 +1432,7 @@
  19.248      ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
  19.249                                            DIPROP_FFGAIN, &dipdw.diph);
  19.250      if (FAILED(ret)) {
  19.251 -        DI_SetError("Setting gain", ret);
  19.252 -        return -1;
  19.253 +        return DI_SetError("Setting gain", ret);
  19.254      }
  19.255  
  19.256      return 0;
  19.257 @@ -1483,8 +1460,7 @@
  19.258      ret = IDirectInputDevice8_SetProperty(haptic->hwdata->device,
  19.259                                            DIPROP_AUTOCENTER, &dipdw.diph);
  19.260      if (FAILED(ret)) {
  19.261 -        DI_SetError("Setting autocenter", ret);
  19.262 -        return -1;
  19.263 +        return DI_SetError("Setting autocenter", ret);
  19.264      }
  19.265  
  19.266      return 0;
  19.267 @@ -1503,8 +1479,7 @@
  19.268      ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
  19.269                                                         DISFFC_PAUSE);
  19.270      if (FAILED(ret)) {
  19.271 -        DI_SetError("Pausing the device", ret);
  19.272 -        return -1;
  19.273 +        return DI_SetError("Pausing the device", ret);
  19.274      }
  19.275  
  19.276      return 0;
  19.277 @@ -1523,8 +1498,7 @@
  19.278      ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
  19.279                                                         DISFFC_CONTINUE);
  19.280      if (FAILED(ret)) {
  19.281 -        DI_SetError("Pausing the device", ret);
  19.282 -        return -1;
  19.283 +        return DI_SetError("Pausing the device", ret);
  19.284      }
  19.285  
  19.286      return 0;
  19.287 @@ -1548,8 +1522,7 @@
  19.288      ret = IDirectInputDevice8_SendForceFeedbackCommand(haptic->hwdata->device,
  19.289                                                         DISFFC_STOPALL);
  19.290      if (FAILED(ret)) {
  19.291 -        DI_SetError("Stopping the device", ret);
  19.292 -        return -1;
  19.293 +        return DI_SetError("Stopping the device", ret);
  19.294      }
  19.295  
  19.296      return 0;
    20.1 --- a/src/joystick/SDL_gamecontroller.c	Fri Mar 29 21:29:57 2013 -0400
    20.2 +++ b/src/joystick/SDL_gamecontroller.c	Sun Mar 31 12:48:50 2013 -0400
    20.3 @@ -722,10 +722,9 @@
    20.4  	} else {
    20.5  		pControllerMapping = SDL_malloc( sizeof(*pControllerMapping) );
    20.6  		if (!pControllerMapping) {
    20.7 -			SDL_OutOfMemory();
    20.8  			SDL_free( pchName );
    20.9  			SDL_free( pchMapping );
   20.10 -			return -1;
   20.11 +			return SDL_OutOfMemory();
   20.12  		}
   20.13  #ifdef SDL_JOYSTICK_DINPUT
   20.14  		if ( is_xinput_mapping )
    21.1 --- a/src/joystick/SDL_joystick.c	Fri Mar 29 21:29:57 2013 -0400
    21.2 +++ b/src/joystick/SDL_joystick.c	Sun Mar 31 12:48:50 2013 -0400
    21.3 @@ -303,8 +303,7 @@
    21.4          joystick->balls[ball].dx = 0;
    21.5          joystick->balls[ball].dy = 0;
    21.6      } else {
    21.7 -        SDL_SetError("Joystick only has %d balls", joystick->nballs);
    21.8 -        retval = -1;
    21.9 +        return SDL_SetError("Joystick only has %d balls", joystick->nballs);
   21.10      }
   21.11      return (retval);
   21.12  }
    22.1 --- a/src/joystick/android/SDL_androidjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    22.2 +++ b/src/joystick/android/SDL_androidjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    22.3 @@ -77,31 +77,26 @@
    22.4  {
    22.5      int i = 0;
    22.6      if (Android_JNI_JoystickInit() < 0)
    22.7 -        return (-1);
    22.8 +        return -1;
    22.9      SYS_numjoysticks = Android_JNI_GetNumJoysticks();
   22.10      SYS_Joysticks = (SDL_Joystick **)SDL_malloc(SYS_numjoysticks*sizeof(SDL_Joystick *));
   22.11 -    if (SYS_Joysticks == NULL)
   22.12 -    {
   22.13 -        SDL_OutOfMemory();
   22.14 -        return (-1);
   22.15 +    if (SYS_Joysticks == NULL) {
   22.16 +        return SDL_OutOfMemory();
   22.17      }
   22.18      SYS_JoystickNames = (char **)SDL_malloc(SYS_numjoysticks*sizeof(char *));
   22.19 -    if (SYS_JoystickNames == NULL)
   22.20 -    {
   22.21 +    if (SYS_JoystickNames == NULL) {
   22.22          SDL_free(SYS_Joysticks);
   22.23          SYS_Joysticks = NULL;
   22.24 -        SDL_OutOfMemory();
   22.25 -        return (-1);
   22.26 +        return SDL_OutOfMemory();
   22.27      }
   22.28      SDL_memset(SYS_JoystickNames, 0, (SYS_numjoysticks*sizeof(char *)));
   22.29      SDL_memset(SYS_Joysticks, 0, (SYS_numjoysticks*sizeof(SDL_Joystick *)));
   22.30  
   22.31 -    for (i = 0; i < SYS_numjoysticks; i++)
   22.32 -    {
   22.33 +    for (i = 0; i < SYS_numjoysticks; i++) {
   22.34          SYS_JoystickNames[i] = Android_JNI_GetJoystickName(i);
   22.35      }
   22.36  
   22.37 -    return (SYS_numjoysticks);
   22.38 +    return SYS_numjoysticks;
   22.39  }
   22.40  
   22.41  int SDL_SYS_NumJoysticks()
    23.1 --- a/src/joystick/beos/SDL_bejoystick.cc	Fri Mar 29 21:29:57 2013 -0400
    23.2 +++ b/src/joystick/beos/SDL_bejoystick.cc	Sun Mar 31 12:48:50 2013 -0400
    23.3 @@ -125,8 +125,7 @@
    23.4          joystick->hwdata = (struct joystick_hwdata *)
    23.5              SDL_malloc(sizeof(*joystick->hwdata));
    23.6          if (joystick->hwdata == NULL) {
    23.7 -            SDL_OutOfMemory();
    23.8 -            return (-1);
    23.9 +            return SDL_OutOfMemory();
   23.10          }
   23.11          SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
   23.12          stick = new BJoystick;
   23.13 @@ -134,9 +133,8 @@
   23.14  
   23.15          /* Open the requested joystick for use */
   23.16          if (stick->Open(SDL_joyport[device_index]) == B_ERROR) {
   23.17 -            SDL_SetError("Unable to open joystick");
   23.18              SDL_SYS_JoystickClose(joystick);
   23.19 -            return (-1);
   23.20 +            return SDL_SetError("Unable to open joystick");
   23.21          }
   23.22  
   23.23          /* Set the joystick to calibrated mode */
   23.24 @@ -152,9 +150,8 @@
   23.25          joystick->hwdata->new_hats = (uint8 *)
   23.26              SDL_malloc(joystick->nhats * sizeof(uint8));
   23.27          if (!joystick->hwdata->new_hats || !joystick->hwdata->new_axes) {
   23.28 -            SDL_OutOfMemory();
   23.29              SDL_SYS_JoystickClose(joystick);
   23.30 -            return (-1);
   23.31 +            return SDL_OutOfMemory();
   23.32          }
   23.33  
   23.34          /* We're done! */
    24.1 --- a/src/joystick/bsd/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    24.2 +++ b/src/joystick/bsd/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    24.3 @@ -297,17 +297,15 @@
    24.4  
    24.5      fd = open(path, O_RDONLY);
    24.6      if (fd == -1) {
    24.7 -        SDL_SetError("%s: %s", path, strerror(errno));
    24.8 -        return (-1);
    24.9 +        return SDL_SetError("%s: %s", path, strerror(errno));
   24.10      }
   24.11  
   24.12      joy->instance_id = device_index;
   24.13      hw = (struct joystick_hwdata *)
   24.14          SDL_malloc(sizeof(struct joystick_hwdata));
   24.15      if (hw == NULL) {
   24.16 -        SDL_OutOfMemory();
   24.17          close(fd);
   24.18 -        return (-1);
   24.19 +        return SDL_OutOfMemory();
   24.20      }
   24.21      joy->hwdata = hw;
   24.22      hw->fd = fd;
   24.23 @@ -634,8 +632,7 @@
   24.24  #endif
   24.25  
   24.26      if (len < 0) {
   24.27 -        SDL_SetError("Negative HID report size");
   24.28 -        return (-1);
   24.29 +        return SDL_SetError("Negative HID report size");
   24.30      }
   24.31      r->size = len;
   24.32  
   24.33 @@ -647,15 +644,14 @@
   24.34                              r->size);
   24.35  #endif
   24.36          if (r->buf == NULL) {
   24.37 -            SDL_OutOfMemory();
   24.38 -            return (-1);
   24.39 +            return SDL_OutOfMemory();
   24.40          }
   24.41      } else {
   24.42          r->buf = NULL;
   24.43      }
   24.44  
   24.45      r->status = SREPORT_CLEAN;
   24.46 -    return (0);
   24.47 +    return 0;
   24.48  }
   24.49  
   24.50  static void
    25.1 --- a/src/joystick/darwin/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    25.2 +++ b/src/joystick/darwin/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    25.3 @@ -169,7 +169,7 @@
    25.4                                                       &(pDevice->interface));
    25.5              if (S_OK != plugInResult)
    25.6                  HIDReportErrorNum
    25.7 -                    ("CouldnŐt query HID class device interface from plugInInterface",
    25.8 +                    ("Couldn't query HID class device interface from plugInInterface",
    25.9                       plugInResult);
   25.10              (*ppPlugInInterface)->Release(ppPlugInInterface);
   25.11          } else
   25.12 @@ -724,14 +724,12 @@
   25.13  	io_iterator_t portIterator = 0;
   25.14  
   25.15      if (gpDeviceList) {
   25.16 -        SDL_SetError("Joystick: Device list already inited.");
   25.17 -        return -1;
   25.18 +        return SDL_SetError("Joystick: Device list already inited.");
   25.19      }
   25.20  
   25.21      result = IOMasterPort(bootstrap_port, &masterPort);
   25.22      if (kIOReturnSuccess != result) {
   25.23 -        SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
   25.24 -        return -1;
   25.25 +        return SDL_SetError("Joystick: IOMasterPort error with bootstrap_port.");
   25.26      }
   25.27  
   25.28      /* Set up a matching dictionary to search I/O Registry by class name for all HID class devices. */
   25.29 @@ -750,9 +748,8 @@
   25.30             CFDictionarySetValue (hidMatchDictionary, CFSTR (kIOHIDPrimaryUsagePageKey), refUsagePage);
   25.31           */
   25.32      } else {
   25.33 -        SDL_SetError
   25.34 +        return SDL_SetError
   25.35              ("Joystick: Failed to get HID CFMutableDictionaryRef via IOServiceMatching.");
   25.36 -        return -1;
   25.37      }
   25.38  
   25.39      /*/ Now search I/O Registry for matching devices. */
   25.40 @@ -761,8 +758,7 @@
   25.41                                       &hidObjectIterator);
   25.42      /* Check for errors */
   25.43      if (kIOReturnSuccess != result) {
   25.44 -        SDL_SetError("Joystick: Couldn't create a HID object iterator.");
   25.45 -        return -1;
   25.46 +        return SDL_SetError("Joystick: Couldn't create a HID object iterator.");
   25.47      }
   25.48      if (!hidObjectIterator) {   /* there are no joysticks */
   25.49          gpDeviceList = NULL;
    26.1 --- a/src/joystick/dummy/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    26.2 +++ b/src/joystick/dummy/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    26.3 @@ -73,8 +73,7 @@
    26.4  int
    26.5  SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
    26.6  {
    26.7 -    SDL_SetError("Logic error: No joysticks available");
    26.8 -    return (-1);
    26.9 +    return SDL_SetError("Logic error: No joysticks available");
   26.10  }
   26.11  
   26.12  /* Function to determine is this joystick is attached to the system right now */
    27.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Fri Mar 29 21:29:57 2013 -0400
    27.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Sun Mar 31 12:48:50 2013 -0400
    27.3 @@ -122,15 +122,12 @@
    27.4  		[[SDLUIAccelerationDelegate sharedDelegate] shutdown];
    27.5  	}
    27.6  	SDL_SetError("No joystick open with that index");
    27.7 -
    27.8 -    return;
    27.9  }
   27.10  
   27.11  /* Function to perform any system-specific joystick related cleanup */
   27.12  void
   27.13  SDL_SYS_JoystickQuit(void)
   27.14  {
   27.15 -    return;
   27.16  }
   27.17  
   27.18  SDL_JoystickGUID SDL_SYS_JoystickGetDeviceGUID( int device_index )
    28.1 --- a/src/joystick/linux/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    28.2 +++ b/src/joystick/linux/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    28.3 @@ -387,8 +387,7 @@
    28.4      SDL_assert(udev == NULL);
    28.5      udev = UDEV_udev_new();
    28.6      if (udev == NULL) {
    28.7 -        SDL_SetError("udev_new() failed");
    28.8 -        return -1;
    28.9 +        return SDL_SetError("udev_new() failed");
   28.10      }
   28.11  
   28.12      udev_mon = UDEV_udev_monitor_new_from_netlink(udev, "udev");
   28.13 @@ -400,8 +399,7 @@
   28.14  
   28.15      enumerate = UDEV_udev_enumerate_new(udev);
   28.16      if (enumerate == NULL) {
   28.17 -        SDL_SetError("udev_enumerate_new() failed");
   28.18 -        return -1;
   28.19 +        return SDL_SetError("udev_enumerate_new() failed");
   28.20      }
   28.21  
   28.22      UDEV_udev_enumerate_add_match_subsystem(enumerate, "input");
   28.23 @@ -725,15 +723,13 @@
   28.24      int fd = -1;
   28.25  
   28.26      if (item == NULL) {
   28.27 -        SDL_SetError("No such device");
   28.28 -        return -1;
   28.29 +        return SDL_SetError("No such device");
   28.30      }
   28.31  
   28.32      fname = item->path;
   28.33      fd = open(fname, O_RDONLY, 0);
   28.34      if (fd < 0) {
   28.35 -        SDL_SetError("Unable to open %s", fname);
   28.36 -        return -1;
   28.37 +        return SDL_SetError("Unable to open %s", fname);
   28.38      }
   28.39  
   28.40      joystick->instance_id = item->device_instance;
   28.41 @@ -741,8 +737,7 @@
   28.42          SDL_malloc(sizeof(*joystick->hwdata));
   28.43      if (joystick->hwdata == NULL) {
   28.44          close(fd);
   28.45 -        SDL_OutOfMemory();
   28.46 -        return (-1);
   28.47 +        return SDL_OutOfMemory();
   28.48      }
   28.49      SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
   28.50      joystick->hwdata->item = item;
   28.51 @@ -753,8 +748,7 @@
   28.52          SDL_free(joystick->hwdata);
   28.53          joystick->hwdata = NULL;
   28.54          close(fd);
   28.55 -        SDL_OutOfMemory();
   28.56 -        return (-1);
   28.57 +        return SDL_OutOfMemory();
   28.58      }
   28.59  
   28.60      SDL_assert(item->hwdata == NULL);
    29.1 --- a/src/joystick/psp/SDL_sysjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    29.2 +++ b/src/joystick/psp/SDL_sysjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    29.3 @@ -113,13 +113,11 @@
    29.4  
    29.5  	/* Start thread to read data */
    29.6  	if((pad_sem =  SDL_CreateSemaphore(1)) == NULL) {
    29.7 -		SDL_SetError("Can't create input semaphore\n");
    29.8 -		return -1;
    29.9 +		return SDL_SetError("Can't create input semaphore");
   29.10  	}
   29.11  	running = 1;
   29.12  	if((thread = SDL_CreateThread(JoystickUpdate, "JoySitckThread",NULL)) == NULL) {
   29.13 -		SDL_SetError("Can't create input thread\n");
   29.14 -		return -1;
   29.15 +		return SDL_SetError("Can't create input thread");
   29.16  	}
   29.17  
   29.18  	/* Create an accurate map from analog inputs (0 to 255) 
    30.1 --- a/src/joystick/windows/SDL_dxjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    30.2 +++ b/src/joystick/windows/SDL_dxjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    30.3 @@ -159,7 +159,7 @@
    30.4  static JoyStick_DeviceData *SYS_Joystick;    /* array to hold joystick ID values */
    30.5  
    30.6  /* local prototypes */
    30.7 -static void SetDIerror(const char *function, HRESULT code);
    30.8 +static int SetDIerror(const char *function, HRESULT code);
    30.9  static BOOL CALLBACK EnumJoysticksCallback(const DIDEVICEINSTANCE *
   30.10                                             pdidInstance, VOID * pContext);
   30.11  static BOOL CALLBACK EnumDevObjectsCallback(LPCDIDEVICEOBJECTINSTANCE dev,
   30.12 @@ -352,14 +352,14 @@
   30.13  
   30.14  
   30.15  /* Convert a DirectInput return code to a text message */
   30.16 -static void
   30.17 +static int
   30.18  SetDIerror(const char *function, HRESULT code)
   30.19  {
   30.20      /*
   30.21 -    SDL_SetError("%s() [%s]: %s", function,
   30.22 +    return SDL_SetError("%s() [%s]: %s", function,
   30.23                   DXGetErrorString9A(code), DXGetErrorDescription9A(code));
   30.24       */
   30.25 -    SDL_SetError("%s() DirectX error %d", function, code);
   30.26 +    return SDL_SetError("%s() DirectX error %d", function, code);
   30.27  }
   30.28  
   30.29  
   30.30 @@ -565,17 +565,13 @@
   30.31  
   30.32  	if (!RegisterClassEx (&wincl))
   30.33  	{		
   30.34 -		SDL_SetError("Failed to create register class for joystick autodetect.",
   30.35 -		GetLastError());
   30.36 -		return -1;
   30.37 +		return SDL_SetError("Failed to create register class for joystick autodetect.", GetLastError());
   30.38  	}
   30.39  
   30.40  	messageWindow = (HWND)CreateWindowEx( 0,  L"Message", NULL, 0, 0, 0, 0, 0, HWND_MESSAGE, NULL, NULL, NULL );
   30.41  	if ( !messageWindow )
   30.42  	{
   30.43 -		SDL_SetError("Failed to create message window for joystick autodetect.",
   30.44 -			GetLastError());
   30.45 -		return -1;
   30.46 +		return SDL_SetError("Failed to create message window for joystick autodetect.", GetLastError());
   30.47  	}
   30.48  
   30.49  	SDL_memset(&dbh, 0x0, sizeof(dbh));
   30.50 @@ -587,9 +583,7 @@
   30.51  	hNotify = RegisterDeviceNotification( messageWindow, &dbh, DEVICE_NOTIFY_WINDOW_HANDLE );
   30.52  	if ( !hNotify )
   30.53  	{
   30.54 -		SDL_SetError("Failed to create notify device for joystick autodetect.",
   30.55 -			GetLastError());
   30.56 -		return -1;
   30.57 +		return SDL_SetError("Failed to create notify device for joystick autodetect.", GetLastError());
   30.58  	}
   30.59  
   30.60  	SDL_LockMutex( s_mutexJoyStickEnum );
   30.61 @@ -674,8 +668,7 @@
   30.62  
   30.63      result = WIN_CoInitialize();
   30.64      if (FAILED(result)) {
   30.65 -        SetDIerror("CoInitialize", result);
   30.66 -        return (-1);
   30.67 +        return SetDIerror("CoInitialize", result);
   30.68      }
   30.69  
   30.70      coinitialized = SDL_TRUE;
   30.71 @@ -685,24 +678,20 @@
   30.72  
   30.73      if (FAILED(result)) {
   30.74          SDL_SYS_JoystickQuit();
   30.75 -        SetDIerror("CoCreateInstance", result);
   30.76 -        return (-1);
   30.77 +        return SetDIerror("CoCreateInstance", result);
   30.78      }
   30.79  
   30.80      /* Because we used CoCreateInstance, we need to Initialize it, first. */
   30.81      instance = GetModuleHandle(NULL);
   30.82      if (instance == NULL) {
   30.83          SDL_SYS_JoystickQuit();
   30.84 -        SDL_SetError("GetModuleHandle() failed with error code %d.",
   30.85 -                     GetLastError());
   30.86 -        return (-1);
   30.87 +        return SDL_SetError("GetModuleHandle() failed with error code %d.", GetLastError());
   30.88      }
   30.89      result = IDirectInput8_Initialize(dinput, instance, DIRECTINPUT_VERSION);
   30.90  
   30.91      if (FAILED(result)) {
   30.92          SDL_SYS_JoystickQuit();
   30.93 -        SetDIerror("IDirectInput::Initialize", result);
   30.94 -        return (-1);
   30.95 +        return SetDIerror("IDirectInput::Initialize", result);
   30.96      }
   30.97  
   30.98      s_mutexJoyStickEnum = SDL_CreateMutex();
   30.99 @@ -967,8 +956,7 @@
  30.100      joystick->hwdata =
  30.101          (struct joystick_hwdata *) SDL_malloc(sizeof(struct joystick_hwdata));
  30.102      if (joystick->hwdata == NULL) {
  30.103 -        SDL_OutOfMemory();
  30.104 -        return (-1);
  30.105 +        return SDL_OutOfMemory();
  30.106      }
  30.107      SDL_memset(joystick->hwdata, 0, sizeof(struct joystick_hwdata));
  30.108      joystick->hwdata->buffered = 1;
  30.109 @@ -1040,8 +1028,7 @@
  30.110  			IDirectInput8_CreateDevice(dinput,
  30.111  									  &(joystickdevice->dxdevice.guidInstance), &device, NULL);
  30.112  		if (FAILED(result)) {
  30.113 -			SetDIerror("IDirectInput::CreateDevice", result);
  30.114 -			return (-1);
  30.115 +			return SetDIerror("IDirectInput::CreateDevice", result);
  30.116  		}
  30.117  
  30.118  		/* Now get the IDirectInputDevice8 interface, instead. */
  30.119 @@ -1053,8 +1040,7 @@
  30.120  		IDirectInputDevice8_Release(device);
  30.121  
  30.122  		if (FAILED(result)) {
  30.123 -			SetDIerror("IDirectInputDevice8::QueryInterface", result);
  30.124 -			return (-1);
  30.125 +			return SetDIerror("IDirectInputDevice8::QueryInterface", result);
  30.126  		}
  30.127  
  30.128  		/* Aquire shared access. Exclusive access is required for forces,
  30.129 @@ -1065,8 +1051,7 @@
  30.130  													DISCL_NONEXCLUSIVE |
  30.131  													DISCL_BACKGROUND);
  30.132  		if (FAILED(result)) {
  30.133 -			SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
  30.134 -			return (-1);
  30.135 +			return SetDIerror("IDirectInputDevice8::SetCooperativeLevel", result);
  30.136  		}
  30.137  
  30.138  		/* Use the extended data structure: DIJOYSTATE2. */
  30.139 @@ -1074,8 +1059,7 @@
  30.140  			IDirectInputDevice8_SetDataFormat(joystick->hwdata->InputDevice,
  30.141  											  &c_dfDIJoystick2);
  30.142  		if (FAILED(result)) {
  30.143 -			SetDIerror("IDirectInputDevice8::SetDataFormat", result);
  30.144 -			return (-1);
  30.145 +			return SetDIerror("IDirectInputDevice8::SetDataFormat", result);
  30.146  		}
  30.147  
  30.148  		/* Get device capabilities */
  30.149 @@ -1084,8 +1068,7 @@
  30.150  												&joystick->hwdata->Capabilities);
  30.151  
  30.152  		if (FAILED(result)) {
  30.153 -			SetDIerror("IDirectInputDevice8::GetCapabilities", result);
  30.154 -			return (-1);
  30.155 +			return SetDIerror("IDirectInputDevice8::GetCapabilities", result);
  30.156  		}
  30.157  
  30.158  		/* Force capable? */
  30.159 @@ -1094,8 +1077,7 @@
  30.160  			result = IDirectInputDevice8_Acquire(joystick->hwdata->InputDevice);
  30.161  
  30.162  			if (FAILED(result)) {
  30.163 -				SetDIerror("IDirectInputDevice8::Acquire", result);
  30.164 -				return (-1);
  30.165 +				return SetDIerror("IDirectInputDevice8::Acquire", result);
  30.166  			}
  30.167  
  30.168  			/* reset all accuators. */
  30.169 @@ -1106,17 +1088,14 @@
  30.170  
  30.171  			/* Not necessarily supported, ignore if not supported.
  30.172  			if (FAILED(result)) {
  30.173 -				SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand",
  30.174 -						   result);
  30.175 -				return (-1);
  30.176 +				return SetDIerror("IDirectInputDevice8::SendForceFeedbackCommand", result);
  30.177  			}
  30.178  			*/
  30.179  
  30.180  			result = IDirectInputDevice8_Unacquire(joystick->hwdata->InputDevice);
  30.181  
  30.182  			if (FAILED(result)) {
  30.183 -				SetDIerror("IDirectInputDevice8::Unacquire", result);
  30.184 -				return (-1);
  30.185 +				return SetDIerror("IDirectInputDevice8::Unacquire", result);
  30.186  			}
  30.187  
  30.188  			/* Turn on auto-centering for a ForceFeedback device (until told
  30.189 @@ -1131,8 +1110,7 @@
  30.190  
  30.191  			/* Not necessarily supported, ignore if not supported.
  30.192  			if (FAILED(result)) {
  30.193 -				SetDIerror("IDirectInputDevice8::SetProperty", result);
  30.194 -				return (-1);
  30.195 +				return SetDIerror("IDirectInputDevice8::SetProperty", result);
  30.196  			}
  30.197  			*/
  30.198  		}
  30.199 @@ -1160,8 +1138,7 @@
  30.200  			 * to use less reliable polling. */
  30.201  			joystick->hwdata->buffered = 0;
  30.202  		} else if (FAILED(result)) {
  30.203 -			SetDIerror("IDirectInputDevice8::SetProperty", result);
  30.204 -			return (-1);
  30.205 +			return SetDIerror("IDirectInputDevice8::SetProperty", result);
  30.206  		}
  30.207  	}
  30.208      return (0);
    31.1 --- a/src/joystick/windows/SDL_mmjoystick.c	Fri Mar 29 21:29:57 2013 -0400
    31.2 +++ b/src/joystick/windows/SDL_mmjoystick.c	Sun Mar 31 12:48:50 2013 -0400
    31.3 @@ -244,8 +244,7 @@
    31.4      joystick->hwdata =
    31.5          (struct joystick_hwdata *) SDL_malloc(sizeof(*joystick->hwdata));
    31.6      if (joystick->hwdata == NULL) {
    31.7 -        SDL_OutOfMemory();
    31.8 -        return (-1);
    31.9 +        return SDL_OutOfMemory();
   31.10      }
   31.11      SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
   31.12  
    32.1 --- a/src/main/beos/SDL_BeApp.cc	Fri Mar 29 21:29:57 2013 -0400
    32.2 +++ b/src/main/beos/SDL_BeApp.cc	Sun Mar 31 12:48:50 2013 -0400
    32.3 @@ -64,8 +64,7 @@
    32.4      if (SDL_BeAppActive <= 0) {
    32.5          SDL_AppThread = SDL_CreateThread(StartBeApp, "SDLApplication", NULL);
    32.6          if (SDL_AppThread == NULL) {
    32.7 -            SDL_SetError("Couldn't create BApplication thread");
    32.8 -            return (-1);
    32.9 +            return SDL_SetError("Couldn't create BApplication thread");
   32.10          }
   32.11  
   32.12          /* Change working to directory to that of executable */
    33.1 --- a/src/render/SDL_render.c	Fri Mar 29 21:29:57 2013 -0400
    33.2 +++ b/src/render/SDL_render.c	Sun Mar 31 12:48:50 2013 -0400
    33.3 @@ -82,9 +82,8 @@
    33.4  SDL_GetRenderDriverInfo(int index, SDL_RendererInfo * info)
    33.5  {
    33.6      if (index < 0 || index >= SDL_GetNumRenderDrivers()) {
    33.7 -        SDL_SetError("index must be in the range of 0 - %d",
    33.8 -                     SDL_GetNumRenderDrivers() - 1);
    33.9 -        return -1;
   33.10 +        return SDL_SetError("index must be in the range of 0 - %d",
   33.11 +                            SDL_GetNumRenderDrivers() - 1);
   33.12      }
   33.13      *info = render_drivers[index]->info;
   33.14      return 0;
   33.15 @@ -695,8 +694,7 @@
   33.16          temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
   33.17          temp_pixels = SDL_malloc(rect->h * temp_pitch);
   33.18          if (!temp_pixels) {
   33.19 -            SDL_OutOfMemory();
   33.20 -            return -1;
   33.21 +            return SDL_OutOfMemory();
   33.22          }
   33.23          SDL_SW_CopyYUVToRGB(texture->yuv, rect, native->format,
   33.24                              rect->w, rect->h, temp_pixels, temp_pitch);
   33.25 @@ -732,8 +730,7 @@
   33.26          temp_pitch = (((rect->w * SDL_BYTESPERPIXEL(native->format)) + 3) & ~3);
   33.27          temp_pixels = SDL_malloc(rect->h * temp_pitch);
   33.28          if (!temp_pixels) {
   33.29 -            SDL_OutOfMemory();
   33.30 -            return -1;
   33.31 +            return SDL_OutOfMemory();
   33.32          }
   33.33          SDL_ConvertPixels(rect->w, rect->h,
   33.34                            texture->format, pixels, pitch,
   33.35 @@ -800,8 +797,7 @@
   33.36      CHECK_TEXTURE_MAGIC(texture, -1);
   33.37  
   33.38      if (texture->access != SDL_TEXTUREACCESS_STREAMING) {
   33.39 -        SDL_SetError("SDL_LockTexture(): texture must be streaming");
   33.40 -        return -1;
   33.41 +        return SDL_SetError("SDL_LockTexture(): texture must be streaming");
   33.42      }
   33.43  
   33.44      if (!rect) {
   33.45 @@ -897,8 +893,7 @@
   33.46  SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
   33.47  {
   33.48      if (!SDL_RenderTargetSupported(renderer)) {
   33.49 -        SDL_Unsupported();
   33.50 -        return -1;
   33.51 +        return SDL_Unsupported();
   33.52      }
   33.53      if (texture == renderer->target) {
   33.54          /* Nothing to do! */
   33.55 @@ -909,12 +904,10 @@
   33.56      if (texture) {
   33.57          CHECK_TEXTURE_MAGIC(texture, -1);
   33.58          if (renderer != texture->renderer) {
   33.59 -            SDL_SetError("Texture was not created with this renderer");
   33.60 -            return -1;
   33.61 +            return SDL_SetError("Texture was not created with this renderer");
   33.62          }
   33.63          if (texture->access != SDL_TEXTUREACCESS_TARGET) {
   33.64 -            SDL_SetError("Texture not created with SDL_TEXTUREACCESS_TARGET");
   33.65 -            return -1;
   33.66 +            return SDL_SetError("Texture not created with SDL_TEXTUREACCESS_TARGET");
   33.67          }
   33.68          if (texture->native) {
   33.69              /* Always render to the native texture */
   33.70 @@ -979,8 +972,7 @@
   33.71          SDL_GetWindowSize(renderer->window, &w, &h);
   33.72      } else {
   33.73          /* FIXME */
   33.74 -        SDL_SetError("Internal error: No way to get output resolution");
   33.75 -        return -1;
   33.76 +        return SDL_SetError("Internal error: No way to get output resolution");
   33.77      }
   33.78  
   33.79      want_aspect = (float)renderer->logical_w / renderer->logical_h;
   33.80 @@ -1198,8 +1190,7 @@
   33.81  
   33.82      frects = SDL_stack_alloc(SDL_FRect, count);
   33.83      if (!frects) {
   33.84 -        SDL_OutOfMemory();
   33.85 -        return -1;
   33.86 +        return SDL_OutOfMemory();
   33.87      }
   33.88      for (i = 0; i < count; ++i) {
   33.89          frects[i].x = points[i].x * renderer->scale.x;
   33.90 @@ -1226,8 +1217,7 @@
   33.91      CHECK_RENDERER_MAGIC(renderer, -1);
   33.92  
   33.93      if (!points) {
   33.94 -        SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points");
   33.95 -        return -1;
   33.96 +        return SDL_SetError("SDL_RenderDrawPoints(): Passed NULL points");
   33.97      }
   33.98      if (count < 1) {
   33.99          return 0;
  33.100 @@ -1243,8 +1233,7 @@
  33.101  
  33.102      fpoints = SDL_stack_alloc(SDL_FPoint, count);
  33.103      if (!fpoints) {
  33.104 -        SDL_OutOfMemory();
  33.105 -        return -1;
  33.106 +        return SDL_OutOfMemory();
  33.107      }
  33.108      for (i = 0; i < count; ++i) {
  33.109          fpoints[i].x = points[i].x * renderer->scale.x;
  33.110 @@ -1282,8 +1271,7 @@
  33.111  
  33.112      frects = SDL_stack_alloc(SDL_FRect, count-1);
  33.113      if (!frects) {
  33.114 -        SDL_OutOfMemory();
  33.115 -        return -1;
  33.116 +        return SDL_OutOfMemory();
  33.117      }
  33.118  
  33.119      status = 0;
  33.120 @@ -1338,8 +1326,7 @@
  33.121      CHECK_RENDERER_MAGIC(renderer, -1);
  33.122  
  33.123      if (!points) {
  33.124 -        SDL_SetError("SDL_RenderDrawLines(): Passed NULL points");
  33.125 -        return -1;
  33.126 +        return SDL_SetError("SDL_RenderDrawLines(): Passed NULL points");
  33.127      }
  33.128      if (count < 2) {
  33.129          return 0;
  33.130 @@ -1355,8 +1342,7 @@
  33.131  
  33.132      fpoints = SDL_stack_alloc(SDL_FPoint, count);
  33.133      if (!fpoints) {
  33.134 -        SDL_OutOfMemory();
  33.135 -        return -1;
  33.136 +        return SDL_OutOfMemory();
  33.137      }
  33.138      for (i = 0; i < count; ++i) {
  33.139          fpoints[i].x = points[i].x * renderer->scale.x;
  33.140 @@ -1408,8 +1394,7 @@
  33.141      CHECK_RENDERER_MAGIC(renderer, -1);
  33.142  
  33.143      if (!rects) {
  33.144 -        SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects");
  33.145 -        return -1;
  33.146 +        return SDL_SetError("SDL_RenderDrawRects(): Passed NULL rects");
  33.147      }
  33.148      if (count < 1) {
  33.149          return 0;
  33.150 @@ -1455,8 +1440,7 @@
  33.151      CHECK_RENDERER_MAGIC(renderer, -1);
  33.152  
  33.153      if (!rects) {
  33.154 -        SDL_SetError("SDL_RenderFillRects(): Passed NULL rects");
  33.155 -        return -1;
  33.156 +        return SDL_SetError("SDL_RenderFillRects(): Passed NULL rects");
  33.157      }
  33.158      if (count < 1) {
  33.159          return 0;
  33.160 @@ -1468,8 +1452,7 @@
  33.161  
  33.162      frects = SDL_stack_alloc(SDL_FRect, count);
  33.163      if (!frects) {
  33.164 -        SDL_OutOfMemory();
  33.165 -        return -1;
  33.166 +        return SDL_OutOfMemory();
  33.167      }
  33.168      for (i = 0; i < count; ++i) {
  33.169          frects[i].x = rects[i].x * renderer->scale.x;
  33.170 @@ -1497,8 +1480,7 @@
  33.171      CHECK_TEXTURE_MAGIC(texture, -1);
  33.172  
  33.173      if (renderer != texture->renderer) {
  33.174 -        SDL_SetError("Texture was not created with this renderer");
  33.175 -        return -1;
  33.176 +        return SDL_SetError("Texture was not created with this renderer");
  33.177      }
  33.178  
  33.179      real_srcrect.x = 0;
  33.180 @@ -1566,12 +1548,10 @@
  33.181      CHECK_TEXTURE_MAGIC(texture, -1);
  33.182  
  33.183      if (renderer != texture->renderer) {
  33.184 -        SDL_SetError("Texture was not created with this renderer");
  33.185 -        return -1;
  33.186 +        return SDL_SetError("Texture was not created with this renderer");
  33.187      }
  33.188      if (!renderer->RenderCopyEx) {
  33.189 -        SDL_SetError("Renderer does not support RenderCopyEx");
  33.190 -        return -1;
  33.191 +        return SDL_SetError("Renderer does not support RenderCopyEx");
  33.192      }
  33.193      
  33.194      real_srcrect.x = 0;
  33.195 @@ -1623,8 +1603,7 @@
  33.196      CHECK_RENDERER_MAGIC(renderer, -1);
  33.197  
  33.198      if (!renderer->RenderReadPixels) {
  33.199 -        SDL_Unsupported();
  33.200 -        return -1;
  33.201 +        return SDL_Unsupported();
  33.202      }
  33.203  
  33.204      if (!format) {
  33.205 @@ -1729,8 +1708,7 @@
  33.206          return renderer->GL_BindTexture(renderer, texture, texw, texh);
  33.207      }
  33.208  
  33.209 -    SDL_Unsupported();
  33.210 -    return -1;
  33.211 +    return SDL_Unsupported();
  33.212  }
  33.213  
  33.214  int SDL_GL_UnbindTexture(SDL_Texture *texture)
  33.215 @@ -1743,8 +1721,7 @@
  33.216          return renderer->GL_UnbindTexture(renderer, texture);
  33.217      }
  33.218  
  33.219 -    SDL_Unsupported();
  33.220 -    return -1;
  33.221 +    return SDL_Unsupported();
  33.222  }
  33.223  
  33.224  /* vi: set ts=4 sw=4 expandtab: */
    34.1 --- a/src/render/SDL_yuv_sw.c	Fri Mar 29 21:29:57 2013 -0400
    34.2 +++ b/src/render/SDL_yuv_sw.c	Sun Mar 31 12:48:50 2013 -0400
    34.3 @@ -896,8 +896,7 @@
    34.4  
    34.5      if (!SDL_PixelFormatEnumToMasks
    34.6          (target_format, &bpp, &Rmask, &Gmask, &Bmask, &Amask) || bpp < 15) {
    34.7 -        SDL_SetError("Unsupported YUV destination format");
    34.8 -        return -1;
    34.9 +        return SDL_SetError("Unsupported YUV destination format");
   34.10      }
   34.11  
   34.12      swdata->target_format = target_format;
   34.13 @@ -1057,8 +1056,8 @@
   34.14      swdata->colortab = (int *) SDL_malloc(4 * 256 * sizeof(int));
   34.15      swdata->rgb_2_pix = (Uint32 *) SDL_malloc(3 * 768 * sizeof(Uint32));
   34.16      if (!swdata->pixels || !swdata->colortab || !swdata->rgb_2_pix) {
   34.17 +        SDL_SW_DestroyYUVTexture(swdata);
   34.18          SDL_OutOfMemory();
   34.19 -        SDL_SW_DestroyYUVTexture(swdata);
   34.20          return NULL;
   34.21      }
   34.22  
   34.23 @@ -1197,9 +1196,8 @@
   34.24          if (rect
   34.25              && (rect->x != 0 || rect->y != 0 || rect->w != swdata->w
   34.26                  || rect->h != swdata->h)) {
   34.27 -            SDL_SetError
   34.28 +            return SDL_SetError
   34.29                  ("YV12 and IYUV textures only support full surface locks");
   34.30 -            return -1;
   34.31          }
   34.32          break;
   34.33      }
   34.34 @@ -1309,8 +1307,7 @@
   34.35          Cb = lum + 3;
   34.36          break;
   34.37      default:
   34.38 -        SDL_SetError("Unsupported YUV format in copy");
   34.39 -        return (-1);
   34.40 +        return SDL_SetError("Unsupported YUV format in copy");
   34.41      }
   34.42      mod = (pitch / SDL_BYTESPERPIXEL(target_format));
   34.43  
    35.1 --- a/src/render/direct3d/SDL_render_d3d.c	Fri Mar 29 21:29:57 2013 -0400
    35.2 +++ b/src/render/direct3d/SDL_render_d3d.c	Sun Mar 31 12:48:50 2013 -0400
    35.3 @@ -246,7 +246,7 @@
    35.4      float u, v;
    35.5  } Vertex;
    35.6  
    35.7 -static void
    35.8 +static int
    35.9  D3D_SetError(const char *prefix, HRESULT result)
   35.10  {
   35.11      const char *error;
   35.12 @@ -322,7 +322,7 @@
   35.13          error = "UNKNOWN";
   35.14          break;
   35.15      }
   35.16 -    SDL_SetError("%s: %s", prefix, error);
   35.17 +    return SDL_SetError("%s: %s", prefix, error);
   35.18  }
   35.19  
   35.20  static D3DFORMAT
   35.21 @@ -373,8 +373,7 @@
   35.22              /* Don't worry about it, we'll reset later... */
   35.23              return 0;
   35.24          } else {
   35.25 -            D3D_SetError("Reset()", result);
   35.26 -            return -1;
   35.27 +            return D3D_SetError("Reset()", result);
   35.28          }
   35.29      }
   35.30      IDirect3DDevice9_SetVertexShader(data->device, NULL);
   35.31 @@ -422,8 +421,7 @@
   35.32              result = IDirect3DDevice9_BeginScene(data->device);
   35.33          }
   35.34          if (FAILED(result)) {
   35.35 -            D3D_SetError("BeginScene()", result);
   35.36 -            return -1;
   35.37 +            return D3D_SetError("BeginScene()", result);
   35.38          }
   35.39          data->beginScene = SDL_FALSE;
   35.40      }
   35.41 @@ -704,8 +702,7 @@
   35.42  
   35.43      data = (D3D_TextureData *) SDL_calloc(1, sizeof(*data));
   35.44      if (!data) {
   35.45 -        SDL_OutOfMemory();
   35.46 -        return -1;
   35.47 +        return SDL_OutOfMemory();
   35.48      }
   35.49      data->scaleMode = GetScaleQuality();
   35.50  
   35.51 @@ -732,8 +729,7 @@
   35.52                                         PixelFormatToD3DFMT(texture->format),
   35.53                                         pool, &data->texture, NULL);
   35.54      if (FAILED(result)) {
   35.55 -        D3D_SetError("CreateTexture()", result);
   35.56 -        return -1;
   35.57 +        return D3D_SetError("CreateTexture()", result);
   35.58      }
   35.59  
   35.60      return 0;
   35.61 @@ -767,8 +763,7 @@
   35.62      }
   35.63  
   35.64      if (FAILED(result)) {
   35.65 -        D3D_SetError("LockRect()", result);
   35.66 -        return -1;
   35.67 +        return D3D_SetError("LockRect()", result);
   35.68      }
   35.69  
   35.70      src = pixels;
   35.71 @@ -804,8 +799,7 @@
   35.72  
   35.73      result = IDirect3DTexture9_LockRect(data->texture, 0, &locked, &d3drect, 0);
   35.74      if (FAILED(result)) {
   35.75 -        D3D_SetError("LockRect()", result);
   35.76 -        return -1;
   35.77 +        return D3D_SetError("LockRect()", result);
   35.78      }
   35.79      *pixels = locked.pBits;
   35.80      *pitch = locked.Pitch;
   35.81 @@ -881,13 +875,11 @@
   35.82      texturedata = (D3D_TextureData *) texture->driverdata;
   35.83      result = IDirect3DTexture9_GetSurfaceLevel(texturedata->texture, 0, &data->currentRenderTarget);
   35.84      if(FAILED(result)) {
   35.85 -        D3D_SetError("GetSurfaceLevel()", result);
   35.86 -        return -1;
   35.87 +        return D3D_SetError("GetSurfaceLevel()", result);
   35.88      }
   35.89      result = IDirect3DDevice9_SetRenderTarget(data->device, 0, data->currentRenderTarget);
   35.90      if(FAILED(result)) {
   35.91 -        D3D_SetError("SetRenderTarget()", result);
   35.92 -        return -1;
   35.93 +        return D3D_SetError("SetRenderTarget()", result);
   35.94      }
   35.95  
   35.96      return 0;
   35.97 @@ -936,8 +928,7 @@
   35.98      }
   35.99  
  35.100      if (FAILED(result)) {
  35.101 -        D3D_SetError("Clear()", result);
  35.102 -        return -1;
  35.103 +        return D3D_SetError("Clear()", result);
  35.104      }
  35.105      return 0;
  35.106  }
  35.107 @@ -997,8 +988,7 @@
  35.108          IDirect3DDevice9_SetTexture(data->device, 0,
  35.109                                      (IDirect3DBaseTexture9 *) 0);
  35.110      if (FAILED(result)) {
  35.111 -        D3D_SetError("SetTexture()", result);
  35.112 -        return -1;
  35.113 +        return D3D_SetError("SetTexture()", result);
  35.114      }
  35.115  
  35.116      color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
  35.117 @@ -1017,8 +1007,7 @@
  35.118                                           vertices, sizeof(*vertices));
  35.119      SDL_stack_free(vertices);
  35.120      if (FAILED(result)) {
  35.121 -        D3D_SetError("DrawPrimitiveUP()", result);
  35.122 -        return -1;
  35.123 +        return D3D_SetError("DrawPrimitiveUP()", result);
  35.124      }
  35.125      return 0;
  35.126  }
  35.127 @@ -1043,8 +1032,7 @@
  35.128          IDirect3DDevice9_SetTexture(data->device, 0,
  35.129                                      (IDirect3DBaseTexture9 *) 0);
  35.130      if (FAILED(result)) {
  35.131 -        D3D_SetError("SetTexture()", result);
  35.132 -        return -1;
  35.133 +        return D3D_SetError("SetTexture()", result);
  35.134      }
  35.135  
  35.136      color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
  35.137 @@ -1073,8 +1061,7 @@
  35.138  
  35.139      SDL_stack_free(vertices);
  35.140      if (FAILED(result)) {
  35.141 -        D3D_SetError("DrawPrimitiveUP()", result);
  35.142 -        return -1;
  35.143 +        return D3D_SetError("DrawPrimitiveUP()", result);
  35.144      }
  35.145      return 0;
  35.146  }
  35.147 @@ -1100,8 +1087,7 @@
  35.148          IDirect3DDevice9_SetTexture(data->device, 0,
  35.149                                      (IDirect3DBaseTexture9 *) 0);
  35.150      if (FAILED(result)) {
  35.151 -        D3D_SetError("SetTexture()", result);
  35.152 -        return -1;
  35.153 +        return D3D_SetError("SetTexture()", result);
  35.154      }
  35.155  
  35.156      color = D3DCOLOR_ARGB(renderer->a, renderer->r, renderer->g, renderer->b);
  35.157 @@ -1146,8 +1132,7 @@
  35.158              IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN,
  35.159                                               2, vertices, sizeof(*vertices));
  35.160          if (FAILED(result)) {
  35.161 -            D3D_SetError("DrawPrimitiveUP()", result);
  35.162 -            return -1;
  35.163 +            return D3D_SetError("DrawPrimitiveUP()", result);
  35.164          }
  35.165      }
  35.166      return 0;
  35.167 @@ -1224,28 +1209,24 @@
  35.168          IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)
  35.169                                      texturedata->texture);
  35.170      if (FAILED(result)) {
  35.171 -        D3D_SetError("SetTexture()", result);
  35.172 -        return -1;
  35.173 +        return D3D_SetError("SetTexture()", result);
  35.174      }
  35.175      if (shader) {
  35.176          result = IDirect3DDevice9_SetPixelShader(data->device, shader);
  35.177          if (FAILED(result)) {
  35.178 -            D3D_SetError("SetShader()", result);
  35.179 -            return -1;
  35.180 +            return D3D_SetError("SetShader()", result);
  35.181          }
  35.182      }
  35.183      result =
  35.184          IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
  35.185                                           vertices, sizeof(*vertices));
  35.186      if (FAILED(result)) {
  35.187 -        D3D_SetError("DrawPrimitiveUP()", result);
  35.188 -        return -1;
  35.189 +        return D3D_SetError("DrawPrimitiveUP()", result);
  35.190      }
  35.191      if (shader) {
  35.192          result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
  35.193          if (FAILED(result)) {
  35.194 -            D3D_SetError("SetShader()", result);
  35.195 -            return -1;
  35.196 +            return D3D_SetError("SetShader()", result);
  35.197          }
  35.198      }
  35.199      return 0;
  35.200 @@ -1348,28 +1329,24 @@
  35.201          IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)
  35.202                                      texturedata->texture);
  35.203      if (FAILED(result)) {
  35.204 -        D3D_SetError("SetTexture()", result);
  35.205 -        return -1;
  35.206 +        return D3D_SetError("SetTexture()", result);
  35.207      }
  35.208      if (shader) {
  35.209          result = IDirect3DDevice9_SetPixelShader(data->device, shader);
  35.210          if (FAILED(result)) {
  35.211 -            D3D_SetError("SetShader()", result);
  35.212 -            return -1;
  35.213 +            return D3D_SetError("SetShader()", result);
  35.214          }
  35.215      }
  35.216      result =
  35.217          IDirect3DDevice9_DrawPrimitiveUP(data->device, D3DPT_TRIANGLEFAN, 2,
  35.218                                           vertices, sizeof(*vertices));
  35.219      if (FAILED(result)) {
  35.220 -        D3D_SetError("DrawPrimitiveUP()", result);
  35.221 -        return -1;
  35.222 +        return D3D_SetError("DrawPrimitiveUP()", result);
  35.223      }
  35.224      if (shader) {
  35.225          result = IDirect3DDevice9_SetPixelShader(data->device, NULL);
  35.226          if (FAILED(result)) {
  35.227 -            D3D_SetError("SetShader()", result);
  35.228 -            return -1;
  35.229 +            return D3D_SetError("SetShader()", result);
  35.230          }
  35.231      }
  35.232      ID3DXMatrixStack_Pop(data->matrixStack);
  35.233 @@ -1394,30 +1371,26 @@
  35.234  
  35.235      result = IDirect3DDevice9_GetBackBuffer(data->device, 0, 0, D3DBACKBUFFER_TYPE_MONO, &backBuffer);
  35.236      if (FAILED(result)) {
  35.237 -        D3D_SetError("GetBackBuffer()", result);
  35.238 -        return -1;
  35.239 +        return D3D_SetError("GetBackBuffer()", result);
  35.240      }
  35.241  
  35.242      result = IDirect3DSurface9_GetDesc(backBuffer, &desc);
  35.243      if (FAILED(result)) {
  35.244 -        D3D_SetError("GetDesc()", result);
  35.245          IDirect3DSurface9_Release(backBuffer);
  35.246 -        return -1;
  35.247 +        return D3D_SetError("GetDesc()", result);
  35.248      }
  35.249  
  35.250      result = IDirect3DDevice9_CreateOffscreenPlainSurface(data->device, desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
  35.251      if (FAILED(result)) {
  35.252 -        D3D_SetError("CreateOffscreenPlainSurface()", result);
  35.253          IDirect3DSurface9_Release(backBuffer);
  35.254 -        return -1;
  35.255 +        return D3D_SetError("CreateOffscreenPlainSurface()", result);
  35.256      }
  35.257  
  35.258      result = IDirect3DDevice9_GetRenderTargetData(data->device, backBuffer, surface);
  35.259      if (FAILED(result)) {
  35.260 -        D3D_SetError("GetRenderTargetData()", result);
  35.261          IDirect3DSurface9_Release(surface);
  35.262          IDirect3DSurface9_Release(backBuffer);
  35.263 -        return -1;
  35.264 +        return D3D_SetError("GetRenderTargetData()", result);
  35.265      }
  35.266  
  35.267      d3drect.left = rect->x;
  35.268 @@ -1427,10 +1400,9 @@
  35.269  
  35.270      result = IDirect3DSurface9_LockRect(surface, &locked, &d3drect, D3DLOCK_READONLY);
  35.271      if (FAILED(result)) {
  35.272 -        D3D_SetError("LockRect()", result);
  35.273          IDirect3DSurface9_Release(surface);
  35.274          IDirect3DSurface9_Release(backBuffer);
  35.275 -        return -1;
  35.276 +        return D3D_SetError("LockRect()", result);
  35.277      }
  35.278  
  35.279      SDL_ConvertPixels(rect->w, rect->h,
    36.1 --- a/src/render/opengl/SDL_render_gl.c	Fri Mar 29 21:29:57 2013 -0400
    36.2 +++ b/src/render/opengl/SDL_render_gl.c	Sun Mar 31 12:48:50 2013 -0400
    36.3 @@ -208,8 +208,7 @@
    36.4      do { \
    36.5          data->func = SDL_GL_GetProcAddress(#func); \
    36.6          if ( ! data->func ) { \
    36.7 -            SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \
    36.8 -            return -1; \
    36.9 +            return SDL_SetError("Couldn't load GL function %s: %s\n", #func, SDL_GetError()); \
   36.10          } \
   36.11      } while ( 0 );
   36.12  #endif /* __SDL_NOGETPROCADDR__ */
   36.13 @@ -500,15 +499,13 @@
   36.14  
   36.15      if (!convert_format(renderdata, texture->format, &internalFormat,
   36.16                          &format, &type)) {
   36.17 -        SDL_SetError("Texture format %s not supported by OpenGL",
   36.18 -                     SDL_GetPixelFormatName(texture->format));
   36.19 -        return -1;
   36.20 +        return SDL_SetError("Texture format %s not supported by OpenGL",
   36.21 +                            SDL_GetPixelFormatName(texture->format));
   36.22      }
   36.23  
   36.24      data = (GL_TextureData *) SDL_calloc(1, sizeof(*data));
   36.25      if (!data) {
   36.26 -        SDL_OutOfMemory();
   36.27 -        return -1;
   36.28 +        return SDL_OutOfMemory();
   36.29      }
   36.30  
   36.31      if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
   36.32 @@ -522,9 +519,8 @@
   36.33          }
   36.34          data->pixels = SDL_calloc(1, size);
   36.35          if (!data->pixels) {
   36.36 -            SDL_OutOfMemory();
   36.37              SDL_free(data);
   36.38 -            return -1;
   36.39 +            return SDL_OutOfMemory();
   36.40          }
   36.41      }
   36.42  
   36.43 @@ -746,8 +742,7 @@
   36.44      /* Check FBO status */
   36.45      status = data->glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
   36.46      if (status != GL_FRAMEBUFFER_COMPLETE_EXT) {
   36.47 -        SDL_SetError("glFramebufferTexture2DEXT() failed");
   36.48 -        return -1;
   36.49 +        return SDL_SetError("glFramebufferTexture2DEXT() failed");
   36.50      }
   36.51      return 0;
   36.52  }
   36.53 @@ -1157,8 +1152,7 @@
   36.54      temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
   36.55      temp_pixels = SDL_malloc(rect->h * temp_pitch);
   36.56      if (!temp_pixels) {
   36.57 -        SDL_OutOfMemory();
   36.58 -        return -1;
   36.59 +        return SDL_OutOfMemory();
   36.60      }
   36.61  
   36.62      convert_format(data, temp_format, &internalFormat, &format, &type);
    37.1 --- a/src/render/opengles/SDL_render_gles.c	Fri Mar 29 21:29:57 2013 -0400
    37.2 +++ b/src/render/opengles/SDL_render_gles.c	Sun Mar 31 12:48:50 2013 -0400
    37.3 @@ -135,7 +135,7 @@
    37.4      GLES_FBOList *fbo;
    37.5  } GLES_TextureData;
    37.6  
    37.7 -static void
    37.8 +static int
    37.9  GLES_SetError(const char *prefix, GLenum result)
   37.10  {
   37.11      const char *error;
   37.12 @@ -166,7 +166,7 @@
   37.13          error = "UNKNOWN";
   37.14          break;
   37.15      }
   37.16 -    SDL_SetError("%s: %s", prefix, error);
   37.17 +    return SDL_SetError("%s: %s", prefix, error);
   37.18  }
   37.19  
   37.20  static int GLES_LoadFunctions(GLES_RenderData * data)
   37.21 @@ -186,8 +186,7 @@
   37.22      do { \
   37.23          data->func = SDL_GL_GetProcAddress(#func); \
   37.24          if ( ! data->func ) { \
   37.25 -            SDL_SetError("Couldn't load GLES function %s: %s\n", #func, SDL_GetError()); \
   37.26 -            return -1; \
   37.27 +            return SDL_SetError("Couldn't load GLES function %s: %s\n", #func, SDL_GetError()); \
   37.28          } \
   37.29      } while ( 0 );  
   37.30  #endif /* _SDL_NOGETPROCADDR_ */
   37.31 @@ -442,23 +441,20 @@
   37.32          type = GL_UNSIGNED_BYTE;
   37.33          break;
   37.34      default:
   37.35 -        SDL_SetError("Texture format not supported");
   37.36 -        return -1;
   37.37 +        return SDL_SetError("Texture format not supported");
   37.38      }
   37.39  
   37.40      data = (GLES_TextureData *) SDL_calloc(1, sizeof(*data));
   37.41      if (!data) {
   37.42 -        SDL_OutOfMemory();
   37.43 -        return -1;
   37.44 +        return SDL_OutOfMemory();
   37.45      }
   37.46  
   37.47      if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
   37.48          data->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
   37.49          data->pixels = SDL_calloc(1, texture->h * data->pitch);
   37.50          if (!data->pixels) {
   37.51 -            SDL_OutOfMemory();
   37.52              SDL_free(data);
   37.53 -            return -1;
   37.54 +            return SDL_OutOfMemory();
   37.55          }
   37.56      }
   37.57  
   37.58 @@ -495,8 +491,7 @@
   37.59  
   37.60      result = renderdata->glGetError();
   37.61      if (result != GL_NO_ERROR) {
   37.62 -        GLES_SetError("glTexImage2D()", result);
   37.63 -        return -1;
   37.64 +        return GLES_SetError("glTexImage2D()", result);
   37.65      }
   37.66      return 0;
   37.67  }
   37.68 @@ -521,17 +516,13 @@
   37.69      /* Reformat the texture data into a tightly packed array */
   37.70      srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
   37.71      src = (Uint8 *)pixels;
   37.72 -    if (pitch != srcPitch)
   37.73 -    {
   37.74 +    if (pitch != srcPitch) {
   37.75          blob = (Uint8 *)SDL_malloc(srcPitch * rect->h);
   37.76 -        if (!blob)
   37.77 -        {
   37.78 -            SDL_OutOfMemory();
   37.79 -            return -1;
   37.80 +        if (!blob) {
   37.81 +            return SDL_OutOfMemory();
   37.82          }
   37.83          src = blob;
   37.84 -        for (y = 0; y < rect->h; ++y)
   37.85 -        {
   37.86 +        for (y = 0; y < rect->h; ++y) {
   37.87              SDL_memcpy(src, pixels, srcPitch);
   37.88              src += srcPitch;
   37.89              pixels = (Uint8 *)pixels + pitch;
   37.90 @@ -559,8 +550,7 @@
   37.91  
   37.92      if (renderdata->glGetError() != GL_NO_ERROR)
   37.93      {
   37.94 -        SDL_SetError("Failed to update texture");
   37.95 -        return -1;
   37.96 +        return SDL_SetError("Failed to update texture");
   37.97      }
   37.98      return 0;
   37.99  }
  37.100 @@ -613,8 +603,7 @@
  37.101      /* Check FBO status */
  37.102      status = data->glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
  37.103      if (status != GL_FRAMEBUFFER_COMPLETE_OES) {
  37.104 -        SDL_SetError("glFramebufferTexture2DOES() failed");
  37.105 -        return -1;
  37.106 +        return SDL_SetError("glFramebufferTexture2DOES() failed");
  37.107      }
  37.108      return 0;
  37.109  }
  37.110 @@ -1006,8 +995,7 @@
  37.111      temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
  37.112      temp_pixels = SDL_malloc(rect->h * temp_pitch);
  37.113      if (!temp_pixels) {
  37.114 -        SDL_OutOfMemory();
  37.115 -        return -1;
  37.116 +        return SDL_OutOfMemory();
  37.117      }
  37.118  
  37.119      SDL_GetWindowSize(window, &w, &h);
    38.1 --- a/src/render/opengles2/SDL_render_gles2.c	Fri Mar 29 21:29:57 2013 -0400
    38.2 +++ b/src/render/opengles2/SDL_render_gles2.c	Sun Mar 31 12:48:50 2013 -0400
    38.3 @@ -189,8 +189,7 @@
    38.4      do { \
    38.5          data->func = SDL_GL_GetProcAddress(#func); \
    38.6          if ( ! data->func ) { \
    38.7 -            SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \
    38.8 -            return -1; \
    38.9 +            return SDL_SetError("Couldn't load GLES2 function %s: %s\n", #func, SDL_GetError()); \
   38.10          } \
   38.11      } while ( 0 );
   38.12  #endif /* _SDL_NOGETPROCADDR_ */
   38.13 @@ -372,16 +371,13 @@
   38.14          type = GL_UNSIGNED_BYTE;
   38.15          break;
   38.16      default:
   38.17 -        SDL_SetError("Texture format not supported");
   38.18 -        return -1;
   38.19 +        return SDL_SetError("Texture format not supported");
   38.20      }
   38.21  
   38.22      /* Allocate a texture struct */
   38.23      tdata = (GLES2_TextureData *)SDL_calloc(1, sizeof(GLES2_TextureData));
   38.24 -    if (!tdata)
   38.25 -    {
   38.26 -        SDL_OutOfMemory();
   38.27 -        return -1;
   38.28 +    if (!tdata) {
   38.29 +        return SDL_OutOfMemory();
   38.30      }
   38.31      tdata->texture = 0;
   38.32      tdata->texture_type = GL_TEXTURE_2D;
   38.33 @@ -390,15 +386,12 @@
   38.34      scaleMode = GetScaleQuality();
   38.35  
   38.36      /* Allocate a blob for image data */
   38.37 -    if (texture->access == SDL_TEXTUREACCESS_STREAMING)
   38.38 -    {
   38.39 +    if (texture->access == SDL_TEXTUREACCESS_STREAMING) {
   38.40          tdata->pitch = texture->w * SDL_BYTESPERPIXEL(texture->format);
   38.41          tdata->pixel_data = SDL_calloc(1, tdata->pitch * texture->h);
   38.42 -        if (!tdata->pixel_data)
   38.43 -        {
   38.44 -            SDL_OutOfMemory();
   38.45 +        if (!tdata->pixel_data) {
   38.46              SDL_free(tdata);
   38.47 -            return -1;
   38.48 +            return SDL_OutOfMemory();
   38.49          }
   38.50      }
   38.51  
   38.52 @@ -414,10 +407,9 @@
   38.53      rdata->glTexImage2D(tdata->texture_type, 0, format, texture->w, texture->h, 0, format, type, NULL);
   38.54      if (rdata->glGetError() != GL_NO_ERROR)
   38.55      {
   38.56 -        SDL_SetError("Texture creation failed");
   38.57          rdata->glDeleteTextures(1, &tdata->texture);
   38.58          SDL_free(tdata);
   38.59 -        return -1;
   38.60 +        return SDL_SetError("Texture creation failed");
   38.61      }
   38.62      texture->driverdata = tdata;
   38.63  
   38.64 @@ -497,13 +489,10 @@
   38.65      /* Reformat the texture data into a tightly packed array */
   38.66      srcPitch = rect->w * SDL_BYTESPERPIXEL(texture->format);
   38.67      src = (Uint8 *)pixels;
   38.68 -    if (pitch != srcPitch)
   38.69 -    {
   38.70 +    if (pitch != srcPitch) {
   38.71          blob = (Uint8 *)SDL_malloc(srcPitch * rect->h);
   38.72 -        if (!blob)
   38.73 -        {
   38.74 -            SDL_OutOfMemory();
   38.75 -            return -1;
   38.76 +        if (!blob) {
   38.77 +            return SDL_OutOfMemory();
   38.78          }
   38.79          src = blob;
   38.80          for (y = 0; y < rect->h; ++y)
   38.81 @@ -533,10 +522,8 @@
   38.82          SDL_free(blob);
   38.83      }
   38.84  
   38.85 -    if (rdata->glGetError() != GL_NO_ERROR)
   38.86 -    {
   38.87 -        SDL_SetError("Failed to update texture");
   38.88 -        return -1;
   38.89 +    if (rdata->glGetError() != GL_NO_ERROR) {
   38.90 +        return SDL_SetError("Failed to update texture");
   38.91      }
   38.92      return 0;
   38.93  }
   38.94 @@ -558,8 +545,7 @@
   38.95          /* Check FBO status */
   38.96          status = data->glCheckFramebufferStatus(GL_FRAMEBUFFER);
   38.97          if (status != GL_FRAMEBUFFER_COMPLETE) {
   38.98 -            SDL_SetError("glFramebufferTexture2D() failed");
   38.99 -            return -1;
  38.100 +            return SDL_SetError("glFramebufferTexture2D() failed");
  38.101          }
  38.102      }
  38.103      return 0;
  38.104 @@ -636,9 +622,9 @@
  38.105      rdata->glGetProgramiv(entry->id, GL_LINK_STATUS, &linkSuccessful);
  38.106      if (rdata->glGetError() != GL_NO_ERROR || !linkSuccessful)
  38.107      {
  38.108 -        SDL_SetError("Failed to link shader program");
  38.109          rdata->glDeleteProgram(entry->id);
  38.110          SDL_free(entry);
  38.111 +        SDL_SetError("Failed to link shader program");
  38.112          return NULL;
  38.113      }
  38.114  
  38.115 @@ -930,10 +916,8 @@
  38.116      locProjection = rdata->current_program->uniform_locations[GLES2_UNIFORM_PROJECTION];
  38.117      rdata->glGetError();
  38.118      rdata->glUniformMatrix4fv(locProjection, 1, GL_FALSE, (GLfloat *)projection);
  38.119 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.120 -    {
  38.121 -        SDL_SetError("Failed to set orthographic projection");
  38.122 -        return -1;
  38.123 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.124 +        return SDL_SetError("Failed to set orthographic projection");
  38.125      }
  38.126      return 0;
  38.127  }
  38.128 @@ -1066,8 +1050,7 @@
  38.129  
  38.130      /* Emit the specified vertices as points */
  38.131      vertices = SDL_stack_alloc(GLfloat, count * 2);
  38.132 -    for (idx = 0; idx < count; ++idx)
  38.133 -    {
  38.134 +    for (idx = 0; idx < count; ++idx) {
  38.135          GLfloat x = points[idx].x + 0.5f;
  38.136          GLfloat y = points[idx].y + 0.5f;
  38.137  
  38.138 @@ -1078,10 +1061,8 @@
  38.139      rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
  38.140      rdata->glDrawArrays(GL_POINTS, 0, count);
  38.141      SDL_stack_free(vertices);
  38.142 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.143 -    {
  38.144 -        SDL_SetError("Failed to render lines");
  38.145 -        return -1;
  38.146 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.147 +        return SDL_SetError("Failed to render lines");
  38.148      }
  38.149      return 0;
  38.150  }
  38.151 @@ -1099,8 +1080,7 @@
  38.152  
  38.153      /* Emit a line strip including the specified vertices */
  38.154      vertices = SDL_stack_alloc(GLfloat, count * 2);
  38.155 -    for (idx = 0; idx < count; ++idx)
  38.156 -    {
  38.157 +    for (idx = 0; idx < count; ++idx) {
  38.158          GLfloat x = points[idx].x + 0.5f;
  38.159          GLfloat y = points[idx].y + 0.5f;
  38.160  
  38.161 @@ -1117,10 +1097,8 @@
  38.162          rdata->glDrawArrays(GL_POINTS, count-1, 1);
  38.163      }
  38.164      SDL_stack_free(vertices);
  38.165 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.166 -    {
  38.167 -        SDL_SetError("Failed to render lines");
  38.168 -        return -1;
  38.169 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.170 +        return SDL_SetError("Failed to render lines");
  38.171      }
  38.172      return 0;
  38.173  }
  38.174 @@ -1157,10 +1135,8 @@
  38.175          rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices);
  38.176          rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  38.177      }
  38.178 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.179 -    {
  38.180 -        SDL_SetError("Failed to render lines");
  38.181 -        return -1;
  38.182 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.183 +        return SDL_SetError("Failed to render lines");
  38.184      }
  38.185      return 0;
  38.186  }
  38.187 @@ -1315,10 +1291,8 @@
  38.188      texCoords[7] = (srcrect->y + srcrect->h) / (GLfloat)texture->h;
  38.189      rdata->glVertexAttribPointer(GLES2_ATTRIBUTE_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, texCoords);
  38.190      rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  38.191 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.192 -    {
  38.193 -        SDL_SetError("Failed to render texture");
  38.194 -        return -1;
  38.195 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.196 +        return SDL_SetError("Failed to render texture");
  38.197      }
  38.198      return 0;
  38.199  }
  38.200 @@ -1499,10 +1473,8 @@
  38.201      rdata->glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  38.202      rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_CENTER);
  38.203      rdata->glDisableVertexAttribArray(GLES2_ATTRIBUTE_ANGLE);
  38.204 -    if (rdata->glGetError() != GL_NO_ERROR)
  38.205 -    {
  38.206 -        SDL_SetError("Failed to render texture");
  38.207 -        return -1;
  38.208 +    if (rdata->glGetError() != GL_NO_ERROR) {
  38.209 +        return SDL_SetError("Failed to render texture");
  38.210      }
  38.211      return 0;
  38.212  }
  38.213 @@ -1525,8 +1497,7 @@
  38.214      temp_pitch = rect->w * SDL_BYTESPERPIXEL(temp_format);
  38.215      temp_pixels = SDL_malloc(rect->h * temp_pitch);
  38.216      if (!temp_pixels) {
  38.217 -        SDL_OutOfMemory();
  38.218 -        return -1;
  38.219 +        return SDL_OutOfMemory();
  38.220      }
  38.221  
  38.222      SDL_GetWindowSize(window, &w, &h);
    39.1 --- a/src/render/psp/SDL_render_psp.c	Fri Mar 29 21:29:57 2013 -0400
    39.2 +++ b/src/render/psp/SDL_render_psp.c	Sun Mar 31 12:48:50 2013 -0400
    39.3 @@ -493,9 +493,8 @@
    39.4  	
    39.5  	if(!psp_texture->data)
    39.6  	{
    39.7 -		SDL_OutOfMemory();
    39.8  		SDL_free(psp_texture);
    39.9 -		return -1;
   39.10 +		return SDL_OutOfMemory();
   39.11  	}
   39.12      texture->driverdata = psp_texture;
   39.13      
    40.1 --- a/src/render/software/SDL_blendfillrect.c	Fri Mar 29 21:29:57 2013 -0400
    40.2 +++ b/src/render/software/SDL_blendfillrect.c	Sun Mar 31 12:48:50 2013 -0400
    40.3 @@ -159,8 +159,7 @@
    40.4          }
    40.5          return 0;
    40.6      default:
    40.7 -        SDL_Unsupported();
    40.8 -        return -1;
    40.9 +        return SDL_Unsupported();
   40.10      }
   40.11  }
   40.12  
   40.13 @@ -189,8 +188,7 @@
   40.14          }
   40.15          return 0;
   40.16      default:
   40.17 -        SDL_Unsupported();
   40.18 -        return -1;
   40.19 +        return SDL_Unsupported();
   40.20      }
   40.21  }
   40.22  
   40.23 @@ -201,14 +199,12 @@
   40.24      SDL_Rect clipped;
   40.25  
   40.26      if (!dst) {
   40.27 -        SDL_SetError("Passed NULL destination surface");
   40.28 -        return -1;
   40.29 +        return SDL_SetError("Passed NULL destination surface");
   40.30      }
   40.31  
   40.32      /* This function doesn't work on surfaces < 8 bpp */
   40.33      if (dst->format->BitsPerPixel < 8) {
   40.34 -        SDL_SetError("SDL_BlendFillRect(): Unsupported surface format");
   40.35 -        return -1;
   40.36 +        return SDL_SetError("SDL_BlendFillRect(): Unsupported surface format");
   40.37      }
   40.38  
   40.39      /* If 'rect' == NULL, then fill the whole surface */
   40.40 @@ -274,14 +270,12 @@
   40.41      int status = 0;
   40.42  
   40.43      if (!dst) {
   40.44 -        SDL_SetError("Passed NULL destination surface");
   40.45 -        return -1;
   40.46 +        return SDL_SetError("Passed NULL destination surface");
   40.47      }
   40.48  
   40.49      /* This function doesn't work on surfaces < 8 bpp */
   40.50      if (dst->format->BitsPerPixel < 8) {
   40.51 -        SDL_SetError("SDL_BlendFillRects(): Unsupported surface format");
   40.52 -        return -1;
   40.53 +        return SDL_SetError("SDL_BlendFillRects(): Unsupported surface format");
   40.54      }
   40.55  
   40.56      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
    41.1 --- a/src/render/software/SDL_blendline.c	Fri Mar 29 21:29:57 2013 -0400
    41.2 +++ b/src/render/software/SDL_blendline.c	Sun Mar 31 12:48:50 2013 -0400
    41.3 @@ -711,14 +711,12 @@
    41.4      BlendLineFunc func;
    41.5  
    41.6      if (!dst) {
    41.7 -        SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
    41.8 -        return -1;
    41.9 +        return SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
   41.10      }
   41.11  
   41.12      func = SDL_CalculateBlendLineFunc(dst->format);
   41.13      if (!func) {
   41.14 -        SDL_SetError("SDL_BlendLine(): Unsupported surface format");
   41.15 -        return -1;
   41.16 +        return SDL_SetError("SDL_BlendLine(): Unsupported surface format");
   41.17      }
   41.18  
   41.19      /* Perform clipping */
   41.20 @@ -742,14 +740,12 @@
   41.21      BlendLineFunc func;
   41.22  
   41.23      if (!dst) {
   41.24 -        SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
   41.25 -        return -1;
   41.26 +        return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
   41.27      }
   41.28  
   41.29      func = SDL_CalculateBlendLineFunc(dst->format);
   41.30      if (!func) {
   41.31 -        SDL_SetError("SDL_BlendLines(): Unsupported surface format");
   41.32 -        return -1;
   41.33 +        return SDL_SetError("SDL_BlendLines(): Unsupported surface format");
   41.34      }
   41.35  
   41.36      for (i = 1; i < count; ++i) {
    42.1 --- a/src/render/software/SDL_blendpoint.c	Fri Mar 29 21:29:57 2013 -0400
    42.2 +++ b/src/render/software/SDL_blendpoint.c	Sun Mar 31 12:48:50 2013 -0400
    42.3 @@ -159,8 +159,7 @@
    42.4          }
    42.5          return 0;
    42.6      default:
    42.7 -        SDL_Unsupported();
    42.8 -        return -1;
    42.9 +        return SDL_Unsupported();
   42.10      }
   42.11  }
   42.12  
   42.13 @@ -189,8 +188,7 @@
   42.14          }
   42.15          return 0;
   42.16      default:
   42.17 -        SDL_Unsupported();
   42.18 -        return -1;
   42.19 +        return SDL_Unsupported();
   42.20      }
   42.21  }
   42.22  
   42.23 @@ -199,14 +197,12 @@
   42.24                 Uint8 g, Uint8 b, Uint8 a)
   42.25  {
   42.26      if (!dst) {
   42.27 -        SDL_SetError("Passed NULL destination surface");
   42.28 -        return -1;
   42.29 +        return SDL_SetError("Passed NULL destination surface");
   42.30      }
   42.31  
   42.32      /* This function doesn't work on surfaces < 8 bpp */
   42.33      if (dst->format->BitsPerPixel < 8) {
   42.34 -        SDL_SetError("SDL_BlendPoint(): Unsupported surface format");
   42.35 -        return -1;
   42.36 +        return SDL_SetError("SDL_BlendPoint(): Unsupported surface format");
   42.37      }
   42.38  
   42.39      /* Perform clipping */
   42.40 @@ -272,14 +268,12 @@
   42.41      int status = 0;
   42.42  
   42.43      if (!dst) {
   42.44 -        SDL_SetError("Passed NULL destination surface");
   42.45 -        return -1;
   42.46 +        return SDL_SetError("Passed NULL destination surface");
   42.47      }
   42.48  
   42.49      /* This function doesn't work on surfaces < 8 bpp */
   42.50      if (dst->format->BitsPerPixel < 8) {
   42.51 -        SDL_SetError("SDL_BlendPoints(): Unsupported surface format");
   42.52 -        return (-1);
   42.53 +        return SDL_SetError("SDL_BlendPoints(): Unsupported surface format");
   42.54      }
   42.55  
   42.56      if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
    43.1 --- a/src/render/software/SDL_drawline.c	Fri Mar 29 21:29:57 2013 -0400
    43.2 +++ b/src/render/software/SDL_drawline.c	Sun Mar 31 12:48:50 2013 -0400
    43.3 @@ -145,14 +145,12 @@
    43.4      DrawLineFunc func;
    43.5  
    43.6      if (!dst) {
    43.7 -        SDL_SetError("SDL_DrawLine(): Passed NULL destination surface");
    43.8 -        return -1;
    43.9 +        return SDL_SetError("SDL_DrawLine(): Passed NULL destination surface");
   43.10      }
   43.11  
   43.12      func = SDL_CalculateDrawLineFunc(dst->format);
   43.13      if (!func) {
   43.14 -        SDL_SetError("SDL_DrawLine(): Unsupported surface format");
   43.15 -        return -1;
   43.16 +        return SDL_SetError("SDL_DrawLine(): Unsupported surface format");
   43.17      }
   43.18  
   43.19      /* Perform clipping */
   43.20 @@ -176,14 +174,12 @@
   43.21      DrawLineFunc func;
   43.22  
   43.23      if (!dst) {
   43.24 -        SDL_SetError("SDL_DrawLines(): Passed NULL destination surface");
   43.25 -        return -1;
   43.26 +        return SDL_SetError("SDL_DrawLines(): Passed NULL destination surface");
   43.27      }
   43.28  
   43.29      func = SDL_CalculateDrawLineFunc(dst->format);
   43.30      if (!func) {
   43.31 -        SDL_SetError("SDL_DrawLines(): Unsupported surface format");
   43.32 -        return -1;
   43.33 +        return SDL_SetError("SDL_DrawLines(): Unsupported surface format");
   43.34      }
   43.35  
   43.36      for (i = 1; i < count; ++i) {
    44.1 --- a/src/render/software/SDL_drawpoint.c	Fri Mar 29 21:29:57 2013 -0400
    44.2 +++ b/src/render/software/SDL_drawpoint.c	Sun Mar 31 12:48:50 2013 -0400
    44.3 @@ -30,14 +30,12 @@
    44.4  SDL_DrawPoint(SDL_Surface * dst, int x, int y, Uint32 color)
    44.5  {
    44.6      if (!dst) {
    44.7 -        SDL_SetError("Passed NULL destination surface");
    44.8 -        return -1;
    44.9 +        return SDL_SetError("Passed NULL destination surface");
   44.10      }
   44.11  
   44.12      /* This function doesn't work on surfaces < 8 bpp */
   44.13      if (dst->format->BitsPerPixel < 8) {
   44.14 -        SDL_SetError("SDL_DrawPoint(): Unsupported surface format");
   44.15 -        return -1;
   44.16 +        return SDL_SetError("SDL_DrawPoint(): Unsupported surface format");
   44.17      }
   44.18  
   44.19      /* Perform clipping */
   44.20 @@ -55,8 +53,7 @@
   44.21          DRAW_FASTSETPIXELXY2(x, y);
   44.22          break;
   44.23      case 3:
   44.24 -        SDL_Unsupported();
   44.25 -        return -1;
   44.26 +        return SDL_Unsupported();
   44.27      case 4:
   44.28          DRAW_FASTSETPIXELXY4(x, y);
   44.29          break;
   44.30 @@ -74,14 +71,12 @@
   44.31      int x, y;
   44.32  
   44.33      if (!dst) {
   44.34 -        SDL_SetError("Passed NULL destination surface");
   44.35 -        return -1;
   44.36 +        return SDL_SetError("Passed NULL destination surface");
   44.37      }
   44.38  
   44.39      /* This function doesn't work on surfaces < 8 bpp */
   44.40      if (dst->format->BitsPerPixel < 8) {
   44.41 -        SDL_SetError("SDL_DrawPoints(): Unsupported surface format");
   44.42 -        return -1;
   44.43 +        return SDL_SetError("SDL_DrawPoints(): Unsupported surface format");
   44.44      }
   44.45  
   44.46      minx = dst->clip_rect.x;
   44.47 @@ -105,8 +100,7 @@
   44.48              DRAW_FASTSETPIXELXY2(x, y);
   44.49              break;
   44.50          case 3:
   44.51 -            SDL_Unsupported();
   44.52 -            return -1;
   44.53 +            return SDL_Unsupported();
   44.54          case 4:
   44.55              DRAW_FASTSETPIXELXY4(x, y);
   44.56              break;
    45.1 --- a/src/render/software/SDL_render_sw.c	Fri Mar 29 21:29:57 2013 -0400
    45.2 +++ b/src/render/software/SDL_render_sw.c	Sun Mar 31 12:48:50 2013 -0400
    45.3 @@ -200,8 +200,7 @@
    45.4  
    45.5      if (!SDL_PixelFormatEnumToMasks
    45.6          (texture->format, &bpp, &Rmask, &Gmask, &Bmask, &Amask)) {
    45.7 -        SDL_SetError("Unknown texture format");
    45.8 -        return -1;
    45.9 +        return SDL_SetError("Unknown texture format");
   45.10      }
   45.11  
   45.12      texture->driverdata =
   45.13 @@ -357,8 +356,7 @@
   45.14  
   45.15      final_points = SDL_stack_alloc(SDL_Point, count);
   45.16      if (!final_points) {
   45.17 -        SDL_OutOfMemory();
   45.18 -        return -1;
   45.19 +        return SDL_OutOfMemory();
   45.20      }
   45.21      if (renderer->viewport.x || renderer->viewport.y) {
   45.22          int x = renderer->viewport.x;
   45.23 @@ -407,8 +405,7 @@
   45.24  
   45.25      final_points = SDL_stack_alloc(SDL_Point, count);
   45.26      if (!final_points) {
   45.27 -        SDL_OutOfMemory();
   45.28 -        return -1;
   45.29 +        return SDL_OutOfMemory();
   45.30      }
   45.31      if (renderer->viewport.x || renderer->viewport.y) {
   45.32          int x = renderer->viewport.x;
   45.33 @@ -456,8 +453,7 @@
   45.34  
   45.35      final_rects = SDL_stack_alloc(SDL_Rect, count);
   45.36      if (!final_rects) {
   45.37 -        SDL_OutOfMemory();
   45.38 -        return -1;
   45.39 +        return SDL_OutOfMemory();
   45.40      }
   45.41      if (renderer->viewport.x || renderer->viewport.y) {
   45.42          int x = renderer->viewport.x;
   45.43 @@ -647,8 +643,7 @@
   45.44  
   45.45      if (rect->x < 0 || rect->x+rect->w > surface->w ||
   45.46          rect->y < 0 || rect->y+rect->h > surface->h) {
   45.47 -        SDL_SetError("Tried to read outside of surface bounds");
   45.48 -        return -1;
   45.49 +        return SDL_SetError("Tried to read outside of surface bounds");
   45.50      }
   45.51  
   45.52      src_format = surface->format->format;
    46.1 --- a/src/test/SDL_test_fuzzer.c	Fri Mar 29 21:29:57 2013 -0400
    46.2 +++ b/src/test/SDL_test_fuzzer.c	Sun Mar 31 12:48:50 2013 -0400
    46.3 @@ -251,7 +251,7 @@
    46.4  
    46.5  	if (index == 0) {
    46.6  		/* There are no valid boundaries */
    46.7 -		SDL_Error(SDL_UNSUPPORTED);
    46.8 +		SDL_Unsupported();
    46.9  		return 0;
   46.10  	}
   46.11  
   46.12 @@ -379,7 +379,7 @@
   46.13  
   46.14  	if (index == 0) {
   46.15  		/* There are no valid boundaries */
   46.16 -		SDL_Error(SDL_UNSUPPORTED);
   46.17 +		SDL_Unsupported();
   46.18  		return minValue;
   46.19  	}
   46.20  
    47.1 --- a/src/thread/beos/SDL_syssem.c	Fri Mar 29 21:29:57 2013 -0400
    47.2 +++ b/src/thread/beos/SDL_syssem.c	Sun Mar 31 12:48:50 2013 -0400
    47.3 @@ -73,8 +73,7 @@
    47.4      int retval;
    47.5  
    47.6      if (!sem) {
    47.7 -        SDL_SetError("Passed a NULL semaphore");
    47.8 -        return -1;
    47.9 +        return SDL_SetError("Passed a NULL semaphore");
   47.10      }
   47.11  
   47.12    tryagain:
   47.13 @@ -97,8 +96,7 @@
   47.14          retval = SDL_MUTEX_TIMEDOUT;
   47.15          break;
   47.16      default:
   47.17 -        SDL_SetError("acquire_sem() failed");
   47.18 -        retval = -1;
   47.19 +        retval = SDL_SetError("acquire_sem() failed");
   47.20          break;
   47.21      }
   47.22  
   47.23 @@ -139,13 +137,11 @@
   47.24  SDL_SemPost(SDL_sem * sem)
   47.25  {
   47.26      if (!sem) {
   47.27 -        SDL_SetError("Passed a NULL semaphore");
   47.28 -        return -1;
   47.29 +        return SDL_SetError("Passed a NULL semaphore");
   47.30      }
   47.31  
   47.32      if (release_sem(sem->id) != B_NO_ERROR) {
   47.33 -        SDL_SetError("release_sem() failed");
   47.34 -        return -1;
   47.35 +        return SDL_SetError("release_sem() failed");
   47.36      }
   47.37      return 0;
   47.38  }
    48.1 --- a/src/thread/beos/SDL_systhread.c	Fri Mar 29 21:29:57 2013 -0400
    48.2 +++ b/src/thread/beos/SDL_systhread.c	Sun Mar 31 12:48:50 2013 -0400
    48.3 @@ -77,8 +77,7 @@
    48.4      thread->handle = spawn_thread(RunThread, name, B_NORMAL_PRIORITY, args);
    48.5      if ((thread->handle == B_NO_MORE_THREADS) ||
    48.6          (thread->handle == B_NO_MEMORY)) {
    48.7 -        SDL_SetError("Not enough resources to create thread");
    48.8 -        return (-1);
    48.9 +        return SDL_SetError("Not enough resources to create thread");
   48.10      }
   48.11      resume_thread(thread->handle);
   48.12      return (0);
    49.1 --- a/src/thread/generic/SDL_syscond.c	Fri Mar 29 21:29:57 2013 -0400
    49.2 +++ b/src/thread/generic/SDL_syscond.c	Sun Mar 31 12:48:50 2013 -0400
    49.3 @@ -82,8 +82,7 @@
    49.4  SDL_CondSignal(SDL_cond * cond)
    49.5  {
    49.6      if (!cond) {
    49.7 -        SDL_SetError("Passed a NULL condition variable");
    49.8 -        return -1;
    49.9 +        return SDL_SetError("Passed a NULL condition variable");
   49.10      }
   49.11  
   49.12      /* If there are waiting threads not already signalled, then
   49.13 @@ -107,8 +106,7 @@
   49.14  SDL_CondBroadcast(SDL_cond * cond)
   49.15  {
   49.16      if (!cond) {
   49.17 -        SDL_SetError("Passed a NULL condition variable");
   49.18 -        return -1;
   49.19 +        return SDL_SetError("Passed a NULL condition variable");
   49.20      }
   49.21  
   49.22      /* If there are waiting threads not already signalled, then
   49.23 @@ -164,8 +162,7 @@
   49.24      int retval;
   49.25  
   49.26      if (!cond) {
   49.27 -        SDL_SetError("Passed a NULL condition variable");
   49.28 -        return -1;
   49.29 +        return SDL_SetError("Passed a NULL condition variable");
   49.30      }
   49.31  
   49.32      /* Obtain the protection mutex, and increment the number of waiters.
    50.1 --- a/src/thread/generic/SDL_sysmutex.c	Fri Mar 29 21:29:57 2013 -0400
    50.2 +++ b/src/thread/generic/SDL_sysmutex.c	Sun Mar 31 12:48:50 2013 -0400
    50.3 @@ -78,8 +78,7 @@
    50.4      SDL_threadID this_thread;
    50.5  
    50.6      if (mutex == NULL) {
    50.7 -        SDL_SetError("Passed a NULL mutex");
    50.8 -        return -1;
    50.9 +        return SDL_SetError("Passed a NULL mutex");
   50.10      }
   50.11  
   50.12      this_thread = SDL_ThreadID();
   50.13 @@ -110,8 +109,7 @@
   50.14      SDL_threadID this_thread;
   50.15  
   50.16      if (mutex == NULL) {
   50.17 -        SDL_SetError("Passed a NULL mutex");
   50.18 -        return -1;
   50.19 +        return SDL_SetError("Passed a NULL mutex");
   50.20      }
   50.21  
   50.22      this_thread = SDL_ThreadID();
   50.23 @@ -141,14 +139,12 @@
   50.24      return 0;
   50.25  #else
   50.26      if (mutex == NULL) {
   50.27 -        SDL_SetError("Passed a NULL mutex");
   50.28 -        return -1;
   50.29 +        return SDL_SetError("Passed a NULL mutex");
   50.30      }
   50.31  
   50.32      /* If we don't own the mutex, we can't unlock it */
   50.33      if (SDL_ThreadID() != mutex->owner) {
   50.34 -        SDL_SetError("mutex not owned by this thread");
   50.35 -        return -1;
   50.36 +        return SDL_SetError("mutex not owned by this thread");
   50.37      }
   50.38  
   50.39      if (mutex->recursive) {
    51.1 --- a/src/thread/generic/SDL_syssem.c	Fri Mar 29 21:29:57 2013 -0400
    51.2 +++ b/src/thread/generic/SDL_syssem.c	Sun Mar 31 12:48:50 2013 -0400
    51.3 @@ -39,28 +39,24 @@
    51.4  void
    51.5  SDL_DestroySemaphore(SDL_sem * sem)
    51.6  {
    51.7 -    return;
    51.8  }
    51.9  
   51.10  int
   51.11  SDL_SemTryWait(SDL_sem * sem)
   51.12  {
   51.13 -    SDL_SetError("SDL not configured with thread support");
   51.14 -    return -1;
   51.15 +    return SDL_SetError("SDL not configured with thread support");
   51.16  }
   51.17  
   51.18  int
   51.19  SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
   51.20  {
   51.21 -    SDL_SetError("SDL not configured with thread support");
   51.22 -    return -1;
   51.23 +    return SDL_SetError("SDL not configured with thread support");
   51.24  }
   51.25  
   51.26  int
   51.27  SDL_SemWait(SDL_sem * sem)
   51.28  {
   51.29 -    SDL_SetError("SDL not configured with thread support");
   51.30 -    return -1;
   51.31 +    return SDL_SetError("SDL not configured with thread support");
   51.32  }
   51.33  
   51.34  Uint32
   51.35 @@ -72,8 +68,7 @@
   51.36  int
   51.37  SDL_SemPost(SDL_sem * sem)
   51.38  {
   51.39 -    SDL_SetError("SDL not configured with thread support");
   51.40 -    return -1;
   51.41 +    return SDL_SetError("SDL not configured with thread support");
   51.42  }
   51.43  
   51.44  #else
   51.45 @@ -137,8 +132,7 @@
   51.46      int retval;
   51.47  
   51.48      if (!sem) {
   51.49 -        SDL_SetError("Passed a NULL semaphore");
   51.50 -        return -1;
   51.51 +        return SDL_SetError("Passed a NULL semaphore");
   51.52      }
   51.53  
   51.54      retval = SDL_MUTEX_TIMEDOUT;
   51.55 @@ -158,8 +152,7 @@
   51.56      int retval;
   51.57  
   51.58      if (!sem) {
   51.59 -        SDL_SetError("Passed a NULL semaphore");
   51.60 -        return -1;
   51.61 +        return SDL_SetError("Passed a NULL semaphore");
   51.62      }
   51.63  
   51.64      /* A timeout of 0 is an easy case */
   51.65 @@ -207,8 +200,7 @@
   51.66  SDL_SemPost(SDL_sem * sem)
   51.67  {
   51.68      if (!sem) {
   51.69 -        SDL_SetError("Passed a NULL semaphore");
   51.70 -        return -1;
   51.71 +        return SDL_SetError("Passed a NULL semaphore");
   51.72      }
   51.73  
   51.74      SDL_LockMutex(sem->count_lock);
    52.1 --- a/src/thread/generic/SDL_systhread.c	Fri Mar 29 21:29:57 2013 -0400
    52.2 +++ b/src/thread/generic/SDL_systhread.c	Sun Mar 31 12:48:50 2013 -0400
    52.3 @@ -28,8 +28,7 @@
    52.4  int
    52.5  SDL_SYS_CreateThread(SDL_Thread * thread, void *args)
    52.6  {
    52.7 -    SDL_SetError("Threads are not supported on this platform");
    52.8 -    return (-1);
    52.9 +    return SDL_SetError("Threads are not supported on this platform");
   52.10  }
   52.11  
   52.12  void
    53.1 --- a/src/thread/psp/SDL_syscond.c	Fri Mar 29 21:29:57 2013 -0400
    53.2 +++ b/src/thread/psp/SDL_syscond.c	Sun Mar 31 12:48:50 2013 -0400
    53.3 @@ -82,8 +82,7 @@
    53.4  SDL_CondSignal(SDL_cond * cond)
    53.5  {
    53.6      if (!cond) {
    53.7 -        SDL_SetError("Passed a NULL condition variable");
    53.8 -        return -1;
    53.9 +        return SDL_SetError("Passed a NULL condition variable");
   53.10      }
   53.11  
   53.12      /* If there are waiting threads not already signalled, then
   53.13 @@ -107,8 +106,7 @@
   53.14  SDL_CondBroadcast(SDL_cond * cond)
   53.15  {
   53.16      if (!cond) {
   53.17 -        SDL_SetError("Passed a NULL condition variable");
   53.18 -        return -1;
   53.19 +        return SDL_SetError("Passed a NULL condition variable");
   53.20      }
   53.21  
   53.22      /* If there are waiting threads not already signalled, then
   53.23 @@ -164,8 +162,7 @@
   53.24      int retval;
   53.25  
   53.26      if (!cond) {
   53.27 -        SDL_SetError("Passed a NULL condition variable");
   53.28 -        return -1;
   53.29 +        return SDL_SetError("Passed a NULL condition variable");
   53.30      }
   53.31  
   53.32      /* Obtain the protection mutex, and increment the number of waiters.
    54.1 --- a/src/thread/psp/SDL_sysmutex.c	Fri Mar 29 21:29:57 2013 -0400
    54.2 +++ b/src/thread/psp/SDL_sysmutex.c	Sun Mar 31 12:48:50 2013 -0400
    54.3 @@ -78,8 +78,7 @@
    54.4      SDL_threadID this_thread;
    54.5  
    54.6      if (mutex == NULL) {
    54.7 -        SDL_SetError("Passed a NULL mutex");
    54.8 -        return -1;
    54.9 +        return SDL_SetError("Passed a NULL mutex");
   54.10      }
   54.11  
   54.12      this_thread = SDL_ThreadID();
   54.13 @@ -107,14 +106,12 @@
   54.14      return 0;
   54.15  #else
   54.16      if (mutex == NULL) {
   54.17 -        SDL_SetError("Passed a NULL mutex");
   54.18 -        return -1;
   54.19 +        return SDL_SetError("Passed a NULL mutex");
   54.20      }
   54.21  
   54.22      /* If we don't own the mutex, we can't unlock it */
   54.23      if (SDL_ThreadID() != mutex->owner) {
   54.24 -        SDL_SetError("mutex not owned by this thread");
   54.25 -        return -1;
   54.26 +        return SDL_SetError("mutex not owned by this thread");
   54.27      }
   54.28  
   54.29      if (mutex->recursive) {
    55.1 --- a/src/thread/psp/SDL_syssem.c	Fri Mar 29 21:29:57 2013 -0400
    55.2 +++ b/src/thread/psp/SDL_syssem.c	Sun Mar 31 12:48:50 2013 -0400
    55.3 @@ -105,8 +105,7 @@
    55.4                 case SCE_KERNEL_ERROR_WAIT_TIMEOUT:
    55.5                         return SDL_MUTEX_TIMEDOUT;
    55.6                 default:
    55.7 -                       SDL_SetError("WaitForSingleObject() failed");
    55.8 -                       return -1;
    55.9 +                       return SDL_SetError("WaitForSingleObject() failed");
   55.10  	}
   55.11  }
   55.12  
   55.13 @@ -142,14 +141,12 @@
   55.14  	int res;
   55.15  
   55.16  	if (sem == NULL) {
   55.17 -		SDL_SetError("Passed a NULL sem");
   55.18 -		return -1;
   55.19 +		return SDL_SetError("Passed a NULL sem");
   55.20  	}
   55.21  
   55.22  	res = sceKernelSignalSema(sem->semid, 1);
   55.23  	if (res < 0) {
   55.24 -		SDL_SetError("sceKernelSignalSema() failed");
   55.25 -		return -1;
   55.26 +		return SDL_SetError("sceKernelSignalSema() failed");
   55.27  	}
   55.28  
   55.29  	return 0;
    56.1 --- a/src/thread/psp/SDL_systhread.c	Fri Mar 29 21:29:57 2013 -0400
    56.2 +++ b/src/thread/psp/SDL_systhread.c	Sun Mar 31 12:48:50 2013 -0400
    56.3 @@ -54,8 +54,7 @@
    56.4  					       priority, 0x8000, 
    56.5  					       PSP_THREAD_ATTR_VFPU, NULL);
    56.6  	if (thread->handle < 0) {
    56.7 -		SDL_SetError("sceKernelCreateThread() failed");
    56.8 -		return -1;
    56.9 +		return SDL_SetError("sceKernelCreateThread() failed");
   56.10  	}
   56.11  
   56.12  	sceKernelStartThread(thread->handle, 4, &args);
    57.1 --- a/src/thread/pthread/SDL_syscond.c	Fri Mar 29 21:29:57 2013 -0400
    57.2 +++ b/src/thread/pthread/SDL_syscond.c	Sun Mar 31 12:48:50 2013 -0400
    57.3 @@ -67,14 +67,12 @@
    57.4      int retval;
    57.5  
    57.6      if (!cond) {
    57.7 -        SDL_SetError("Passed a NULL condition variable");
    57.8 -        return -1;
    57.9 +        return SDL_SetError("Passed a NULL condition variable");
   57.10      }
   57.11  
   57.12      retval = 0;
   57.13      if (pthread_cond_signal(&cond->cond) != 0) {
   57.14 -        SDL_SetError("pthread_cond_signal() failed");
   57.15 -        retval = -1;
   57.16 +        return SDL_SetError("pthread_cond_signal() failed");
   57.17      }
   57.18      return retval;
   57.19  }
   57.20 @@ -86,14 +84,12 @@
   57.21      int retval;
   57.22  
   57.23      if (!cond) {
   57.24 -        SDL_SetError("Passed a NULL condition variable");
   57.25 -        return -1;
   57.26 +        return SDL_SetError("Passed a NULL condition variable");
   57.27      }
   57.28  
   57.29      retval = 0;
   57.30      if (pthread_cond_broadcast(&cond->cond) != 0) {
   57.31 -        SDL_SetError("pthread_cond_broadcast() failed");
   57.32 -        retval = -1;
   57.33 +        return SDL_SetError("pthread_cond_broadcast() failed");
   57.34      }
   57.35      return retval;
   57.36  }
   57.37 @@ -106,8 +102,7 @@
   57.38      struct timespec abstime;
   57.39  
   57.40      if (!cond) {
   57.41 -        SDL_SetError("Passed a NULL condition variable");
   57.42 -        return -1;
   57.43 +        return SDL_SetError("Passed a NULL condition variable");
   57.44      }
   57.45  
   57.46      gettimeofday(&delta, NULL);
   57.47 @@ -131,9 +126,7 @@
   57.48      case 0:
   57.49          break;
   57.50      default:
   57.51 -        SDL_SetError("pthread_cond_timedwait() failed");
   57.52 -        retval = -1;
   57.53 -        break;
   57.54 +        retval = SDL_SetError("pthread_cond_timedwait() failed");
   57.55      }
   57.56      return retval;
   57.57  }
   57.58 @@ -144,19 +137,12 @@
   57.59  int
   57.60  SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex)
   57.61  {
   57.62 -    int retval;
   57.63 -
   57.64      if (!cond) {
   57.65 -        SDL_SetError("Passed a NULL condition variable");
   57.66 -        return -1;
   57.67 +        return SDL_SetError("Passed a NULL condition variable");
   57.68 +    } else if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) {
   57.69 +        return SDL_SetError("pthread_cond_wait() failed");
   57.70      }
   57.71 -
   57.72 -    retval = 0;
   57.73 -    if (pthread_cond_wait(&cond->cond, &mutex->id) != 0) {
   57.74 -        SDL_SetError("pthread_cond_wait() failed");
   57.75 -        retval = -1;
   57.76 -    }
   57.77 -    return retval;
   57.78 +    return 0;
   57.79  }
   57.80  
   57.81  /* vi: set ts=4 sw=4 expandtab: */
    58.1 --- a/src/thread/pthread/SDL_sysmutex.c	Fri Mar 29 21:29:57 2013 -0400
    58.2 +++ b/src/thread/pthread/SDL_sysmutex.c	Sun Mar 31 12:48:50 2013 -0400
    58.3 @@ -81,17 +81,14 @@
    58.4  int
    58.5  SDL_LockMutex(SDL_mutex * mutex)
    58.6  {
    58.7 -    int retval;
    58.8  #if FAKE_RECURSIVE_MUTEX
    58.9      pthread_t this_thread;
   58.10  #endif
   58.11  
   58.12      if (mutex == NULL) {
   58.13 -        SDL_SetError("Passed a NULL mutex");
   58.14 -        return -1;
   58.15 +        return SDL_SetError("Passed a NULL mutex");
   58.16      }
   58.17  
   58.18 -    retval = 0;
   58.19  #if FAKE_RECURSIVE_MUTEX
   58.20      this_thread = pthread_self();
   58.21      if (mutex->owner == this_thread) {
   58.22 @@ -105,17 +102,15 @@
   58.23              mutex->owner = this_thread;
   58.24              mutex->recursive = 0;
   58.25          } else {
   58.26 -            SDL_SetError("pthread_mutex_lock() failed");
   58.27 -            retval = -1;
   58.28 +            return SDL_SetError("pthread_mutex_lock() failed");
   58.29          }
   58.30      }
   58.31  #else
   58.32      if (pthread_mutex_lock(&mutex->id) < 0) {
   58.33 -        SDL_SetError("pthread_mutex_lock() failed");
   58.34 -        retval = -1;
   58.35 +        return SDL_SetError("pthread_mutex_lock() failed");
   58.36      }
   58.37  #endif
   58.38 -    return retval;
   58.39 +    return 0;
   58.40  }
   58.41  
   58.42  int
   58.43 @@ -127,8 +122,7 @@
   58.44  #endif
   58.45  
   58.46      if (mutex == NULL) {
   58.47 -        SDL_SetError("Passed a NULL mutex");
   58.48 -        return -1;
   58.49 +        return SDL_SetError("Passed a NULL mutex");
   58.50      }
   58.51  
   58.52      retval = 0;
   58.53 @@ -147,8 +141,7 @@
   58.54          } else if (errno == EBUSY) {
   58.55              retval = SDL_MUTEX_TIMEDOUT;
   58.56          } else {
   58.57 -            SDL_SetError("pthread_mutex_trylock() failed");
   58.58 -            retval = -1;
   58.59 +            retval = SDL_SetError("pthread_mutex_trylock() failed");
   58.60          }
   58.61      }
   58.62  #else
   58.63 @@ -156,8 +149,7 @@
   58.64          if (errno == EBUSY) {
   58.65              retval = SDL_MUTEX_TIMEDOUT;
   58.66          } else {
   58.67 -            SDL_SetError("pthread_mutex_trylock() failed");
   58.68 -            retval = -1;
   58.69 +            retval = SDL_SetError("pthread_mutex_trylock() failed");
   58.70          }
   58.71      }
   58.72  #endif
   58.73 @@ -167,14 +159,10 @@
   58.74  int
   58.75  SDL_UnlockMutex(SDL_mutex * mutex)
   58.76  {
   58.77 -    int retval;
   58.78 -
   58.79      if (mutex == NULL) {
   58.80 -        SDL_SetError("Passed a NULL mutex");
   58.81 -        return -1;
   58.82 +        return SDL_SetError("Passed a NULL mutex");
   58.83      }
   58.84  
   58.85 -    retval = 0;
   58.86  #if FAKE_RECURSIVE_MUTEX
   58.87      /* We can only unlock the mutex if we own it */
   58.88      if (pthread_self() == mutex->owner) {
   58.89 @@ -190,18 +178,16 @@
   58.90              pthread_mutex_unlock(&mutex->id);
   58.91          }
   58.92      } else {
   58.93 -        SDL_SetError("mutex not owned by this thread");
   58.94 -        retval = -1;
   58.95 +        return SDL_SetError("mutex not owned by this thread");
   58.96      }
   58.97  
   58.98  #else
   58.99      if (pthread_mutex_unlock(&mutex->id) < 0) {
  58.100 -        SDL_SetError("pthread_mutex_unlock() failed");
  58.101 -        retval = -1;
  58.102 +        return SDL_SetError("pthread_mutex_unlock() failed");
  58.103      }
  58.104  #endif /* FAKE_RECURSIVE_MUTEX */
  58.105  
  58.106 -    return retval;
  58.107 +    return 0;
  58.108  }
  58.109  
  58.110  /* vi: set ts=4 sw=4 expandtab: */
    59.1 --- a/src/thread/pthread/SDL_syssem.c	Fri Mar 29 21:29:57 2013 -0400
    59.2 +++ b/src/thread/pthread/SDL_syssem.c	Sun Mar 31 12:48:50 2013 -0400
    59.3 @@ -72,8 +72,7 @@
    59.4      int retval;
    59.5  
    59.6      if (!sem) {
    59.7 -        SDL_SetError("Passed a NULL semaphore");
    59.8 -        return -1;
    59.9 +        return SDL_SetError("Passed a NULL semaphore");
   59.10      }
   59.11      retval = SDL_MUTEX_TIMEDOUT;
   59.12      if (sem_trywait(&sem->sem) == 0) {
   59.13 @@ -88,13 +87,12 @@
   59.14      int retval;
   59.15  
   59.16      if (!sem) {
   59.17 -        SDL_SetError("Passed a NULL semaphore");
   59.18 -        return -1;
   59.19 +        return SDL_SetError("Passed a NULL semaphore");
   59.20      }
   59.21  
   59.22      retval = sem_wait(&sem->sem);
   59.23      if (retval < 0) {
   59.24 -        SDL_SetError("sem_wait() failed");
   59.25 +        retval = SDL_SetError("sem_wait() failed");
   59.26      }
   59.27      return retval;
   59.28  }
   59.29 @@ -111,8 +109,7 @@
   59.30  #endif
   59.31  
   59.32      if (!sem) {
   59.33 -        SDL_SetError("Passed a NULL semaphore");
   59.34 -        return -1;
   59.35 +        return SDL_SetError("Passed a NULL semaphore");
   59.36      }
   59.37  
   59.38      /* Try the easy cases first */
   59.39 @@ -188,8 +185,7 @@
   59.40      int retval;
   59.41  
   59.42      if (!sem) {
   59.43 -        SDL_SetError("Passed a NULL semaphore");
   59.44 -        return -1;
   59.45 +        return SDL_SetError("Passed a NULL semaphore");
   59.46      }
   59.47  
   59.48      retval = sem_post(&sem->sem);
    60.1 --- a/src/thread/pthread/SDL_systhread.c	Fri Mar 29 21:29:57 2013 -0400
    60.2 +++ b/src/thread/pthread/SDL_systhread.c	Sun Mar 31 12:48:50 2013 -0400
    60.3 @@ -97,18 +97,16 @@
    60.4  
    60.5      /* Set the thread attributes */
    60.6      if (pthread_attr_init(&type) != 0) {
    60.7 -        SDL_SetError("Couldn't initialize pthread attributes");
    60.8 -        return (-1);
    60.9 +        return SDL_SetError("Couldn't initialize pthread attributes");
   60.10      }
   60.11      pthread_attr_setdetachstate(&type, PTHREAD_CREATE_JOINABLE);
   60.12  
   60.13      /* Create the thread and go! */
   60.14      if (pthread_create(&thread->handle, &type, RunThread, args) != 0) {
   60.15 -        SDL_SetError("Not enough resources to create thread");
   60.16 -        return (-1);
   60.17 +        return SDL_SetError("Not enough resources to create thread");
   60.18      }
   60.19  
   60.20 -    return (0);
   60.21 +    return 0;
   60.22  }
   60.23  
   60.24  void
   60.25 @@ -173,8 +171,7 @@
   60.26          /* Note that this fails if you're trying to set high priority
   60.27             and you don't have root permission. BUT DON'T RUN AS ROOT!
   60.28           */
   60.29 -        SDL_SetError("setpriority() failed");
   60.30 -        return -1;
   60.31 +        return SDL_SetError("setpriority() failed");
   60.32      }
   60.33      return 0;
   60.34  #else
   60.35 @@ -183,8 +180,7 @@
   60.36      pthread_t thread = pthread_self();
   60.37  
   60.38      if (pthread_getschedparam(thread, &policy, &sched) < 0) {
   60.39 -        SDL_SetError("pthread_getschedparam() failed");
   60.40 -        return -1;
   60.41 +        return SDL_SetError("pthread_getschedparam() failed");
   60.42      }
   60.43      if (priority == SDL_THREAD_PRIORITY_LOW) {
   60.44          sched.sched_priority = sched_get_priority_min(policy);
   60.45 @@ -196,8 +192,7 @@
   60.46          sched.sched_priority = (min_priority + (max_priority - min_priority) / 2);
   60.47      }
   60.48      if (pthread_setschedparam(thread, policy, &sched) < 0) {
   60.49 -        SDL_SetError("pthread_setschedparam() failed");
   60.50 -        return -1;
   60.51 +        return SDL_SetError("pthread_setschedparam() failed");
   60.52      }
   60.53      return 0;
   60.54  #endif /* linux */
    61.1 --- a/src/thread/windows/SDL_sysmutex.c	Fri Mar 29 21:29:57 2013 -0400
    61.2 +++ b/src/thread/windows/SDL_sysmutex.c	Sun Mar 31 12:48:50 2013 -0400
    61.3 @@ -67,8 +67,7 @@
    61.4  SDL_LockMutex(SDL_mutex * mutex)
    61.5  {
    61.6      if (mutex == NULL) {
    61.7 -        SDL_SetError("Passed a NULL mutex");
    61.8 -        return -1;
    61.9 +        return SDL_SetError("Passed a NULL mutex");
   61.10      }
   61.11  
   61.12      EnterCriticalSection(&mutex->cs);
   61.13 @@ -81,8 +80,7 @@
   61.14  {
   61.15      int retval = 0;
   61.16      if (mutex == NULL) {
   61.17 -        SDL_SetError("Passed a NULL mutex");
   61.18 -        return -1;
   61.19 +        return SDL_SetError("Passed a NULL mutex");
   61.20      }
   61.21  
   61.22      if (TryEnterCriticalSection(&mutex->cs) == 0) {
   61.23 @@ -96,8 +94,7 @@
   61.24  SDL_UnlockMutex(SDL_mutex * mutex)
   61.25  {
   61.26      if (mutex == NULL) {
   61.27 -        SDL_SetError("Passed a NULL mutex");
   61.28 -        return -1;
   61.29 +        return SDL_SetError("Passed a NULL mutex");
   61.30      }
   61.31  
   61.32      LeaveCriticalSection(&mutex->cs);
    62.1 --- a/src/thread/windows/SDL_syssem.c	Fri Mar 29 21:29:57 2013 -0400
    62.2 +++ b/src/thread/windows/SDL_syssem.c	Sun Mar 31 12:48:50 2013 -0400
    62.3 @@ -78,8 +78,7 @@
    62.4      DWORD dwMilliseconds;
    62.5  
    62.6      if (!sem) {
    62.7 -        SDL_SetError("Passed a NULL sem");
    62.8 -        return -1;
    62.9 +        return SDL_SetError("Passed a NULL sem");
   62.10      }
   62.11  
   62.12      if (timeout == SDL_MUTEX_MAXWAIT) {
   62.13 @@ -96,8 +95,7 @@
   62.14          retval = SDL_MUTEX_TIMEDOUT;
   62.15          break;
   62.16      default:
   62.17 -        SDL_SetError("WaitForSingleObject() failed");
   62.18 -        retval = -1;
   62.19 +        retval = SDL_SetError("WaitForSingleObject() failed");
   62.20          break;
   62.21      }
   62.22      return retval;
   62.23 @@ -130,8 +128,7 @@
   62.24  SDL_SemPost(SDL_sem * sem)
   62.25  {
   62.26      if (!sem) {
   62.27 -        SDL_SetError("Passed a NULL sem");
   62.28 -        return -1;
   62.29 +        return SDL_SetError("Passed a NULL sem");
   62.30      }
   62.31      /* Increase the counter in the first place, because
   62.32       * after a successful release the semaphore may
   62.33 @@ -141,8 +138,7 @@
   62.34      InterlockedIncrement(&sem->count);
   62.35      if (ReleaseSemaphore(sem->id, 1, NULL) == FALSE) {
   62.36          InterlockedDecrement(&sem->count);      /* restore */
   62.37 -        SDL_SetError("ReleaseSemaphore() failed");
   62.38 -        return -1;
   62.39 +        return SDL_SetError("ReleaseSemaphore() failed");
   62.40      }
   62.41      return 0;
   62.42  }
    63.1 --- a/src/thread/windows/SDL_systhread.c	Fri Mar 29 21:29:57 2013 -0400
    63.2 +++ b/src/thread/windows/SDL_systhread.c	Sun Mar 31 12:48:50 2013 -0400
    63.3 @@ -116,8 +116,7 @@
    63.4      pThreadStartParms pThreadParms =
    63.5          (pThreadStartParms) SDL_malloc(sizeof(tThreadStartParms));
    63.6      if (!pThreadParms) {
    63.7 -        SDL_OutOfMemory();
    63.8 -        return (-1);
    63.9 +        return SDL_OutOfMemory();
   63.10      }
   63.11      // Save the function which we will have to call to clear the RTL of calling app!
   63.12      pThreadParms->pfnCurrentEndThread = pfnEndThread;
   63.13 @@ -135,10 +134,9 @@
   63.14                                        pThreadParms, 0, &threadid);
   63.15      }
   63.16      if (thread->handle == NULL) {
   63.17 -        SDL_SetError("Not enough resources to create thread");
   63.18 -        return (-1);
   63.19 +        return SDL_SetError("Not enough resources to create thread");
   63.20      }
   63.21 -    return (0);
   63.22 +    return 0;
   63.23  }
   63.24  
   63.25  #ifdef _MSC_VER
   63.26 @@ -198,8 +196,7 @@
   63.27          value = THREAD_PRIORITY_NORMAL;
   63.28      }
   63.29      if (!SetThreadPriority(GetCurrentThread(), value)) {
   63.30 -        WIN_SetError("SetThreadPriority()");
   63.31 -        return -1;
   63.32 +        return WIN_SetError("SetThreadPriority()");
   63.33      }
   63.34      return 0;
   63.35  }
    64.1 --- a/src/video/SDL_RLEaccel.c	Fri Mar 29 21:29:57 2013 -0400
    64.2 +++ b/src/video/SDL_RLEaccel.c	Sun Mar 31 12:48:50 2013 -0400
    64.3 @@ -1087,8 +1087,7 @@
    64.4      maxsize += sizeof(RLEDestFormat);
    64.5      rlebuf = (Uint8 *) SDL_malloc(maxsize);
    64.6      if (!rlebuf) {
    64.7 -        SDL_OutOfMemory();
    64.8 -        return -1;
    64.9 +        return SDL_OutOfMemory();
   64.10      }
   64.11      {
   64.12          /* save the destination format so we can undo the encoding later */
   64.13 @@ -1299,8 +1298,7 @@
   64.14  
   64.15      rlebuf = (Uint8 *) SDL_malloc(maxsize);
   64.16      if (rlebuf == NULL) {
   64.17 -        SDL_OutOfMemory();
   64.18 -        return (-1);
   64.19 +        return SDL_OutOfMemory();
   64.20      }
   64.21  
   64.22      /* Set up the conversion */
    65.1 --- a/src/video/SDL_blit.c	Fri Mar 29 21:29:57 2013 -0400
    65.2 +++ b/src/video/SDL_blit.c	Sun Mar 31 12:48:50 2013 -0400
    65.3 @@ -270,11 +270,10 @@
    65.4      /* Make sure we have a blit function */
    65.5      if (blit == NULL) {
    65.6          SDL_InvalidateMap(map);
    65.7 -        SDL_SetError("Blit combination not supported");
    65.8 -        return (-1);
    65.9 +        return SDL_SetError("Blit combination not supported");
   65.10      }
   65.11  
   65.12 -    return (0);
   65.13 +    return 0;
   65.14  }
   65.15  
   65.16  /* vi: set ts=4 sw=4 expandtab: */
    66.1 --- a/src/video/SDL_fillrect.c	Fri Mar 29 21:29:57 2013 -0400
    66.2 +++ b/src/video/SDL_fillrect.c	Sun Mar 31 12:48:50 2013 -0400
    66.3 @@ -315,14 +315,12 @@
    66.4      Uint8 *pixels;
    66.5  
    66.6      if (!dst) {
    66.7 -        SDL_SetError("Passed NULL destination surface");
    66.8 -        return -1;
    66.9 +        return SDL_SetError("Passed NULL destination surface");
   66.10      }
   66.11  
   66.12      /* This function doesn't work on surfaces < 8 bpp */
   66.13      if (dst->format->BitsPerPixel < 8) {
   66.14 -        SDL_SetError("SDL_FillRect(): Unsupported surface format");
   66.15 -        return -1;
   66.16 +        return SDL_SetError("SDL_FillRect(): Unsupported surface format");
   66.17      }
   66.18  
   66.19      /* If 'rect' == NULL, then fill the whole surface */
   66.20 @@ -338,8 +336,7 @@
   66.21  
   66.22      /* Perform software fill */
   66.23      if (!dst->pixels) {
   66.24 -        SDL_SetError("SDL_FillRect(): You must lock the surface");
   66.25 -        return (-1);
   66.26 +        return SDL_SetError("SDL_FillRect(): You must lock the surface");
   66.27      }
   66.28  
   66.29      pixels = (Uint8 *) dst->pixels + rect->y * dst->pitch +
   66.30 @@ -423,8 +420,7 @@
   66.31      int status = 0;
   66.32  
   66.33      if (!rects) {
   66.34 -        SDL_SetError("SDL_FillRects() passed NULL rects");
   66.35 -        return -1;
   66.36 +        return SDL_SetError("SDL_FillRects() passed NULL rects");
   66.37      }
   66.38  
   66.39      for (i = 0; i < count; ++i) {
    67.1 --- a/src/video/SDL_pixels.c	Fri Mar 29 21:29:57 2013 -0400
    67.2 +++ b/src/video/SDL_pixels.c	Sun Mar 31 12:48:50 2013 -0400
    67.3 @@ -638,13 +638,11 @@
    67.4  SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette)
    67.5  {
    67.6      if (!format) {
    67.7 -        SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format");
    67.8 -        return -1;
    67.9 +        return SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format");
   67.10      }
   67.11  
   67.12      if (palette && palette->ncolors != (1 << format->BitsPerPixel)) {
   67.13 -        SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format");
   67.14 -        return -1;
   67.15 +        return SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format");
   67.16      }
   67.17  
   67.18      if (format->palette == palette) {
    68.1 --- a/src/video/SDL_stretch.c	Fri Mar 29 21:29:57 2013 -0400
    68.2 +++ b/src/video/SDL_stretch.c	Sun Mar 31 12:48:50 2013 -0400
    68.3 @@ -102,14 +102,12 @@
    68.4          store = STORE_WORD;
    68.5          break;
    68.6      default:
    68.7 -        SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
    68.8 -        return (-1);
    68.9 +        return SDL_SetError("ASM stretch of %d bytes isn't supported\n", bpp);
   68.10      }
   68.11  #ifdef HAVE_MPROTECT
   68.12      /* Make the code writeable */
   68.13      if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_WRITE) < 0) {
   68.14 -        SDL_SetError("Couldn't make copy buffer writeable");
   68.15 -        return (-1);
   68.16 +        return SDL_SetError("Couldn't make copy buffer writeable");
   68.17      }
   68.18  #endif
   68.19      pos = 0x10000;
   68.20 @@ -141,8 +139,7 @@
   68.21  #ifdef HAVE_MPROTECT
   68.22      /* Make the code executable but not writeable */
   68.23      if (mprotect(copy_row, sizeof(copy_row), PROT_READ | PROT_EXEC) < 0) {
   68.24 -        SDL_SetError("Couldn't make copy buffer executable");
   68.25 -        return (-1);
   68.26 +        return SDL_SetError("Couldn't make copy buffer executable");
   68.27      }
   68.28  #endif
   68.29      last.status = 0;
   68.30 @@ -224,8 +221,7 @@
   68.31      const int bpp = dst->format->BytesPerPixel;
   68.32  
   68.33      if (src->format->BitsPerPixel != dst->format->BitsPerPixel) {
   68.34 -        SDL_SetError("Only works with same format surfaces");
   68.35 -        return (-1);
   68.36 +        return SDL_SetError("Only works with same format surfaces");
   68.37      }
   68.38  
   68.39      /* Verify the blit rectangles */
   68.40 @@ -233,8 +229,7 @@
   68.41          if ((srcrect->x < 0) || (srcrect->y < 0) ||
   68.42              ((srcrect->x + srcrect->w) > src->w) ||
   68.43              ((srcrect->y + srcrect->h) > src->h)) {
   68.44 -            SDL_SetError("Invalid source blit rectangle");
   68.45 -            return (-1);
   68.46 +            return SDL_SetError("Invalid source blit rectangle");
   68.47          }
   68.48      } else {
   68.49          full_src.x = 0;
   68.50 @@ -247,8 +242,7 @@
   68.51          if ((dstrect->x < 0) || (dstrect->y < 0) ||
   68.52              ((dstrect->x + dstrect->w) > dst->w) ||
   68.53              ((dstrect->y + dstrect->h) > dst->h)) {
   68.54 -            SDL_SetError("Invalid destination blit rectangle");
   68.55 -            return (-1);
   68.56 +            return SDL_SetError("Invalid destination blit rectangle");
   68.57          }
   68.58      } else {
   68.59          full_dst.x = 0;
   68.60 @@ -262,8 +256,7 @@
   68.61      dst_locked = 0;
   68.62      if (SDL_MUSTLOCK(dst)) {
   68.63          if (SDL_LockSurface(dst) < 0) {
   68.64 -            SDL_SetError("Unable to lock destination surface");
   68.65 -            return (-1);
   68.66 +            return SDL_SetError("Unable to lock destination surface");
   68.67          }
   68.68          dst_locked = 1;
   68.69      }
   68.70 @@ -274,8 +267,7 @@
   68.71              if (dst_locked) {
   68.72                  SDL_UnlockSurface(dst);
   68.73              }
   68.74 -            SDL_SetError("Unable to lock source surface");
   68.75 -            return (-1);
   68.76 +            return SDL_SetError("Unable to lock source surface");
   68.77          }
   68.78          src_locked = 1;
   68.79      }
    69.1 --- a/src/video/SDL_surface.c	Fri Mar 29 21:29:57 2013 -0400
    69.2 +++ b/src/video/SDL_surface.c	Sun Mar 31 12:48:50 2013 -0400
    69.3 @@ -143,8 +143,7 @@
    69.4  SDL_SetSurfacePalette(SDL_Surface * surface, SDL_Palette * palette)
    69.5  {
    69.6      if (!surface) {
    69.7 -        SDL_SetError("SDL_SetSurfacePalette() passed a NULL surface");
    69.8 -        return -1;
    69.9 +        return SDL_SetError("SDL_SetSurfacePalette() passed a NULL surface");
   69.10      }
   69.11      return SDL_SetPixelFormatPalette(surface->format, palette);
   69.12  }
   69.13 @@ -402,8 +401,7 @@
   69.14          surface->map->info.flags |= SDL_COPY_MOD;
   69.15          break;
   69.16      default:
   69.17 -        SDL_Unsupported();
   69.18 -        status = -1;
   69.19 +        status = SDL_Unsupported();
   69.20          break;
   69.21      }
   69.22  
   69.23 @@ -518,12 +516,10 @@
   69.24  
   69.25      /* Make sure the surfaces aren't locked */
   69.26      if (!src || !dst) {
   69.27 -        SDL_SetError("SDL_UpperBlit: passed a NULL surface");
   69.28 -        return (-1);
   69.29 +        return SDL_SetError("SDL_UpperBlit: passed a NULL surface");
   69.30      }
   69.31      if (src->locked || dst->locked) {
   69.32 -        SDL_SetError("Surfaces must not be locked during blit");
   69.33 -        return (-1);
   69.34 +        return SDL_SetError("Surfaces must not be locked during blit");
   69.35      }
   69.36  
   69.37      /* If the destination rectangle is NULL, use the entire dest surface */
   69.38 @@ -610,12 +606,10 @@
   69.39  
   69.40      /* Make sure the surfaces aren't locked */
   69.41      if (!src || !dst) {
   69.42 -        SDL_SetError("SDL_UpperBlitScaled: passed a NULL surface");
   69.43 -        return (-1);
   69.44 +        return SDL_SetError("SDL_UpperBlitScaled: passed a NULL surface");
   69.45      }
   69.46      if (src->locked || dst->locked) {
   69.47 -        SDL_SetError("Surfaces must not be locked during blit");
   69.48 -        return (-1);
   69.49 +        return SDL_SetError("Surfaces must not be locked during blit");
   69.50      }
   69.51  
   69.52      /* If the destination rectangle is NULL, use the entire dest surface */
   69.53 @@ -972,12 +966,10 @@
   69.54  
   69.55      /* Check to make sure we are bliting somewhere, so we don't crash */
   69.56      if (!dst) {
   69.57 -        SDL_InvalidParamError("dst");
   69.58 -        return -1;
   69.59 +        return SDL_InvalidParamError("dst");
   69.60      }
   69.61      if (!dst_pitch) {
   69.62 -        SDL_InvalidParamError("dst_pitch");
   69.63 -        return -1;
   69.64 +        return SDL_InvalidParamError("dst_pitch");
   69.65      }
   69.66  
   69.67      /* Fast path for same format copy */
   69.68 @@ -994,8 +986,7 @@
   69.69                  bpp = 2;
   69.70                  break;
   69.71              default:
   69.72 -                SDL_SetError("Unknown FOURCC pixel format");
   69.73 -                return -1;
   69.74 +                return SDL_SetError("Unknown FOURCC pixel format");
   69.75              }
   69.76          } else {
   69.77              bpp = SDL_BYTESPERPIXEL(src_format);
    70.1 --- a/src/video/SDL_video.c	Fri Mar 29 21:29:57 2013 -0400
    70.2 +++ b/src/video/SDL_video.c	Sun Mar 31 12:48:50 2013 -0400
    70.3 @@ -242,16 +242,14 @@
    70.4              }
    70.5          }
    70.6          if (!renderer) {
    70.7 -            SDL_SetError("No hardware accelerated renderers available");
    70.8 -            return -1;
    70.9 +            return SDL_SetError("No hardware accelerated renderers available");
   70.10          }
   70.11  
   70.12          /* Create the data after we successfully create the renderer (bug #1116) */
   70.13          data = (SDL_WindowTextureData *)SDL_calloc(1, sizeof(*data));
   70.14          if (!data) {
   70.15              SDL_DestroyRenderer(renderer);
   70.16 -            SDL_OutOfMemory();
   70.17 -            return -1;
   70.18 +            return SDL_OutOfMemory();
   70.19          }
   70.20          SDL_SetWindowData(window, SDL_WINDOWTEXTUREDATA, data);
   70.21  
   70.22 @@ -294,8 +292,7 @@
   70.23      data->pitch = (((window->w * data->bytes_per_pixel) + 3) & ~3);
   70.24      data->pixels = SDL_malloc(window->h * data->pitch);
   70.25      if (!data->pixels) {
   70.26 -        SDL_OutOfMemory();
   70.27 -        return -1;
   70.28 +        return SDL_OutOfMemory();
   70.29      }
   70.30  
   70.31      *pixels = data->pixels;
   70.32 @@ -316,8 +313,7 @@
   70.33  
   70.34      data = SDL_GetWindowData(window, SDL_WINDOWTEXTUREDATA);
   70.35      if (!data || !data->texture) {
   70.36 -        SDL_SetError("No window texture data");
   70.37 -        return -1;
   70.38 +        return SDL_SetError("No window texture data");
   70.39      }
   70.40  
   70.41      /* Update a single rect that contains subrects for best DMA performance */
   70.42 @@ -384,10 +380,10 @@
   70.43      return 0;
   70.44  }
   70.45  
   70.46 -static void
   70.47 +static int
   70.48  SDL_UninitializedVideo()
   70.49  {
   70.50 -    SDL_SetError("Video subsystem has not been initialized");
   70.51 +    return SDL_SetError("Video subsystem has not been initialized");
   70.52  }
   70.53  
   70.54  int
   70.55 @@ -454,11 +450,9 @@
   70.56      }
   70.57      if (video == NULL) {
   70.58          if (driver_name) {
   70.59 -            SDL_SetError("%s not available", driver_name);
   70.60 -        } else {
   70.61 -            SDL_SetError("No available video device");
   70.62 +            return SDL_SetError("%s not available", driver_name);
   70.63          }
   70.64 -        return -1;
   70.65 +        return SDL_SetError("No available video device");
   70.66      }
   70.67      _this = video;
   70.68      _this->name = bootstrap[i]->name;
   70.69 @@ -510,9 +504,8 @@
   70.70  
   70.71      /* Make sure some displays were added */
   70.72      if (_this->num_displays == 0) {
   70.73 -        SDL_SetError("The video driver did not add any displays");
   70.74          SDL_VideoQuit();
   70.75 -        return (-1);
   70.76 +        return SDL_SetError("The video driver did not add any displays");
   70.77      }
   70.78  
   70.79      /* Add the renderer framebuffer emulation if desired */
   70.80 @@ -721,9 +714,8 @@
   70.81  
   70.82      display = &_this->displays[displayIndex];
   70.83      if (index < 0 || index >= SDL_GetNumDisplayModesForDisplay(display)) {
   70.84 -        SDL_SetError("index must be in the range of 0 - %d",
   70.85 -                     SDL_GetNumDisplayModesForDisplay(display) - 1);
   70.86 -        return -1;
   70.87 +        return SDL_SetError("index must be in the range of 0 - %d",
   70.88 +                            SDL_GetNumDisplayModesForDisplay(display) - 1);
   70.89      }
   70.90      if (mode) {
   70.91          *mode = display->display_modes[index];
   70.92 @@ -904,9 +896,8 @@
   70.93  
   70.94          /* Get a good video mode, the closest one possible */
   70.95          if (!SDL_GetClosestDisplayModeForDisplay(display, &display_mode, &display_mode)) {
   70.96 -            SDL_SetError("No video mode large enough for %dx%d",
   70.97 -                         display_mode.w, display_mode.h);
   70.98 -            return -1;
   70.99 +            return SDL_SetError("No video mode large enough for %dx%d",
  70.100 +                                display_mode.w, display_mode.h);
  70.101          }
  70.102      } else {
  70.103          display_mode = display->desktop_mode;
  70.104 @@ -920,8 +911,7 @@
  70.105  
  70.106      /* Actually change the display mode */
  70.107      if (!_this->SetDisplayMode) {
  70.108 -        SDL_SetError("Video driver doesn't support changing display mode");
  70.109 -        return -1;
  70.110 +        return SDL_SetError("Video driver doesn't support changing display mode");
  70.111      }
  70.112      if (_this->SetDisplayMode(_this, display, &display_mode) < 0) {
  70.113          return -1;
  70.114 @@ -1021,8 +1011,7 @@
  70.115  	SDL_VideoDisplay *display;
  70.116  
  70.117      if (!mode) {
  70.118 -      SDL_InvalidParamError("mode");
  70.119 -      return -1;
  70.120 +      return SDL_InvalidParamError("mode");
  70.121      }
  70.122      
  70.123      CHECK_WINDOW_MAGIC(window, -1);
  70.124 @@ -1045,8 +1034,7 @@
  70.125  	else if (!SDL_GetClosestDisplayModeForDisplay(SDL_GetDisplayForWindow(window),
  70.126                                               &fullscreen_mode,
  70.127                                               &fullscreen_mode)) {
  70.128 -        SDL_SetError("Couldn't find display mode match");
  70.129 -        return -1;
  70.130 +        return SDL_SetError("Couldn't find display mode match");
  70.131      }
  70.132  
  70.133      if (mode) {
  70.134 @@ -1299,8 +1287,7 @@
  70.135      char *title = window->title;
  70.136  
  70.137      if ((flags & SDL_WINDOW_OPENGL) && !_this->GL_CreateContext) {
  70.138 -        SDL_SetError("No OpenGL support in video driver");
  70.139 -        return -1;
  70.140 +        return SDL_SetError("No OpenGL support in video driver");
  70.141      }
  70.142  
  70.143      if (window->flags & SDL_WINDOW_FOREIGN) {
  70.144 @@ -1847,8 +1834,7 @@
  70.145      CHECK_WINDOW_MAGIC(window, -1);
  70.146  
  70.147      if (!window->surface_valid) {
  70.148 -        SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface");
  70.149 -        return -1;
  70.150 +        return SDL_SetError("Window surface is invalid, please call SDL_GetWindowSurface() to get a new surface");
  70.151      }
  70.152  
  70.153      return _this->UpdateWindowFramebuffer(_this, window, rects, numrects);
  70.154 @@ -1886,8 +1872,7 @@
  70.155      CHECK_WINDOW_MAGIC(window, -1);
  70.156  
  70.157      if (!_this->SetWindowGammaRamp) {
  70.158 -        SDL_Unsupported();
  70.159 -        return -1;
  70.160 +        return SDL_Unsupported();
  70.161      }
  70.162  
  70.163      if (!window->gamma) {
  70.164 @@ -1924,8 +1909,7 @@
  70.165  
  70.166          window->gamma = (Uint16 *)SDL_malloc(256*6*sizeof(Uint16));
  70.167          if (!window->gamma) {
  70.168 -            SDL_OutOfMemory();
  70.169 -            return -1;
  70.170 +            return SDL_OutOfMemory();
  70.171          }
  70.172          window->saved_gamma = window->gamma + 3*256;
  70.173  
  70.174 @@ -2266,19 +2250,16 @@
  70.175      int retval;
  70.176  
  70.177      if (!_this) {
  70.178 -        SDL_UninitializedVideo();
  70.179 -        return -1;
  70.180 +        return SDL_UninitializedVideo();
  70.181      }
  70.182      if (_this->gl_config.driver_loaded) {
  70.183          if (path && SDL_strcmp(path, _this->gl_config.driver_path) != 0) {
  70.184 -            SDL_SetError("OpenGL library already loaded");
  70.185 -            return -1;
  70.186 +            return SDL_SetError("OpenGL library already loaded");
  70.187          }
  70.188          retval = 0;
  70.189      } else {
  70.190          if (!_this->GL_LoadLibrary) {
  70.191 -            SDL_SetError("No dynamic GL support in video driver");
  70.192 -            return -1;
  70.193 +            return  SDL_SetError("No dynamic GL support in video driver");
  70.194          }
  70.195          retval = _this->GL_LoadLibrary(_this, path);
  70.196      }
  70.197 @@ -2388,8 +2369,7 @@
  70.198      int retval;
  70.199  
  70.200      if (!_this) {
  70.201 -        SDL_UninitializedVideo();
  70.202 -        return -1;
  70.203 +        return SDL_UninitializedVideo();
  70.204      }
  70.205      retval = 0;
  70.206      switch (attr) {
  70.207 @@ -2458,8 +2438,7 @@
  70.208  		      SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG |
  70.209  		      SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG |
  70.210  		      SDL_GL_CONTEXT_RESET_ISOLATION_FLAG) ) {
  70.211 -	    SDL_SetError("Unknown OpenGL context flag %d", value);
  70.212 -	    retval = -1;
  70.213 +	    retval = SDL_SetError("Unknown OpenGL context flag %d", value);
  70.214  	    break;
  70.215  	}
  70.216          _this->gl_config.flags = value;
  70.217 @@ -2469,8 +2448,7 @@
  70.218  	    value != SDL_GL_CONTEXT_PROFILE_CORE &&
  70.219  	    value != SDL_GL_CONTEXT_PROFILE_COMPATIBILITY &&
  70.220  	    value != SDL_GL_CONTEXT_PROFILE_ES ) {
  70.221 -	    SDL_SetError("Unknown OpenGL context profile %d", value);
  70.222 -	    retval = -1;
  70.223 +	    retval = SDL_SetError("Unknown OpenGL context profile %d", value);
  70.224  	    break;
  70.225  	}
  70.226          _this->gl_config.profile_mask = value;
  70.227 @@ -2479,14 +2457,12 @@
  70.228          _this->gl_config.share_with_current_context = value;
  70.229  	break;
  70.230      default:
  70.231 -        SDL_SetError("Unknown OpenGL attribute");
  70.232 -        retval = -1;
  70.233 +        retval = SDL_SetError("Unknown OpenGL attribute");
  70.234          break;
  70.235      }
  70.236      return retval;
  70.237  #else
  70.238 -    SDL_Unsupported();
  70.239 -    return -1;
  70.240 +    return SDL_Unsupported();
  70.241  #endif /* SDL_VIDEO_OPENGL */
  70.242  }
  70.243  
  70.244 @@ -2645,36 +2621,22 @@
  70.245              return 0;
  70.246          }
  70.247      default:
  70.248 -        SDL_SetError("Unknown OpenGL attribute");
  70.249 -        return -1;
  70.250 +        return SDL_SetError("Unknown OpenGL attribute");
  70.251      }
  70.252  
  70.253      glGetIntegervFunc(attrib, (GLint *) value);
  70.254      error = glGetErrorFunc();
  70.255      if (error != GL_NO_ERROR) {
  70.256 -        switch (error) {
  70.257 -        case GL_INVALID_ENUM:
  70.258 -            {
  70.259 -                SDL_SetError("OpenGL error: GL_INVALID_ENUM");
  70.260 -            }
  70.261 -            break;
  70.262 -        case GL_INVALID_VALUE:
  70.263 -            {
  70.264 -                SDL_SetError("OpenGL error: GL_INVALID_VALUE");
  70.265 -            }
  70.266 -            break;
  70.267 -        default:
  70.268 -            {
  70.269 -                SDL_SetError("OpenGL error: %08X", error);
  70.270 -            }
  70.271 -            break;
  70.272 +        if (error == GL_INVALID_ENUM) {
  70.273 +            return SDL_SetError("OpenGL error: GL_INVALID_ENUM");
  70.274 +        } else if (error == GL_INVALID_VALUE) {
  70.275 +            return SDL_SetError("OpenGL error: GL_INVALID_VALUE");
  70.276          }
  70.277 -        return -1;
  70.278 +        return SDL_SetError("OpenGL error: %08X", error);
  70.279      }
  70.280      return 0;
  70.281  #else
  70.282 -    SDL_Unsupported();
  70.283 -    return -1;
  70.284 +    return SDL_Unsupported();
  70.285  #endif /* SDL_VIDEO_OPENGL */
  70.286  }
  70.287  
  70.288 @@ -2706,8 +2668,7 @@
  70.289      CHECK_WINDOW_MAGIC(window, -1);
  70.290  
  70.291      if (!(window->flags & SDL_WINDOW_OPENGL)) {
  70.292 -        SDL_SetError("The specified window isn't an OpenGL window");
  70.293 -        return -1;
  70.294 +        return SDL_SetError("The specified window isn't an OpenGL window");
  70.295      }
  70.296      if (!ctx) {
  70.297          window = NULL;
  70.298 @@ -2730,16 +2691,13 @@
  70.299  SDL_GL_SetSwapInterval(int interval)
  70.300  {
  70.301      if (!_this) {
  70.302 -        SDL_UninitializedVideo();
  70.303 -        return -1;
  70.304 +        return SDL_UninitializedVideo();
  70.305      } else if (_this->current_glctx == NULL) {
  70.306 -        SDL_SetError("No OpenGL context has been made current");
  70.307 -        return -1;
  70.308 +        return SDL_SetError("No OpenGL context has been made current");
  70.309      } else if (_this->GL_SetSwapInterval) {
  70.310          return _this->GL_SetSwapInterval(_this, interval);
  70.311      } else {
  70.312 -        SDL_SetError("Setting the swap interval is not supported");
  70.313 -        return -1;
  70.314 +        return SDL_SetError("Setting the swap interval is not supported");
  70.315      }
  70.316  }
  70.317  
  70.318 @@ -3025,8 +2983,7 @@
  70.319  	SDL_ShowCursor( show_cursor_prev );
  70.320  	SDL_SetRelativeMouseMode( relative_mode );
  70.321  
  70.322 -	if(retval == -1)
  70.323 -	{
  70.324 +	if(retval == -1) {
  70.325  		SDL_SetError("No message system available");
  70.326  	}
  70.327      return retval;
    71.1 --- a/src/video/android/SDL_androidgl.c	Fri Mar 29 21:29:57 2013 -0400
    71.2 +++ b/src/video/android/SDL_androidgl.c	Sun Mar 31 12:48:50 2013 -0400
    71.3 @@ -42,8 +42,7 @@
    71.4      if (!Android_GLHandle) {
    71.5          Android_GLHandle = dlopen("libGLESv1_CM.so",RTLD_GLOBAL);
    71.6          if (!Android_GLHandle) {
    71.7 -            SDL_SetError("Could not initialize GL ES library\n");
    71.8 -            return -1;
    71.9 +            return SDL_SetError("Could not initialize GL ES library\n");
   71.10          }
   71.11      }
   71.12      return 0;
    72.1 --- a/src/video/android/SDL_androidwindow.c	Fri Mar 29 21:29:57 2013 -0400
    72.2 +++ b/src/video/android/SDL_androidwindow.c	Sun Mar 31 12:48:50 2013 -0400
    72.3 @@ -31,8 +31,7 @@
    72.4  Android_CreateWindow(_THIS, SDL_Window * window)
    72.5  {
    72.6      if (Android_Window) {
    72.7 -        SDL_SetError("Android only supports one window");
    72.8 -        return -1;
    72.9 +        return SDL_SetError("Android only supports one window");
   72.10      }
   72.11      Android_Window = window;
   72.12      Android_PauseSem = SDL_CreateSemaphore(0);
    73.1 --- a/src/video/bwindow/SDL_bframebuffer.cc	Fri Mar 29 21:29:57 2013 -0400
    73.2 +++ b/src/video/bwindow/SDL_bframebuffer.cc	Sun Mar 31 12:48:50 2013 -0400
    73.3 @@ -76,8 +76,7 @@
    73.4  			true);	/* Contiguous memory required */
    73.5  			
    73.6  	if(bitmap->InitCheck() != B_OK) {
    73.7 -		SDL_SetError("Could not initialize back buffer!\n");
    73.8 -		return -1;
    73.9 +		return SDL_SetError("Could not initialize back buffer!\n");
   73.10  	}
   73.11  
   73.12  
    74.1 --- a/src/video/bwindow/SDL_bmodes.cc	Fri Mar 29 21:29:57 2013 -0400
    74.2 +++ b/src/video/bwindow/SDL_bmodes.cc	Sun Mar 31 12:48:50 2013 -0400
    74.3 @@ -310,8 +310,7 @@
    74.4  	}
    74.5  
    74.6  	if(bscreen.SetMode(bmode) != B_OK) {
    74.7 -		SDL_SetError("Bad video mode\n");
    74.8 -		return -1;
    74.9 +		return SDL_SetError("Bad video mode\n");
   74.10  	}
   74.11  	
   74.12  	free(bmode_list);
    75.1 --- a/src/video/cocoa/SDL_cocoamodes.m	Fri Mar 29 21:29:57 2013 -0400
    75.2 +++ b/src/video/cocoa/SDL_cocoamodes.m	Sun Mar 31 12:48:50 2013 -0400
    75.3 @@ -84,7 +84,7 @@
    75.4  #endif
    75.5  }
    75.6  
    75.7 -static void
    75.8 +static int
    75.9  CG_SetError(const char *prefix, CGDisplayErr result)
   75.10  {
   75.11      const char *error;
   75.12 @@ -124,7 +124,7 @@
   75.13          error = "Unknown Error";
   75.14          break;
   75.15      }
   75.16 -    SDL_SetError("%s: %s", prefix, error);
   75.17 +    return SDL_SetError("%s: %s", prefix, error);
   75.18  }
   75.19  
   75.20  static SDL_bool
    76.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Fri Mar 29 21:29:57 2013 -0400
    76.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Sun Mar 31 12:48:50 2013 -0400
    76.3 @@ -190,8 +190,7 @@
    76.4          result = CGAssociateMouseAndMouseCursorPosition(YES);
    76.5      }
    76.6      if (result != kCGErrorSuccess) {
    76.7 -        SDL_SetError("CGAssociateMouseAndMouseCursorPosition() failed");
    76.8 -        return -1;
    76.9 +        return SDL_SetError("CGAssociateMouseAndMouseCursorPosition() failed");
   76.10      }
   76.11      return 0;
   76.12  }
    77.1 --- a/src/video/cocoa/SDL_cocoaopengl.m	Fri Mar 29 21:29:57 2013 -0400
    77.2 +++ b/src/video/cocoa/SDL_cocoaopengl.m	Sun Mar 31 12:48:50 2013 -0400
    77.3 @@ -274,8 +274,7 @@
    77.4          [nscontext setValues:&value forParameter:NSOpenGLCPSwapInterval];
    77.5          status = 0;
    77.6      } else {
    77.7 -        SDL_SetError("No current OpenGL context");
    77.8 -        status = -1;
    77.9 +        status = SDL_SetError("No current OpenGL context");
   77.10      }
   77.11  
   77.12      [pool release];
    78.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Fri Mar 29 21:29:57 2013 -0400
    78.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sun Mar 31 12:48:50 2013 -0400
    78.3 @@ -501,8 +501,7 @@
    78.4      /* Allocate the window data */
    78.5      data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
    78.6      if (!data) {
    78.7 -        SDL_OutOfMemory();
    78.8 -        return -1;
    78.9 +        return SDL_OutOfMemory();
   78.10      }
   78.11      data->window = window;
   78.12      data->nswindow = nswindow;
   78.13 @@ -954,8 +953,7 @@
   78.14  
   78.15      if (CGSetDisplayTransferByTable(display_id, tableSize,
   78.16                                      redTable, greenTable, blueTable) != CGDisplayNoErr) {
   78.17 -        SDL_SetError("CGSetDisplayTransferByTable()");
   78.18 -        return -1;
   78.19 +        return SDL_SetError("CGSetDisplayTransferByTable()");
   78.20      }
   78.21      return 0;
   78.22  }
   78.23 @@ -973,8 +971,7 @@
   78.24  
   78.25      if (CGGetDisplayTransferByTable(display_id, tableSize,
   78.26                                      redTable, greenTable, blueTable, &tableCopied) != CGDisplayNoErr) {
   78.27 -        SDL_SetError("CGGetDisplayTransferByTable()");
   78.28 -        return -1;
   78.29 +        return SDL_SetError("CGGetDisplayTransferByTable()");
   78.30      }
   78.31  
   78.32      for (i = 0; i < tableCopied; i++) {
    79.1 --- a/src/video/directfb/SDL_DirectFB_opengl.c	Fri Mar 29 21:29:57 2013 -0400
    79.2 +++ b/src/video/directfb/SDL_DirectFB_opengl.c	Sun Mar 31 12:48:50 2013 -0400
    79.3 @@ -72,8 +72,7 @@
    79.4                                                 sizeof(struct
    79.5                                                        SDL_GLDriverData));
    79.6      if (!_this->gl_data) {
    79.7 -        SDL_OutOfMemory();
    79.8 -        return -1;
    79.9 +        return SDL_OutOfMemory();
   79.10      }
   79.11      _this->gl_data->initialized = 0;
   79.12  
   79.13 @@ -115,8 +114,7 @@
   79.14      SDL_DFB_DEBUG("Loadlibrary : %s\n", path);
   79.15  
   79.16      if (_this->gl_data->gl_active) {
   79.17 -        SDL_SetError("OpenGL context already created");
   79.18 -        return -1;
   79.19 +        return SDL_SetError("OpenGL context already created");
   79.20      }
   79.21  
   79.22  
   79.23 @@ -243,8 +241,7 @@
   79.24  int
   79.25  DirectFB_GL_SetSwapInterval(_THIS, int interval)
   79.26  {
   79.27 -    SDL_Unsupported();
   79.28 -    return -1;
   79.29 +    return SDL_Unsupported();
   79.30  }
   79.31  
   79.32  int
    80.1 --- a/src/video/directfb/SDL_DirectFB_render.c	Fri Mar 29 21:29:57 2013 -0400
    80.2 +++ b/src/video/directfb/SDL_DirectFB_render.c	Sun Mar 31 12:48:50 2013 -0400
    80.3 @@ -657,8 +657,7 @@
    80.4                           palette->SetEntries(data->palette, entries, ncolors, firstcolor));
    80.5          return 0;
    80.6      } else {
    80.7 -        SDL_SetError("YUV textures don't have a palette");
    80.8 -        return -1;
    80.9 +        return SDL_SetError("YUV textures don't have a palette");
   80.10      }
   80.11    error:
   80.12      return -1;
   80.13 @@ -688,8 +687,7 @@
   80.14          }
   80.15          return 0;
   80.16      } else {
   80.17 -        SDL_SetError("YUV textures don't have a palette");
   80.18 -        return -1;
   80.19 +        return SDL_SetError("YUV textures don't have a palette");
   80.20      }
   80.21    error:
   80.22      return -1;
   80.23 @@ -718,9 +716,8 @@
   80.24      case SDL_BLENDMODE_MOD:
   80.25          return 0;
   80.26      default:
   80.27 -        SDL_Unsupported();
   80.28          texture->blendMode = SDL_BLENDMODE_NONE;
   80.29 -        return -1;
   80.30 +        return SDL_Unsupported();
   80.31      }
   80.32  }
   80.33  
   80.34 @@ -735,9 +732,8 @@
   80.35      case SDL_BLENDMODE_MOD:
   80.36          return 0;
   80.37      default:
   80.38 -        SDL_Unsupported();
   80.39          renderer->blendMode = SDL_BLENDMODE_NONE;
   80.40 -        return -1;
   80.41 +        return SDL_Unsupported();
   80.42      }
   80.43  }
   80.44  
   80.45 @@ -762,10 +758,9 @@
   80.46              DSRO_SMOOTH_UPSCALE | DSRO_SMOOTH_DOWNSCALE | DSRO_ANTIALIAS;
   80.47          break;
   80.48      default:
   80.49 -        SDL_Unsupported();
   80.50          data->render_options = DSRO_NONE;
   80.51          texture->scaleMode = SDL_SCALEMODE_NONE;
   80.52 -        return -1;
   80.53 +        return SDL_Unsupported();
   80.54      }
   80.55  #endif
   80.56      return 0;
    81.1 --- a/src/video/directfb/SDL_DirectFB_window.c	Fri Mar 29 21:29:57 2013 -0400
    81.2 +++ b/src/video/directfb/SDL_DirectFB_window.c	Sun Mar 31 12:48:50 2013 -0400
    81.3 @@ -176,8 +176,7 @@
    81.4  int
    81.5  DirectFB_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
    81.6  {
    81.7 -    SDL_Unsupported();
    81.8 -    return -1;
    81.9 +    return SDL_Unsupported();
   81.10  }
   81.11  
   81.12  void
   81.13 @@ -188,8 +187,9 @@
   81.14      if (windata->is_managed) {
   81.15          windata->wm_needs_redraw = 1;
   81.16          DirectFB_WM_RedrawLayout(_this, window);
   81.17 -    } else
   81.18 +    } else {
   81.19          SDL_Unsupported();
   81.20 +    }
   81.21  }
   81.22  
   81.23  void
    82.1 --- a/src/video/dummy/SDL_nullframebuffer.c	Fri Mar 29 21:29:57 2013 -0400
    82.2 +++ b/src/video/dummy/SDL_nullframebuffer.c	Sun Mar 31 12:48:50 2013 -0400
    82.3 @@ -65,8 +65,7 @@
    82.4  
    82.5      surface = (SDL_Surface *) SDL_GetWindowData(window, DUMMY_SURFACE);
    82.6      if (!surface) {
    82.7 -        SDL_SetError("Couldn't find dummy surface for window");
    82.8 -        return -1;
    82.9 +        return SDL_SetError("Couldn't find dummy surface for window");
   82.10      }
   82.11  
   82.12      /* Send the data to the display */
    83.1 --- a/src/video/pandora/SDL_pandora.c	Fri Mar 29 21:29:57 2013 -0400
    83.2 +++ b/src/video/pandora/SDL_pandora.c	Sun Mar 31 12:48:50 2013 -0400
    83.3 @@ -211,8 +211,7 @@
    83.4      /* Allocate window internal data */
    83.5      wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
    83.6      if (wdata == NULL) {
    83.7 -        SDL_OutOfMemory();
    83.8 -        return -1;
    83.9 +        return SDL_OutOfMemory();
   83.10      }
   83.11  
   83.12      /* Setup driver data for this window */
   83.13 @@ -230,14 +229,12 @@
   83.14          if (phdata->egl_display == EGL_NO_DISPLAY) {
   83.15              phdata->egl_display = eglGetDisplay((NativeDisplayType) 0);
   83.16              if (phdata->egl_display == EGL_NO_DISPLAY) {
   83.17 -                SDL_SetError("PND: Can't get connection to OpenGL ES");
   83.18 -                return -1;
   83.19 +                return SDL_SetError("PND: Can't get connection to OpenGL ES");
   83.20              }
   83.21  
   83.22              initstatus = eglInitialize(phdata->egl_display, NULL, NULL);
   83.23              if (initstatus != EGL_TRUE) {
   83.24 -                SDL_SetError("PND: Can't init OpenGL ES library");
   83.25 -                return -1;
   83.26 +                return SDL_SetError("PND: Can't init OpenGL ES library");
   83.27              }
   83.28          }
   83.29  
   83.30 @@ -356,8 +353,7 @@
   83.31      _this->gl_config.dll_handle = SDL_LoadObject(path);
   83.32      if (!_this->gl_config.dll_handle) {
   83.33          /* Failed to load new GL ES library */
   83.34 -        SDL_SetError("PND: Failed to locate OpenGL ES library");
   83.35 -        return -1;
   83.36 +        return SDL_SetError("PND: Failed to locate OpenGL ES library");
   83.37      }
   83.38  
   83.39      /* Store OpenGL ES library path and name */
   83.40 @@ -726,8 +722,7 @@
   83.41      EGLBoolean status;
   83.42  
   83.43      if (phdata->egl_initialized != SDL_TRUE) {
   83.44 -        SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
   83.45 -        return -1;
   83.46 +        return SDL_SetError("PND: GF initialization failed, no OpenGL ES support");
   83.47      }
   83.48  
   83.49      if ((window == NULL) && (context == NULL)) {
   83.50 @@ -736,33 +731,28 @@
   83.51                             EGL_NO_SURFACE, EGL_NO_CONTEXT);
   83.52          if (status != EGL_TRUE) {
   83.53              /* Failed to set current GL ES context */
   83.54 -            SDL_SetError("PND: Can't set OpenGL ES context");
   83.55 -            return -1;
   83.56 +            return SDL_SetError("PND: Can't set OpenGL ES context");
   83.57          }
   83.58      } else {
   83.59          wdata = (SDL_WindowData *) window->driverdata;
   83.60          if (wdata->gles_surface == EGL_NO_SURFACE) {
   83.61 -            SDL_SetError
   83.62 +            return SDL_SetError
   83.63                  ("PND: OpenGL ES surface is not initialized for this window");
   83.64 -            return -1;
   83.65          }
   83.66          if (wdata->gles_context == EGL_NO_CONTEXT) {
   83.67 -            SDL_SetError
   83.68 +            return SDL_SetError
   83.69                  ("PND: OpenGL ES context is not initialized for this window");
   83.70 -            return -1;
   83.71          }
   83.72          if (wdata->gles_context != context) {
   83.73 -            SDL_SetError
   83.74 +            return SDL_SetError
   83.75                  ("PND: OpenGL ES context is not belong to this window");
   83.76 -            return -1;
   83.77          }
   83.78          status =
   83.79              eglMakeCurrent(phdata->egl_display, wdata->gles_surface,
   83.80                             wdata->gles_surface, wdata->gles_context);
   83.81          if (status != EGL_TRUE) {
   83.82              /* Failed to set current GL ES context */
   83.83 -            SDL_SetError("PND: Can't set OpenGL ES context");
   83.84 -            return -1;
   83.85 +            return SDL_SetError("PND: Can't set OpenGL ES context");
   83.86          }
   83.87      }
   83.88      return 0;
   83.89 @@ -775,8 +765,7 @@
   83.90      EGLBoolean status;
   83.91  
   83.92      if (phdata->egl_initialized != SDL_TRUE) {
   83.93 -        SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
   83.94 -        return -1;
   83.95 +        return SDL_SetError("PND: EGL initialization failed, no OpenGL ES support");
   83.96      }
   83.97  
   83.98      /* Check if OpenGL ES connection has been initialized */
   83.99 @@ -791,8 +780,7 @@
  83.100      }
  83.101  
  83.102      /* Failed to set swap interval */
  83.103 -    SDL_SetError("PND: Cannot set swap interval");
  83.104 -    return -1;
  83.105 +    return SDL_SetError("PND: Cannot set swap interval");
  83.106  }
  83.107  
  83.108  int
    84.1 --- a/src/video/psp/SDL_pspgl.c	Fri Mar 29 21:29:57 2013 -0400
    84.2 +++ b/src/video/psp/SDL_pspgl.c	Sun Mar 31 12:48:50 2013 -0400
    84.3 @@ -146,8 +146,7 @@
    84.4  		if (!eglMakeCurrent(_this->gl_data->display, _this->gl_data->surface,
    84.5  	                      _this->gl_data->surface, _this->gl_data->context))
    84.6  		{
    84.7 -			SDL_SetError("Unable to make EGL context current");
    84.8 -			return -1;
    84.9 +			return SDL_SetError("Unable to make EGL context current");
   84.10  		}
   84.11      return 0;
   84.12  }
   84.13 @@ -163,8 +162,7 @@
   84.14          return 0;
   84.15      }
   84.16      /* Failed to set swap interval */
   84.17 -    SDL_SetError("Unable to set the EGL swap interval");
   84.18 -    return -1;
   84.19 +    return SDL_SetError("Unable to set the EGL swap interval");
   84.20  }
   84.21  
   84.22  int
    85.1 --- a/src/video/psp/SDL_pspvideo.c	Fri Mar 29 21:29:57 2013 -0400
    85.2 +++ b/src/video/psp/SDL_pspvideo.c	Sun Mar 31 12:48:50 2013 -0400
    85.3 @@ -223,8 +223,7 @@
    85.4      /* Allocate window internal data */
    85.5      wdata = (SDL_WindowData *) SDL_calloc(1, sizeof(SDL_WindowData));
    85.6      if (wdata == NULL) {
    85.7 -        SDL_OutOfMemory();
    85.8 -        return -1;
    85.9 +        return SDL_OutOfMemory();
   85.10      }
   85.11  
   85.12      /* Setup driver data for this window */
    86.1 --- a/src/video/uikit/SDL_uikitmodes.m	Fri Mar 29 21:29:57 2013 -0400
    86.2 +++ b/src/video/uikit/SDL_uikitmodes.m	Sun Mar 31 12:48:50 2013 -0400
    86.3 @@ -39,8 +39,7 @@
    86.4          /* Allocate the display mode data */
    86.5          data = (SDL_DisplayModeData *) SDL_malloc(sizeof(*data));
    86.6          if (!data) {
    86.7 -            SDL_OutOfMemory();
    86.8 -            return -1;
    86.9 +            return SDL_OutOfMemory();
   86.10          }
   86.11          
   86.12          data->uiscreenmode = uiscreenmode;
   86.13 @@ -160,9 +159,8 @@
   86.14      /* Allocate the display data */
   86.15      SDL_DisplayData *data = (SDL_DisplayData *) SDL_malloc(sizeof(*data));
   86.16      if (!data) {
   86.17 -        SDL_OutOfMemory();
   86.18          UIKit_FreeDisplayModeData(&display.desktop_mode);
   86.19 -        return -1;
   86.20 +        return SDL_OutOfMemory();
   86.21      }
   86.22  	
   86.23      [uiscreen retain];
    87.1 --- a/src/video/uikit/SDL_uikitopengles.m	Fri Mar 29 21:29:57 2013 -0400
    87.2 +++ b/src/video/uikit/SDL_uikitopengles.m	Sun Mar 31 12:48:50 2013 -0400
    87.3 @@ -72,8 +72,7 @@
    87.4          and because the SDK forbids loading an external SO
    87.5      */
    87.6      if (path != NULL) {
    87.7 -        SDL_SetError("iPhone GL Load Library just here for compatibility");
    87.8 -        return -1;
    87.9 +        return SDL_SetError("iPhone GL Load Library just here for compatibility");
   87.10      }
   87.11      return 0;
   87.12  }
    88.1 --- a/src/video/uikit/SDL_uikitvideo.m	Fri Mar 29 21:29:57 2013 -0400
    88.2 +++ b/src/video/uikit/SDL_uikitvideo.m	Sun Mar 31 12:48:50 2013 -0400
    88.3 @@ -63,10 +63,10 @@
    88.4      /* Initialize all variables that we clean on shutdown */
    88.5      device = (SDL_VideoDevice *) SDL_calloc(1, sizeof(SDL_VideoDevice));
    88.6      if (!device) {
    88.7 -        SDL_OutOfMemory();
    88.8          if (device) {
    88.9              SDL_free(device);
   88.10          }
   88.11 +        SDL_OutOfMemory();
   88.12          return (0);
   88.13      }
   88.14  
    89.1 --- a/src/video/uikit/SDL_uikitwindow.m	Fri Mar 29 21:29:57 2013 -0400
    89.2 +++ b/src/video/uikit/SDL_uikitwindow.m	Sun Mar 31 12:48:50 2013 -0400
    89.3 @@ -54,8 +54,7 @@
    89.4      /* Allocate the window data */
    89.5      data = (SDL_WindowData *)SDL_malloc(sizeof(*data));
    89.6      if (!data) {
    89.7 -        SDL_OutOfMemory();
    89.8 -        return -1;
    89.9 +        return SDL_OutOfMemory();
   89.10      }
   89.11      data->uiwindow = uiwindow;
   89.12      data->viewcontroller = nil;
   89.13 @@ -133,8 +132,7 @@
   89.14  
   89.15      /* We currently only handle a single window per display on iOS */
   89.16      if (window->next != NULL) {
   89.17 -        SDL_SetError("Only one window allowed per display.");
   89.18 -        return -1;
   89.19 +        return SDL_SetError("Only one window allowed per display.");
   89.20      }
   89.21  
   89.22      // If monitor has a resolution of 0x0 (hasn't been explicitly set by the
   89.23 @@ -315,8 +313,7 @@
   89.24      SDL_WindowData *data = window ? (SDL_WindowData *)window->driverdata : NULL;
   89.25  
   89.26      if (!data || !data->view) {
   89.27 -        SDL_SetError("Invalid window or view not set");
   89.28 -        return -1;
   89.29 +        return SDL_SetError("Invalid window or view not set");
   89.30      }
   89.31  
   89.32      [data->view setAnimationCallback:interval callback:callback callbackParam:callbackParam];
    90.1 --- a/src/video/windows/SDL_windowsclipboard.c	Fri Mar 29 21:29:57 2013 -0400
    90.2 +++ b/src/video/windows/SDL_windowsclipboard.c	Sun Mar 31 12:48:50 2013 -0400
    90.3 @@ -89,8 +89,7 @@
    90.4  
    90.5              EmptyClipboard();
    90.6              if (!SetClipboardData(TEXT_FORMAT, hMem)) {
    90.7 -                WIN_SetError("Couldn't set clipboard data");
    90.8 -                result = -1;
    90.9 +                result = WIN_SetError("Couldn't set clipboard data");
   90.10              }
   90.11              data->clipboard_count = GetClipboardSequenceNumber();
   90.12          }
   90.13 @@ -98,8 +97,7 @@
   90.14  
   90.15          CloseClipboard();
   90.16      } else {
   90.17 -        WIN_SetError("Couldn't open clipboard");
   90.18 -        result = -1;
   90.19 +        result = WIN_SetError("Couldn't open clipboard");
   90.20      }
   90.21      return result;
   90.22  }
    91.1 --- a/src/video/windows/SDL_windowsevents.c	Fri Mar 29 21:29:57 2013 -0400
    91.2 +++ b/src/video/windows/SDL_windowsevents.c	Sun Mar 31 12:48:50 2013 -0400
    91.3 @@ -809,12 +809,11 @@
    91.4      class.cbWndExtra = 0;
    91.5      class.cbClsExtra = 0;
    91.6      if (!RegisterClass(&class)) {
    91.7 -        SDL_SetError("Couldn't register application class");
    91.8 -        return (-1);
    91.9 +        return SDL_SetError("Couldn't register application class");
   91.10      }
   91.11  
   91.12      app_registered = 1;
   91.13 -    return (0);
   91.14 +    return 0;
   91.15  }
   91.16  
   91.17  /* Unregisters the windowclass registered in SDL_RegisterApp above. */
    92.1 --- a/src/video/windows/SDL_windowsframebuffer.c	Fri Mar 29 21:29:57 2013 -0400
    92.2 +++ b/src/video/windows/SDL_windowsframebuffer.c	Sun Mar 31 12:48:50 2013 -0400
    92.3 @@ -85,8 +85,7 @@
    92.4      SDL_stack_free(info);
    92.5  
    92.6      if (!data->hbm) {
    92.7 -        WIN_SetError("Unable to create DIB");
    92.8 -        return -1;
    92.9 +        return WIN_SetError("Unable to create DIB");
   92.10      }
   92.11      SelectObject(data->mdc, data->hbm);
   92.12  
    93.1 --- a/src/video/windows/SDL_windowsmodes.c	Fri Mar 29 21:29:57 2013 -0400
    93.2 +++ b/src/video/windows/SDL_windowsmodes.c	Sun Mar 31 12:48:50 2013 -0400
    93.3 @@ -214,8 +214,7 @@
    93.4          }
    93.5      }
    93.6      if (_this->num_displays == 0) {
    93.7 -        SDL_SetError("No displays available");
    93.8 -        return -1;
    93.9 +        return SDL_SetError("No displays available");
   93.10      }
   93.11      return 0;
   93.12  }
   93.13 @@ -282,8 +281,7 @@
   93.14              reason = "DISP_CHANGE_FAILED";
   93.15              break;
   93.16          }
   93.17 -        SDL_SetError("ChangeDisplaySettingsEx() failed: %s", reason);
   93.18 -        return -1;
   93.19 +        return SDL_SetError("ChangeDisplaySettingsEx() failed: %s", reason);
   93.20      }
   93.21      EnumDisplaySettings(displaydata->DeviceName, ENUM_CURRENT_SETTINGS, &data->DeviceMode);
   93.22      return 0;
    94.1 --- a/src/video/windows/SDL_windowsmouse.c	Fri Mar 29 21:29:57 2013 -0400
    94.2 +++ b/src/video/windows/SDL_windowsmouse.c	Sun Mar 31 12:48:50 2013 -0400
    94.3 @@ -196,8 +196,7 @@
    94.4  		/* Only return an error when registering. If we unregister and fail, then
    94.5  		it's probably that we unregistered twice. That's OK. */
    94.6  		if(enabled) {
    94.7 -			SDL_Unsupported();
    94.8 -			return -1;
    94.9 +			return SDL_Unsupported();
   94.10  		}
   94.11  	}
   94.12  
    95.1 --- a/src/video/windows/SDL_windowsopengl.c	Fri Mar 29 21:29:57 2013 -0400
    95.2 +++ b/src/video/windows/SDL_windowsopengl.c	Sun Mar 31 12:48:50 2013 -0400
    95.3 @@ -91,8 +91,7 @@
    95.4          char message[1024];
    95.5          SDL_snprintf(message, SDL_arraysize(message), "LoadLibrary(\"%s\")",
    95.6                       path);
    95.7 -        WIN_SetError(message);
    95.8 -        return -1;
    95.9 +        return WIN_SetError(message);
   95.10      }
   95.11      SDL_strlcpy(_this->gl_config.driver_path, path,
   95.12                  SDL_arraysize(_this->gl_config.driver_path));
   95.13 @@ -103,8 +102,7 @@
   95.14                                                 sizeof(struct
   95.15                                                        SDL_GLDriverData));
   95.16      if (!_this->gl_data) {
   95.17 -        SDL_OutOfMemory();
   95.18 -        return -1;
   95.19 +        return SDL_OutOfMemory();
   95.20      }
   95.21  
   95.22      /* Load function pointers */
   95.23 @@ -124,9 +122,8 @@
   95.24          !_this->gl_data->wglCreateContext ||
   95.25          !_this->gl_data->wglDeleteContext ||
   95.26          !_this->gl_data->wglMakeCurrent) {
   95.27 -        SDL_SetError("Could not retrieve OpenGL functions");
   95.28          SDL_UnloadObject(handle);
   95.29 -        return -1;
   95.30 +        return SDL_SetError("Could not retrieve OpenGL functions");
   95.31      }
   95.32  
   95.33      return 0;
   95.34 @@ -512,12 +509,10 @@
   95.35          pixel_format = WIN_GL_ChoosePixelFormat(hdc, &pfd);
   95.36      }
   95.37      if (!pixel_format) {
   95.38 -        SDL_SetError("No matching GL pixel format available");
   95.39 -        return -1;
   95.40 +        return SDL_SetError("No matching GL pixel format available");
   95.41      }
   95.42      if (!SetPixelFormat(hdc, pixel_format, &pfd)) {
   95.43 -        WIN_SetError("SetPixelFormat()");
   95.44 -        return (-1);
   95.45 +        return WIN_SetError("SetPixelFormat()");
   95.46      }
   95.47      return 0;
   95.48  }
   95.49 @@ -611,11 +606,9 @@
   95.50  WIN_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
   95.51  {
   95.52      HDC hdc;
   95.53 -    int status;
   95.54  
   95.55      if (!_this->gl_data) {
   95.56 -        SDL_SetError("OpenGL not initialized");
   95.57 -        return -1;
   95.58 +        return SDL_SetError("OpenGL not initialized");
   95.59      }
   95.60  
   95.61      if (window) {
   95.62 @@ -624,30 +617,24 @@
   95.63          hdc = NULL;
   95.64      }
   95.65      if (!_this->gl_data->wglMakeCurrent(hdc, (HGLRC) context)) {
   95.66 -        WIN_SetError("wglMakeCurrent()");
   95.67 -        status = -1;
   95.68 -    } else {
   95.69 -        status = 0;
   95.70 +        return WIN_SetError("wglMakeCurrent()");
   95.71      }
   95.72 -    return status;
   95.73 +    return 0;
   95.74  }
   95.75  
   95.76  int
   95.77  WIN_GL_SetSwapInterval(_THIS, int interval)
   95.78  {
   95.79 -    int retval = -1;
   95.80      if ((interval < 0) && (!_this->gl_data->HAS_WGL_EXT_swap_control_tear)) {
   95.81 -        SDL_SetError("Negative swap interval unsupported in this GL");
   95.82 +        return SDL_SetError("Negative swap interval unsupported in this GL");
   95.83      } else if (_this->gl_data->wglSwapIntervalEXT) {
   95.84 -        if (_this->gl_data->wglSwapIntervalEXT(interval) == TRUE) {
   95.85 -            retval = 0;
   95.86 -        } else {
   95.87 -            WIN_SetError("wglSwapIntervalEXT()");
   95.88 +        if (_this->gl_data->wglSwapIntervalEXT(interval) != TRUE) {
   95.89 +            return WIN_SetError("wglSwapIntervalEXT()");
   95.90          }
   95.91      } else {
   95.92 -        SDL_Unsupported();
   95.93 +        return SDL_Unsupported();
   95.94      }
   95.95 -    return retval;
   95.96 +    return 0;
   95.97  }
   95.98  
   95.99  int
    96.1 --- a/src/video/windows/SDL_windowsvideo.c	Fri Mar 29 21:29:57 2013 -0400
    96.2 +++ b/src/video/windows/SDL_windowsvideo.c	Sun Mar 31 12:48:50 2013 -0400
    96.3 @@ -75,10 +75,10 @@
    96.4          data = NULL;
    96.5      }
    96.6      if (!data) {
    96.7 -        SDL_OutOfMemory();
    96.8          if (device) {
    96.9              SDL_free(device);
   96.10          }
   96.11 +        SDL_OutOfMemory();
   96.12          return NULL;
   96.13      }
   96.14      device->driverdata = data;
    97.1 --- a/src/video/windows/SDL_windowswindow.c	Fri Mar 29 21:29:57 2013 -0400
    97.2 +++ b/src/video/windows/SDL_windowswindow.c	Sun Mar 31 12:48:50 2013 -0400
    97.3 @@ -82,8 +82,7 @@
    97.4      /* Allocate the window data */
    97.5      data = (SDL_WindowData *) SDL_malloc(sizeof(*data));
    97.6      if (!data) {
    97.7 -        SDL_OutOfMemory();
    97.8 -        return -1;
    97.9 +        return SDL_OutOfMemory();
   97.10      }
   97.11      data->window = window;
   97.12      data->hwnd = hwnd;
   97.13 @@ -98,8 +97,7 @@
   97.14      if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
   97.15          ReleaseDC(hwnd, data->hdc);
   97.16          SDL_free(data);
   97.17 -        WIN_SetError("SetProp() failed");
   97.18 -        return -1;
   97.19 +        return WIN_SetError("SetProp() failed");
   97.20      }
   97.21  
   97.22      /* Set up the window proc function */
   97.23 @@ -221,8 +219,7 @@
   97.24          CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, NULL, NULL,
   97.25                       SDL_Instance, NULL);
   97.26      if (!hwnd) {
   97.27 -        WIN_SetError("Couldn't create window");
   97.28 -        return -1;
   97.29 +        return WIN_SetError("Couldn't create window");
   97.30      }
   97.31  
   97.32      WIN_PumpEvents(_this);
   97.33 @@ -635,8 +632,7 @@
   97.34      /* Register the class. */
   97.35      SDL_HelperWindowClass = RegisterClass(&wce);
   97.36      if (SDL_HelperWindowClass == 0) {
   97.37 -        WIN_SetError("Unable to create Helper Window Class");
   97.38 -        return -1;
   97.39 +        return WIN_SetError("Unable to create Helper Window Class");
   97.40      }
   97.41  
   97.42      /* Create the window. */
   97.43 @@ -648,8 +644,7 @@
   97.44                                        hInstance, NULL);
   97.45      if (SDL_HelperWindow == NULL) {
   97.46          UnregisterClass(SDL_HelperWindowClassName, hInstance);
   97.47 -        WIN_SetError("Unable to create Helper Window");
   97.48 -        return -1;
   97.49 +        return WIN_SetError("Unable to create Helper Window");
   97.50      }
   97.51  
   97.52      return 0;
    98.1 --- a/src/video/x11/SDL_x11clipboard.c	Fri Mar 29 21:29:57 2013 -0400
    98.2 +++ b/src/video/x11/SDL_x11clipboard.c	Sun Mar 31 12:48:50 2013 -0400
    98.3 @@ -59,8 +59,7 @@
    98.4      /* Get the SDL window that will own the selection */
    98.5      window = GetWindow(_this);
    98.6      if (window == None) {
    98.7 -        SDL_SetError("Couldn't find a window to own the selection");
    98.8 -        return -1;
    98.9 +        return SDL_SetError("Couldn't find a window to own the selection");
   98.10      }
   98.11  
   98.12      /* Save the selection on the root window */
    99.1 --- a/src/video/x11/SDL_x11framebuffer.c	Fri Mar 29 21:29:57 2013 -0400
    99.2 +++ b/src/video/x11/SDL_x11framebuffer.c	Sun Mar 31 12:48:50 2013 -0400
    99.3 @@ -68,20 +68,17 @@
    99.4      gcv.graphics_exposures = False;
    99.5      data->gc = XCreateGC(display, data->xwindow, GCGraphicsExposures, &gcv);
    99.6      if (!data->gc) {
    99.7 -        SDL_SetError("Couldn't create graphics context");
    99.8 -        return -1;
    99.9 +        return SDL_SetError("Couldn't create graphics context");
   99.10      }
   99.11  
   99.12      /* Find out the pixel format and depth */
   99.13      if (X11_GetVisualInfoFromVisual(display, data->visual, &vinfo) < 0) {
   99.14 -        SDL_SetError("Couldn't get window visual information");
   99.15 -        return -1;
   99.16 +        return SDL_SetError("Couldn't get window visual information");
   99.17      }
   99.18  
   99.19      *format = X11_GetPixelFormatFromVisualInfo(display, &vinfo);
   99.20      if (*format == SDL_PIXELFORMAT_UNKNOWN) {
   99.21 -        SDL_SetError("Unknown window pixel format");
   99.22 -        return -1;
   99.23 +        return SDL_SetError("Unknown window pixel format");
   99.24      }
   99.25  
   99.26      /* Calculate pitch */
   99.27 @@ -132,8 +129,7 @@
   99.28  
   99.29      *pixels = SDL_malloc(window->h*(*pitch));
   99.30      if (*pixels == NULL) {
   99.31 -        SDL_OutOfMemory();
   99.32 -        return -1;
   99.33 +        return SDL_OutOfMemory();
   99.34      }
   99.35  
   99.36      data->ximage = XCreateImage(display, data->visual,
   99.37 @@ -141,8 +137,7 @@
   99.38                        window->w, window->h, 32, 0);
   99.39      if (!data->ximage) {
   99.40          SDL_free(*pixels);
   99.41 -        SDL_SetError("Couldn't create XImage");
   99.42 -        return -1;
   99.43 +        return SDL_SetError("Couldn't create XImage");
   99.44      }
   99.45      return 0;
   99.46  }
   100.1 --- a/src/video/x11/SDL_x11messagebox.c	Fri Mar 29 21:29:57 2013 -0400
   100.2 +++ b/src/video/x11/SDL_x11messagebox.c	Sun Mar 31 12:48:50 2013 -0400
   100.3 @@ -168,8 +168,7 @@
   100.4      const SDL_MessageBoxColor *colorhints;
   100.5  
   100.6      if ( numbuttons > MAX_BUTTONS ) {
   100.7 -        SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
   100.8 -        return -1;
   100.9 +        return SDL_SetError("Too many buttons (%d max allowed)", MAX_BUTTONS);
  100.10      }
  100.11  
  100.12      data->dialog_width = MIN_DIALOG_WIDTH;
  100.13 @@ -181,8 +180,7 @@
  100.14  
  100.15      data->display = XOpenDisplay( NULL );
  100.16      if ( !data->display ) {
  100.17 -        SDL_SetError("Couldn't open X11 display");
  100.18 -        return -1;
  100.19 +        return SDL_SetError("Couldn't open X11 display");
  100.20      }
  100.21  
  100.22      if (SDL_X11_HAVE_UTF8) {
  100.23 @@ -194,14 +192,12 @@
  100.24              XFreeStringList(missing);
  100.25          }
  100.26          if ( data->font_set == NULL ) {
  100.27 -            SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
  100.28 -            return -1;
  100.29 +            return SDL_SetError("Couldn't load font %s", g_MessageBoxFont);
  100.30          }
  100.31      } else {
  100.32          data->font_struct = XLoadQueryFont( data->display, g_MessageBoxFontLatin1 );
  100.33          if ( data->font_struct == NULL ) {
  100.34 -            SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);
  100.35 -            return -1;
  100.36 +            return SDL_SetError("Couldn't load font %s", g_MessageBoxFontLatin1);
  100.37          }
  100.38      }
  100.39  
  100.40 @@ -388,8 +384,7 @@
  100.41                         0, CopyFromParent, InputOutput, CopyFromParent,
  100.42                         CWEventMask, &wnd_attr );
  100.43      if ( data->window == None ) {
  100.44 -        SDL_SetError("Couldn't create X window");
  100.45 -        return -1;
  100.46 +        return SDL_SetError("Couldn't create X window");
  100.47      }
  100.48  
  100.49      if ( windowdata ) {
  100.50 @@ -520,8 +515,7 @@
  100.51  
  100.52      ctx = XCreateGC( data->display, data->window, gcflags, &ctx_vals );
  100.53      if ( ctx == None ) {
  100.54 -        SDL_SetError("Couldn't create graphics context");
  100.55 -        return -1;
  100.56 +        return SDL_SetError("Couldn't create graphics context");
  100.57      }
  100.58  
  100.59      data->button_press_index = -1;  /* Reset what button is currently depressed. */
  100.60 @@ -660,8 +654,7 @@
  100.61      if (origlocale != NULL) {
  100.62          origlocale = SDL_strdup(origlocale);
  100.63          if (origlocale == NULL) {
  100.64 -            SDL_OutOfMemory();
  100.65 -            return -1;
  100.66 +            return SDL_OutOfMemory();
  100.67          }
  100.68          setlocale(LC_ALL, "");
  100.69      }
  100.70 @@ -739,8 +732,7 @@
  100.71          SDL_assert(rc == pid);  /* not sure what to do if this fails. */
  100.72  
  100.73          if ((rc == -1) || (!WIFEXITED(status)) || (WEXITSTATUS(status) != 0)) {
  100.74 -            SDL_SetError("msgbox child process failed");
  100.75 -            return -1;
  100.76 +            return SDL_SetError("msgbox child process failed");
  100.77          }
  100.78  
  100.79          if (read(fds[0], &status, sizeof (int)) != sizeof (int))
   101.1 --- a/src/video/x11/SDL_x11modes.c	Fri Mar 29 21:29:57 2013 -0400
   101.2 +++ b/src/video/x11/SDL_x11modes.c	Sun Mar 31 12:48:50 2013 -0400
   101.3 @@ -656,8 +656,7 @@
   101.4  #endif
   101.5  
   101.6      if (_this->num_displays == 0) {
   101.7 -        SDL_SetError("No available displays");
   101.8 -        return -1;
   101.9 +        return SDL_SetError("No available displays");
  101.10      }
  101.11      return 0;
  101.12  }
  101.13 @@ -798,23 +797,20 @@
  101.14  
  101.15          res = XRRGetScreenResources (display, RootWindow(display, data->screen));
  101.16          if (!res) {
  101.17 -            SDL_SetError("Couldn't get XRandR screen resources");
  101.18 -            return -1;
  101.19 +            return SDL_SetError("Couldn't get XRandR screen resources");
  101.20          }
  101.21  
  101.22          output_info = XRRGetOutputInfo(display, res, data->xrandr_output);
  101.23          if (!output_info || output_info->connection == RR_Disconnected) {
  101.24 -            SDL_SetError("Couldn't get XRandR output info");
  101.25              XRRFreeScreenResources(res);
  101.26 -            return -1;
  101.27 +            return SDL_SetError("Couldn't get XRandR output info");
  101.28          }
  101.29  
  101.30          crtc = XRRGetCrtcInfo(display, res, output_info->crtc);
  101.31          if (!crtc) {
  101.32 -            SDL_SetError("Couldn't get XRandR crtc info");
  101.33              XRRFreeOutputInfo(output_info);
  101.34              XRRFreeScreenResources(res);
  101.35 -            return -1;
  101.36 +            return SDL_SetError("Couldn't get XRandR crtc info");
  101.37          }
  101.38  
  101.39          status = XRRSetCrtcConfig (display, res, output_info->crtc, CurrentTime,
  101.40 @@ -826,8 +822,7 @@
  101.41          XRRFreeScreenResources(res);
  101.42  
  101.43          if (status != Success) {
  101.44 -            SDL_SetError("XRRSetCrtcConfig failed");
  101.45 -            return -1;
  101.46 +            return SDL_SetError("XRRSetCrtcConfig failed");
  101.47          }
  101.48      }
  101.49  #endif /* SDL_VIDEO_DRIVER_X11_XRANDR */
   102.1 --- a/src/video/x11/SDL_x11opengl.c	Fri Mar 29 21:29:57 2013 -0400
   102.2 +++ b/src/video/x11/SDL_x11opengl.c	Sun Mar 31 12:48:50 2013 -0400
   102.3 @@ -136,8 +136,7 @@
   102.4      void *handle;
   102.5  
   102.6      if (_this->gl_data) {
   102.7 -        SDL_SetError("OpenGL context already created");
   102.8 -        return -1;
   102.9 +        return SDL_SetError("OpenGL context already created");
  102.10      }
  102.11  
  102.12      /* If SDL_GL_CONTEXT_EGL has been changed to 1, switch over to X11_GLES functions  */
  102.13 @@ -154,8 +153,7 @@
  102.14          _this->GL_DeleteContext = X11_GLES_DeleteContext;
  102.15          return X11_GLES_LoadLibrary(_this, path);
  102.16  #else
  102.17 -        SDL_SetError("SDL not configured with OpenGL ES/EGL support");
  102.18 -        return -1;
  102.19 +        return SDL_SetError("SDL not configured with OpenGL ES/EGL support");
  102.20  #endif
  102.21      }
  102.22  
  102.23 @@ -183,8 +181,7 @@
  102.24                                                 sizeof(struct
  102.25                                                        SDL_GLDriverData));
  102.26      if (!_this->gl_data) {
  102.27 -        SDL_OutOfMemory();
  102.28 -        return -1;
  102.29 +        return SDL_OutOfMemory();
  102.30      }
  102.31  
  102.32      /* Load function pointers */
  102.33 @@ -216,8 +213,7 @@
  102.34          !_this->gl_data->glXDestroyContext ||
  102.35          !_this->gl_data->glXMakeCurrent ||
  102.36          !_this->gl_data->glXSwapBuffers) {
  102.37 -        SDL_SetError("Could not retrieve OpenGL functions");
  102.38 -        return -1;
  102.39 +        return SDL_SetError("Could not retrieve OpenGL functions");
  102.40      }
  102.41  
  102.42      /* Initialize extensions */
  102.43 @@ -656,20 +652,16 @@
  102.44      Window drawable =
  102.45          (context ? ((SDL_WindowData *) window->driverdata)->xwindow : None);
  102.46      GLXContext glx_context = (GLXContext) context;
  102.47 -    int status;
  102.48  
  102.49      if (!_this->gl_data) {
  102.50 -        SDL_SetError("OpenGL not initialized");
  102.51 -        return -1;
  102.52 +        return SDL_SetError("OpenGL not initialized");
  102.53      }
  102.54  
  102.55 -    status = 0;
  102.56      if (!_this->gl_data->glXMakeCurrent(display, drawable, glx_context)) {
  102.57 -        SDL_SetError("Unable to make GL context current");
  102.58 -        status = -1;
  102.59 +        return SDL_SetError("Unable to make GL context current");
  102.60      }
  102.61  
  102.62 -    return (status);
  102.63 +    return 0;
  102.64  }
  102.65  
  102.66  /* 
   103.1 --- a/src/video/x11/SDL_x11opengles.c	Fri Mar 29 21:29:57 2013 -0400
   103.2 +++ b/src/video/x11/SDL_x11opengles.c	Sun Mar 31 12:48:50 2013 -0400
   103.3 @@ -35,8 +35,7 @@
   103.4  	*((void**)&_this->gles_data->NAME) = dlsym(handle, #NAME); \
   103.5  	if (!_this->gles_data->NAME) \
   103.6  	{ \
   103.7 -		SDL_SetError("Could not retrieve EGL function " #NAME); \
   103.8 -		return -1; \
   103.9 +		return SDL_SetError("Could not retrieve EGL function " #NAME); \
  103.10  	}
  103.11  
  103.12  /* GLES implementation of SDL OpenGL support */
  103.13 @@ -95,8 +94,7 @@
  103.14      SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
  103.15  
  103.16      if (_this->gles_data) {
  103.17 -        SDL_SetError("OpenGL ES context already created");
  103.18 -        return -1;
  103.19 +        return SDL_SetError("OpenGL ES context already created");
  103.20      }
  103.21  
  103.22      /* If SDL_GL_CONTEXT_EGL has been changed to 0, switch over to X11_GL functions  */
  103.23 @@ -113,8 +111,7 @@
  103.24          _this->GL_DeleteContext = X11_GL_DeleteContext;
  103.25          return X11_GL_LoadLibrary(_this, path);
  103.26  #else
  103.27 -        SDL_SetError("SDL not configured with OpenGL/GLX support");
  103.28 -        return -1;
  103.29 +        return SDL_SetError("SDL not configured with OpenGL/GLX support");
  103.30  #endif
  103.31      }
  103.32  
  103.33 @@ -136,8 +133,7 @@
  103.34      }
  103.35  
  103.36      if (handle == NULL) {
  103.37 -        SDL_SetError("Could not load OpenGL ES/EGL library");
  103.38 -        return -1;
  103.39 +        return SDL_SetError("Could not load OpenGL ES/EGL library");
  103.40      }
  103.41  
  103.42      /* Unload the old driver and reset the pointers */
  103.43 @@ -145,8 +141,7 @@
  103.44  
  103.45      _this->gles_data = (struct SDL_PrivateGLESData *) SDL_calloc(1, sizeof(SDL_PrivateGLESData));
  103.46      if (!_this->gles_data) {
  103.47 -        SDL_OutOfMemory();
  103.48 -        return -1;
  103.49 +        return SDL_OutOfMemory();
  103.50      }
  103.51  
  103.52      /* Load new function pointers */
  103.53 @@ -168,15 +163,13 @@
  103.54          _this->gles_data->eglGetDisplay((NativeDisplayType) data->display);
  103.55  
  103.56      if (!_this->gles_data->egl_display) {
  103.57 -        SDL_SetError("Could not get EGL display");
  103.58 -        return -1;
  103.59 +        return SDL_SetError("Could not get EGL display");
  103.60      }
  103.61  
  103.62      if (_this->gles_data->
  103.63          eglInitialize(_this->gles_data->egl_display, NULL,
  103.64                        NULL) != EGL_TRUE) {
  103.65 -        SDL_SetError("Could not initialize EGL");
  103.66 -        return -1;
  103.67 +        return SDL_SetError("Could not initialize EGL");
  103.68      }
  103.69  
  103.70      _this->gles_data->egl_dll_handle = handle;
  103.71 @@ -198,8 +191,7 @@
  103.72      }
  103.73  
  103.74      if (handle == NULL) {
  103.75 -        SDL_SetError("Could not initialize OpenGL ES library");
  103.76 -        return -1;
  103.77 +        return SDL_SetError("Could not initialize OpenGL ES library");
  103.78      }
  103.79  
  103.80      _this->gl_config.dll_handle = handle;
  103.81 @@ -353,40 +345,34 @@
  103.82  int
  103.83  X11_GLES_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context)
  103.84  {
  103.85 -    int retval;
  103.86 -
  103.87  /*
  103.88      SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
  103.89      Display *display = data->videodata->display;
  103.90  */
  103.91  
  103.92      if (!_this->gles_data) {
  103.93 -        SDL_SetError("OpenGL not initialized");
  103.94 -        return -1;
  103.95 +        return SDL_SetError("OpenGL not initialized");
  103.96      }
  103.97  
  103.98 -    retval = 1;
  103.99      if (!_this->gles_data->eglMakeCurrent(_this->gles_data->egl_display,
 103.100                                            _this->gles_data->egl_surface,
 103.101                                            _this->gles_data->egl_surface,
 103.102                                            _this->gles_data->egl_context)) {
 103.103 -        SDL_SetError("Unable to make EGL context current");
 103.104 -        retval = -1;
 103.105 +        return SDL_SetError("Unable to make EGL context current");
 103.106      }
 103.107  
 103.108  /*
 103.109      XSync(display, False);
 103.110  */
 103.111  
 103.112 -    return (retval);
 103.113 +    return 1;
 103.114  }
 103.115  
 103.116  int
 103.117  X11_GLES_SetSwapInterval(_THIS, int interval)
 103.118  {
 103.119      if (_this->gles_data) {
 103.120 -        SDL_SetError("OpenGL ES context not active");
 103.121 -        return -1;
 103.122 +        return SDL_SetError("OpenGL ES context not active");
 103.123      }
 103.124  
 103.125      EGLBoolean status;
 103.126 @@ -396,16 +382,14 @@
 103.127          return 0; 
 103.128      }
 103.129  
 103.130 -    SDL_SetError("Unable to set the EGL swap interval");
 103.131 -    return -1;
 103.132 +    return SDL_SetError("Unable to set the EGL swap interval");
 103.133  }
 103.134  
 103.135  int
 103.136  X11_GLES_GetSwapInterval(_THIS)
 103.137  {
 103.138      if (_this->gles_data) {
 103.139 -        SDL_SetError("OpenGL ES context not active");
 103.140 -        return -1;
 103.141 +        return SDL_SetError("OpenGL ES context not active");
 103.142      }
 103.143  
 103.144      return _this->gles_data->egl_swapinterval;
   104.1 --- a/src/video/x11/SDL_x11shape.c	Fri Mar 29 21:29:57 2013 -0400
   104.2 +++ b/src/video/x11/SDL_x11shape.c	Sun Mar 31 12:48:50 2013 -0400
   104.3 @@ -72,8 +72,7 @@
   104.4              free(data->bitmap);
   104.5          data->bitmap = malloc(data->bitmapsize);
   104.6          if(data->bitmap == NULL) {
   104.7 -            SDL_SetError("Could not allocate memory for shaped-window bitmap.");
   104.8 -            return -1;
   104.9 +            return SDL_SetError("Could not allocate memory for shaped-window bitmap.");
  104.10          }
  104.11      }
  104.12      memset(data->bitmap,0,data->bitmapsize);
   105.1 --- a/src/video/x11/SDL_x11video.c	Fri Mar 29 21:29:57 2013 -0400
   105.2 +++ b/src/video/x11/SDL_x11video.c	Sun Mar 31 12:48:50 2013 -0400
   105.3 @@ -305,8 +305,8 @@
   105.4      }
   105.5      data = (struct SDL_VideoData *) SDL_calloc(1, sizeof(SDL_VideoData));
   105.6      if (!data) {
   105.7 +        SDL_free(device);
   105.8          SDL_OutOfMemory();
   105.9 -        SDL_free(device);
  105.10          return NULL;
  105.11      }
  105.12      device->driverdata = data;
   106.1 --- a/src/video/x11/SDL_x11window.c	Fri Mar 29 21:29:57 2013 -0400
   106.2 +++ b/src/video/x11/SDL_x11window.c	Sun Mar 31 12:48:50 2013 -0400
   106.3 @@ -214,8 +214,7 @@
   106.4      /* Allocate the window data */
   106.5      data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
   106.6      if (!data) {
   106.7 -        SDL_OutOfMemory();
   106.8 -        return -1;
   106.9 +        return SDL_OutOfMemory();
  106.10      }
  106.11      data->window = window;
  106.12      data->xwindow = w;
  106.13 @@ -242,9 +241,8 @@
  106.14                                              (numwindows +
  106.15                                               1) * sizeof(*windowlist));
  106.16          if (!windowlist) {
  106.17 -            SDL_OutOfMemory();
  106.18              SDL_free(data);
  106.19 -            return -1;
  106.20 +            return SDL_OutOfMemory();
  106.21          }
  106.22          windowlist[numwindows] = data;
  106.23          videodata->numwindows++;
  106.24 @@ -392,15 +390,13 @@
  106.25  
  106.26          /* If we can't create a colormap, then we must die */
  106.27          if (!xattr.colormap) {
  106.28 -            SDL_SetError("Could not create writable colormap");
  106.29 -            return -1;
  106.30 +            return SDL_SetError("Could not create writable colormap");
  106.31          }
  106.32  
  106.33          /* OK, we got a colormap, now fill it in as best as we can */
  106.34          colorcells = SDL_malloc(visual->map_entries * sizeof(XColor));
  106.35          if (!colorcells) {
  106.36 -            SDL_OutOfMemory();
  106.37 -            return -1;
  106.38 +            return SDL_OutOfMemory();
  106.39          }
  106.40          ncolors = visual->map_entries;
  106.41          rmax = 0xffff;
  106.42 @@ -465,8 +461,7 @@
  106.43                        (CWOverrideRedirect | CWBackPixel | CWBorderPixel |
  106.44                         CWColormap), &xattr);
  106.45      if (!w) {
  106.46 -        SDL_SetError("Couldn't create window");
  106.47 -        return -1;
  106.48 +        return SDL_SetError("Couldn't create window");
  106.49      }
  106.50  #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
  106.51      if ((window->flags & SDL_WINDOW_OPENGL) && (_this->gl_config.use_egl == 1)) {
  106.52 @@ -483,9 +478,8 @@
  106.53                                                   (NativeWindowType) w, NULL);
  106.54  
  106.55          if (_this->gles_data->egl_surface == EGL_NO_SURFACE) {
  106.56 -            SDL_SetError("Could not create GLES window surface");
  106.57              XDestroyWindow(display, w);
  106.58 -            return -1;
  106.59 +            return SDL_SetError("Could not create GLES window surface");
  106.60          }
  106.61      }
  106.62  #endif
  106.63 @@ -1209,15 +1203,13 @@
  106.64      int i;
  106.65  
  106.66      if (visual->class != DirectColor) {
  106.67 -        SDL_SetError("Window doesn't have DirectColor visual");
  106.68 -        return -1;
  106.69 +        return SDL_SetError("Window doesn't have DirectColor visual");
  106.70      }
  106.71  
  106.72      ncolors = visual->map_entries;
  106.73      colorcells = SDL_malloc(ncolors * sizeof(XColor));
  106.74      if (!colorcells) {
  106.75 -        SDL_OutOfMemory();
  106.76 -        return -1;
  106.77 +        return SDL_OutOfMemory();
  106.78      }
  106.79  
  106.80      rshift = 0;