use SDL_InvalidParamError in the thread 'classes'

This commit is contained in:
pionere
2022-11-19 08:13:12 +01:00
committed by Ryan C. Gordon
parent 61188d4972
commit 450f184f7d
6 changed files with 31 additions and 23 deletions

View File

@@ -180,11 +180,15 @@ Uint32
SDL_SemValue(SDL_sem * sem)
{
int ret = 0;
if (sem) {
sem_getvalue(&sem->sem, &ret);
if (ret < 0) {
ret = 0;
}
if (!sem) {
SDL_InvalidParamError("sem");
return 0;
}
sem_getvalue(&sem->sem, &ret);
if (ret < 0) {
ret = 0;
}
return (Uint32) ret;
}