use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError

This commit is contained in:
pionere
2022-01-17 16:26:02 +01:00
committed by Ryan C. Gordon
parent 4a17612bff
commit ebdd536676
36 changed files with 109 additions and 123 deletions

View File

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

View File

@@ -84,7 +84,7 @@ SDL_TryLockMutex(SDL_mutex * mutex)
#else
SceInt32 res = 0;
if (mutex == NULL) {
return SDL_SetError("Passed a NULL mutex");
return SDL_InvalidParamError("mutex");
}
res = sceKernelTryLockLwMutex(&mutex->lock, 1);
@@ -114,7 +114,7 @@ SDL_mutexP(SDL_mutex * mutex)
#else
SceInt32 res = 0;
if (mutex == NULL) {
return SDL_SetError("Passed a NULL mutex");
return SDL_InvalidParamError("mutex");
}
res = sceKernelLockLwMutex(&mutex->lock, 1, NULL);
@@ -136,7 +136,7 @@ SDL_mutexV(SDL_mutex * mutex)
SceInt32 res = 0;
if (mutex == NULL) {
return SDL_SetError("Passed a NULL mutex");
return SDL_InvalidParamError("mutex");
}
res = sceKernelUnlockLwMutex(&mutex->lock, 1);

View File

@@ -82,7 +82,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
int res;
if (sem == NULL) {
SDL_SetError("Passed a NULL sem");
SDL_InvalidParamError("sem");
return 0;
}
@@ -128,7 +128,7 @@ Uint32 SDL_SemValue(SDL_sem *sem)
SceKernelSemaInfo info;
if (sem == NULL) {
SDL_SetError("Passed a NULL sem");
SDL_InvalidParamError("sem");
return 0;
}
@@ -144,7 +144,7 @@ int SDL_SemPost(SDL_sem *sem)
int res;
if (sem == NULL) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
res = sceKernelSignalSema(sem->semid, 1);