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
|
@ -711,14 +711,12 @@ SDL_BlendLine(SDL_Surface * dst, int x1, int y1, int x2, int y2,
|
|||
BlendLineFunc func;
|
||||
|
||||
if (!dst) {
|
||||
SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
|
||||
return -1;
|
||||
return SDL_SetError("SDL_BlendLine(): Passed NULL destination surface");
|
||||
}
|
||||
|
||||
func = SDL_CalculateBlendLineFunc(dst->format);
|
||||
if (!func) {
|
||||
SDL_SetError("SDL_BlendLine(): Unsupported surface format");
|
||||
return -1;
|
||||
return SDL_SetError("SDL_BlendLine(): Unsupported surface format");
|
||||
}
|
||||
|
||||
/* Perform clipping */
|
||||
|
@ -742,14 +740,12 @@ SDL_BlendLines(SDL_Surface * dst, const SDL_Point * points, int count,
|
|||
BlendLineFunc func;
|
||||
|
||||
if (!dst) {
|
||||
SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
|
||||
return -1;
|
||||
return SDL_SetError("SDL_BlendLines(): Passed NULL destination surface");
|
||||
}
|
||||
|
||||
func = SDL_CalculateBlendLineFunc(dst->format);
|
||||
if (!func) {
|
||||
SDL_SetError("SDL_BlendLines(): Unsupported surface format");
|
||||
return -1;
|
||||
return SDL_SetError("SDL_BlendLines(): Unsupported surface format");
|
||||
}
|
||||
|
||||
for (i = 1; i < count; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue