mirror of
https://github.com/encounter/SDL.git
synced 2025-12-11 14:41:56 +00:00
re-use return value of SDL_SetError/WIN_SetErrorFromHRESULT/SDL_OutOfMemory
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user