re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory

This commit is contained in:
pionere authored and Ryan C. Gordon committed 2022-01-28 20:40:19 -05:00
1 parent ebdd536676
commit 60deadba59
18 files changed
+52 -102

No files matched your search

+2 -4
View File
@@ -52,11 +52,9 @@ SDL_SYS_CreateThread(SDL_Thread * thread)
thread->handle = (void *) new std::thread(std::move(cpp_thread));
return 0;
} catch (std::system_error & ex) {
SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what());
return -1;
return SDL_SetError("unable to start a C++ thread: code=%d; %s", ex.code(), ex.what());
} catch (std::bad_alloc &) {
SDL_OutOfMemory();
return -1;
return SDL_OutOfMemory();
}
}