summaryrefslogtreecommitdiff
path: root/src/video/SDL_pixels.c
diff options
context:
space:
mode:
authorRyan C. Gordon <icculus@icculus.org>2013-03-31 12:48:50 -0400
committerRyan C. Gordon <icculus@icculus.org>2013-03-31 12:48:50 -0400
commit9859d20629abbf63ca6ed778097f844d82120b6c (patch)
tree4c17440653e80185e1e329024f463fd2cc533524 /src/video/SDL_pixels.c
parent886d5f0831eb7b002a5af0eca91e83e9d17ebfc6 (diff)
downloadsdl-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.c6
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) {