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.
This commit is contained in:
parent
8c6b9f4743
commit
4f438b70a2
106 changed files with 616 additions and 1189 deletions
|
@ -159,8 +159,7 @@ SDL_BlendPoint_RGB(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uin
|
|||
}
|
||||
return 0;
|
||||
default:
|
||||
SDL_Unsupported();
|
||||
return -1;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,8 +188,7 @@ SDL_BlendPoint_RGBA(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Ui
|
|||
}
|
||||
return 0;
|
||||
default:
|
||||
SDL_Unsupported();
|
||||
return -1;
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -199,14 +197,12 @@ SDL_BlendPoint(SDL_Surface * dst, int x, int y, SDL_BlendMode blendMode, Uint8 r
|
|||
Uint8 g, Uint8 b, Uint8 a)
|
||||
{
|
||||
if (!dst) {
|
||||
SDL_SetError("Passed NULL destination surface");
|
||||
return -1;
|
||||
return SDL_SetError("Passed NULL destination surface");
|
||||
}
|
||||
|
||||
/* This function doesn't work on surfaces < 8 bpp */
|
||||
if (dst->format->BitsPerPixel < 8) {
|
||||
SDL_SetError("SDL_BlendPoint(): Unsupported surface format");
|
||||
return -1;
|
||||
return SDL_SetError("SDL_BlendPoint(): Unsupported surface format");
|
||||
}
|
||||
|
||||
/* Perform clipping */
|
||||
|
@ -272,14 +268,12 @@ SDL_BlendPoints(SDL_Surface * dst, const SDL_Point * points, int count,
|
|||
int status = 0;
|
||||
|
||||
if (!dst) {
|
||||
SDL_SetError("Passed NULL destination surface");
|
||||
return -1;
|
||||
return SDL_SetError("Passed NULL destination surface");
|
||||
}
|
||||
|
||||
/* This function doesn't work on surfaces < 8 bpp */
|
||||
if (dst->format->BitsPerPixel < 8) {
|
||||
SDL_SetError("SDL_BlendPoints(): Unsupported surface format");
|
||||
return (-1);
|
||||
return SDL_SetError("SDL_BlendPoints(): Unsupported surface format");
|
||||
}
|
||||
|
||||
if (blendMode == SDL_BLENDMODE_BLEND || blendMode == SDL_BLENDMODE_ADD) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue