mirror of
https://github.com/encounter/SDL.git
synced 2025-12-14 07:36:09 +00:00
use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError
This commit is contained in:
@@ -73,7 +73,7 @@ SDL_LockMutex(SDL_mutex * mutex)
|
||||
HMTX hMtx = (HMTX)mutex;
|
||||
|
||||
if (hMtx == NULLHANDLE)
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
|
||||
ulRC = DosRequestMutexSem(hMtx, SEM_INDEFINITE_WAIT);
|
||||
if (ulRC != NO_ERROR) {
|
||||
@@ -92,7 +92,7 @@ SDL_TryLockMutex(SDL_mutex * mutex)
|
||||
HMTX hMtx = (HMTX)mutex;
|
||||
|
||||
if (hMtx == NULLHANDLE)
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
|
||||
ulRC = DosRequestMutexSem(hMtx, SEM_IMMEDIATE_RETURN);
|
||||
|
||||
@@ -115,7 +115,7 @@ SDL_UnlockMutex(SDL_mutex * mutex)
|
||||
HMTX hMtx = (HMTX)mutex;
|
||||
|
||||
if (hMtx == NULLHANDLE)
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
|
||||
ulRC = DosReleaseMutexSem(hMtx);
|
||||
if (ulRC != NO_ERROR)
|
||||
|
||||
@@ -89,7 +89,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
||||
ULONG cPost;
|
||||
|
||||
if (sem == NULL)
|
||||
return SDL_SetError("Passed a NULL sem");
|
||||
return SDL_InvalidParamError("sem");
|
||||
|
||||
if (timeout != SEM_INDEFINITE_WAIT)
|
||||
DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT, &ulStartTime, sizeof(ULONG));
|
||||
@@ -147,7 +147,7 @@ SDL_SemValue(SDL_sem * sem)
|
||||
ULONG ulRC;
|
||||
|
||||
if (sem == NULL) {
|
||||
SDL_SetError("Passed a NULL sem");
|
||||
SDL_InvalidParamError("sem");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ SDL_SemPost(SDL_sem * sem)
|
||||
ULONG ulRC;
|
||||
|
||||
if (sem == NULL)
|
||||
return SDL_SetError("Passed a NULL sem");
|
||||
return SDL_InvalidParamError("sem");
|
||||
|
||||
ulRC = DosRequestMutexSem(sem->hMtx, SEM_INDEFINITE_WAIT);
|
||||
if (ulRC != NO_ERROR)
|
||||
|
||||
Reference in New Issue
Block a user