mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-10-17 15:21:43 +00:00
use SDL_InvalidParamError or SDL_assert instead of custom SDL_SetError
This commit is contained in:
@@ -88,7 +88,7 @@ SDL_LockMutex_srw(SDL_mutex * _mutex)
|
||||
DWORD this_thread;
|
||||
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
this_thread = GetCurrentThreadId();
|
||||
@@ -115,7 +115,7 @@ SDL_TryLockMutex_srw(SDL_mutex * _mutex)
|
||||
int retval = 0;
|
||||
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
this_thread = GetCurrentThreadId();
|
||||
@@ -139,7 +139,7 @@ SDL_UnlockMutex_srw(SDL_mutex * _mutex)
|
||||
SDL_mutex_srw *mutex = (SDL_mutex_srw *)_mutex;
|
||||
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
if (mutex->owner == GetCurrentThreadId()) {
|
||||
@@ -208,7 +208,7 @@ SDL_LockMutex_cs(SDL_mutex * mutex_)
|
||||
{
|
||||
SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_;
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
EnterCriticalSection(&mutex->cs);
|
||||
@@ -222,7 +222,7 @@ SDL_TryLockMutex_cs(SDL_mutex * mutex_)
|
||||
SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_;
|
||||
int retval = 0;
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
if (TryEnterCriticalSection(&mutex->cs) == 0) {
|
||||
@@ -237,7 +237,7 @@ SDL_UnlockMutex_cs(SDL_mutex * mutex_)
|
||||
{
|
||||
SDL_mutex_cs *mutex = (SDL_mutex_cs *)mutex_;
|
||||
if (mutex == NULL) {
|
||||
return SDL_SetError("Passed a NULL mutex");
|
||||
return SDL_InvalidParamError("mutex");
|
||||
}
|
||||
|
||||
LeaveCriticalSection(&mutex->cs);
|
||||
|
Reference in New Issue
Block a user