Cleanup of SDL_SetError that already return -1 value
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
diff --git a/src/core/gdk/SDL_gdk.cpp b/src/core/gdk/SDL_gdk.cpp
index 4058a9b..5d94c9b 100644
--- a/src/core/gdk/SDL_gdk.cpp
+++ b/src/core/gdk/SDL_gdk.cpp
@@ -42,8 +42,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
&GDK_GlobalTaskQueue
);
if (FAILED(hr)) {
- SDL_SetError("[GDK] Could not create global task queue");
- return -1;
+ return SDL_SetError("[GDK] Could not create global task queue");
}
/* The initial call gets the non-duplicated handle so they can clean it up */
@@ -51,8 +50,7 @@ SDL_GDKGetTaskQueue(XTaskQueueHandle * outTaskQueue)
} else {
/* Duplicate the global task queue handle into outTaskQueue */
if (FAILED(XTaskQueueDuplicateHandle(GDK_GlobalTaskQueue, outTaskQueue))) {
- SDL_SetError("[GDK] Unable to acquire global task queue");
- return -1;
+ return SDL_SetError("[GDK] Unable to acquire global task queue");
}
}
diff --git a/src/thread/ngage/SDL_sysmutex.cpp b/src/thread/ngage/SDL_sysmutex.cpp
index 34cf451..6893fc6 100644
--- a/src/thread/ngage/SDL_sysmutex.cpp
+++ b/src/thread/ngage/SDL_sysmutex.cpp
@@ -92,8 +92,7 @@ SDL_LockMutex(SDL_mutex * mutex)
{
if (mutex == NULL)
{
- SDL_SetError("Passed a NULL mutex.");
- return -1;
+ return SDL_SetError("Passed a NULL mutex.");
}
RMutex rmutex;
@@ -109,8 +108,7 @@ SDL_UnlockMutex(SDL_mutex * mutex)
{
if ( mutex == NULL )
{
- SDL_SetError("Passed a NULL mutex.");
- return -1;
+ return SDL_SetError("Passed a NULL mutex.");
}
RMutex rmutex;
diff --git a/src/thread/ngage/SDL_syssem.cpp b/src/thread/ngage/SDL_syssem.cpp
index ab277ca..622d623 100644
--- a/src/thread/ngage/SDL_syssem.cpp
+++ b/src/thread/ngage/SDL_syssem.cpp
@@ -119,8 +119,7 @@ SDL_SemWaitTimeout(SDL_sem * sem, Uint32 timeout)
{
if (! sem)
{
- SDL_SetError("Passed a NULL sem");
- return -1;
+ return SDL_SetError("Passed a NULL sem");
}
if (timeout == SDL_MUTEX_MAXWAIT)
@@ -182,8 +181,7 @@ SDL_SemPost(SDL_sem * sem)
{
if (! sem)
{
- SDL_SetError("Passed a NULL sem.");
- return -1;
+ return SDL_SetError("Passed a NULL sem.");
}
sem->count++;
RSemaphore sema;
diff --git a/src/video/haiku/SDL_bopengl.cc b/src/video/haiku/SDL_bopengl.cc
index 0c7a704..72bdb77 100644
--- a/src/video/haiku/SDL_bopengl.cc
+++ b/src/video/haiku/SDL_bopengl.cc
@@ -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));
if (glView != NULL) {
if ((glView->Window() == NULL) || (window == NULL) || (_ToBeWin(window)->GetGLView() != glView)) {
- SDL_SetError("MakeCurrent failed");
- return -1;
+ return SDL_SetError("MakeCurrent failed");
}
}
_GetBeApp()->SetCurrentContext(glView);