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:
Ryan C. Gordon 2013-03-31 12:48:50 -04:00
parent 8c6b9f4743
commit 4f438b70a2
106 changed files with 616 additions and 1189 deletions

View file

@ -82,8 +82,7 @@ int
SDL_CondSignal(SDL_cond * cond)
{
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
return SDL_SetError("Passed a NULL condition variable");
}
/* If there are waiting threads not already signalled, then
@ -107,8 +106,7 @@ int
SDL_CondBroadcast(SDL_cond * cond)
{
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
return SDL_SetError("Passed a NULL condition variable");
}
/* If there are waiting threads not already signalled, then
@ -164,8 +162,7 @@ SDL_CondWaitTimeout(SDL_cond * cond, SDL_mutex * mutex, Uint32 ms)
int retval;
if (!cond) {
SDL_SetError("Passed a NULL condition variable");
return -1;
return SDL_SetError("Passed a NULL condition variable");
}
/* Obtain the protection mutex, and increment the number of waiters.