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

@@ -122,7 +122,7 @@ SDL_SemTryWait_atom(SDL_sem * _sem)
LONG count;
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
count = sem->count;
@@ -144,7 +144,7 @@ SDL_SemWait_atom(SDL_sem * _sem)
LONG count;
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
for (;;) {
@@ -176,7 +176,7 @@ SDL_SemWaitTimeout_atom(SDL_sem * _sem, Uint32 timeout)
}
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
/**
@@ -219,7 +219,7 @@ SDL_SemValue_atom(SDL_sem * _sem)
SDL_sem_atom *sem = (SDL_sem_atom *)_sem;
if (!sem) {
SDL_SetError("Passed a NULL sem");
SDL_InvalidParamError("sem");
return 0;
}
@@ -232,7 +232,7 @@ SDL_SemPost_atom(SDL_sem * _sem)
SDL_sem_atom *sem = (SDL_sem_atom *)_sem;
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
InterlockedIncrement(&sem->count);
@@ -313,7 +313,7 @@ SDL_SemWaitTimeout_kern(SDL_sem * _sem, Uint32 timeout)
DWORD dwMilliseconds;
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
if (timeout == SDL_MUTEX_MAXWAIT) {
@@ -354,7 +354,7 @@ SDL_SemValue_kern(SDL_sem * _sem)
{
SDL_sem_kern *sem = (SDL_sem_kern *)_sem;
if (!sem) {
SDL_SetError("Passed a NULL sem");
SDL_InvalidParamError("sem");
return 0;
}
return (Uint32)sem->count;
@@ -365,7 +365,7 @@ SDL_SemPost_kern(SDL_sem * _sem)
{
SDL_sem_kern *sem = (SDL_sem_kern *)_sem;
if (!sem) {
return SDL_SetError("Passed a NULL sem");
return SDL_InvalidParamError("sem");
}
/* Increase the counter in the first place, because
* after a successful release the semaphore may