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

+1 -2
View File
@@ -1523,8 +1523,7 @@ SDL_OpenAudio(SDL_AudioSpec * desired, SDL_AudioSpec * obtained)
/* SDL_OpenAudio() is legacy and can only act on Device ID #1. */
if (open_devices[0] != NULL) {
SDL_SetError("Audio device is already opened");
return -1;
return SDL_SetError("Audio device is already opened");
}
if (obtained) {
+1 -2
View File
@@ -1135,8 +1135,7 @@ COREAUDIO_OpenDevice(_THIS, void *handle, const char *devname, int iscapture)
this->hidden->ready_semaphore = NULL;
if ((this->hidden->thread != NULL) && (this->hidden->thread_error != NULL)) {
SDL_SetError("%s", this->hidden->thread_error);
return -1;
return SDL_SetError("%s", this->hidden->thread_error);
}
return (this->hidden->thread != NULL) ? 0 : -1;