diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2013-03-31 12:48:50 -0400 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2013-03-31 12:48:50 -0400 |
commit | 9859d20629abbf63ca6ed778097f844d82120b6c (patch) | |
tree | 4c17440653e80185e1e329024f463fd2cc533524 /src/video/SDL_pixels.c | |
parent | 886d5f0831eb7b002a5af0eca91e83e9d17ebfc6 (diff) | |
download | sdl-9859d20629abbf63ca6ed778097f844d82120b6c.tar.gz |
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.
Diffstat (limited to 'src/video/SDL_pixels.c')
-rw-r--r-- | src/video/SDL_pixels.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/video/SDL_pixels.c b/src/video/SDL_pixels.c index c9d5bd262..84a75b8eb 100644 --- a/src/video/SDL_pixels.c +++ b/src/video/SDL_pixels.c @@ -638,13 +638,11 @@ int SDL_SetPixelFormatPalette(SDL_PixelFormat * format, SDL_Palette *palette) { if (!format) { - SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format"); - return -1; + return SDL_SetError("SDL_SetPixelFormatPalette() passed NULL format"); } if (palette && palette->ncolors != (1 << format->BitsPerPixel)) { - SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format"); - return -1; + return SDL_SetError("SDL_SetPixelFormatPalette() passed a palette that doesn't match the format"); } if (format->palette == palette) { |