mirror of https://github.com/encounter/SDL.git
Cleanup of SDL_SetError that already return -1 value
This commit is contained in:
parent
3e70553c48
commit
16824865c2
|
@ -42,8 +42,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
|
||||||
&GDK_GlobalTaskQueue
|
&GDK_GlobalTaskQueue
|
||||||
);
|
);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
SDL_SetError("[GDK] Could not create global task queue");
|
return SDL_SetError("[GDK] Could not create global task queue");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The initial call gets the non-duplicated handle so they can clean it up */
|
/* The initial call gets the non-duplicated handle so they can clean it up */
|
||||||
|
@ -51,8 +50,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
|
||||||
} else {
|
} else {
|
||||||
/* Duplicate the global task queue handle into outTaskQueue */
|
/* Duplicate the global task queue handle into outTaskQueue */
|
||||||
if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
|
if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
|
||||||
SDL_SetError("[GDK] Unable to acquire global task queue");
|
return SDL_SetError("[GDK] Unable to acquire global task queue");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,8 +92,7 @@ SDL_LockMutex(SDL_mutex * mutex)
|
||||||
{
|
{
|
||||||
if (mutex == NULL)
|
if (mutex == NULL)
|
||||||
{
|
{
|
||||||
SDL_SetError("Passed a NULL mutex.");
|
return SDL_SetError("Passed a NULL mutex.");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RMutex rmutex;
|
RMutex rmutex;
|
||||||
|
@ -109,8 +108,7 @@ SDL_UnlockMutex(SDL_mutex * mutex)
|
||||||
{
|
{
|
||||||
if ( mutex == NULL )
|
if ( mutex == NULL )
|
||||||
{
|
{
|
||||||
SDL_SetError("Passed a NULL mutex.");
|
return SDL_SetError("Passed a NULL mutex.");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RMutex rmutex;
|
RMutex rmutex;
|
||||||
|
|
|
@ -119,8 +119,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
|
||||||
{
|
{
|
||||||
if (! sem)
|
if (! sem)
|
||||||
{
|
{
|
||||||
SDL_SetError("Passed a NULL sem");
|
return SDL_SetError("Passed a NULL sem");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (timeout == SDL_MUTEX_MAXWAIT)
|
if (timeout == SDL_MUTEX_MAXWAIT)
|
||||||
|
@ -182,8 +181,7 @@ SDL_SemPost(SDL_sem * sem)
|
||||||
{
|
{
|
||||||
if (! sem)
|
if (! sem)
|
||||||
{
|
{
|
||||||
SDL_SetError("Passed a NULL sem.");
|
return SDL_SetError("Passed a NULL sem.");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
sem->count++;
|
sem->count++;
|
||||||
RSemaphore sema;
|
RSemaphore sema;
|
||||||
|
|
|
@ -94,8 +94,7 @@ int HAIKU_GL_MakeCurrent(_THIS, SDL_Window * window, SDL_GLContext context) {
|
||||||
// printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL));
|
// printf("HAIKU_GL_MakeCurrent(%llx), win = %llx, thread = %d\n", (uint64)context, (uint64)window, find_thread(NULL));
|
||||||
if (glView != NULL) {
|
if (glView != NULL) {
|
||||||
if ((glView->Window() == NULL) || (window == NULL) || (_ToBeWin(window)->GetGLView() != glView)) {
|
if ((glView->Window() == NULL) || (window == NULL) || (_ToBeWin(window)->GetGLView() != glView)) {
|
||||||
SDL_SetError("MakeCurrent failed");
|
return SDL_SetError("MakeCurrent failed");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_GetBeApp()->SetCurrentContext(glView);
|
_GetBeApp()->SetCurrentContext(glView);
|
||||||
|
|
Loading…
Reference in New Issue