mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-27 09:44:15 +00:00
Remove returns int from Destroy/Close/Unlock functions
This commit is contained in:
@@ -1553,25 +1553,23 @@ int SDL_LockAudioDevice(SDL_AudioDeviceID devid)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SDL_UnlockAudioDevice(SDL_AudioDeviceID devid)
|
||||
void SDL_UnlockAudioDevice(SDL_AudioDeviceID devid)
|
||||
{
|
||||
/* Obtain a lock on the mixing buffers */
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
if (!device) {
|
||||
return SDL_InvalidParamError("devid");
|
||||
return;
|
||||
}
|
||||
current_audio.impl.UnlockDevice(device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SDL_CloseAudioDevice(SDL_AudioDeviceID devid)
|
||||
void SDL_CloseAudioDevice(SDL_AudioDeviceID devid)
|
||||
{
|
||||
SDL_AudioDevice *device = get_audio_device(devid);
|
||||
if (!device) {
|
||||
return SDL_InvalidParamError("devid");
|
||||
return;
|
||||
}
|
||||
close_audio_device(device);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SDL_QuitAudio(void)
|
||||
|
||||
@@ -144,7 +144,7 @@ SDL_DYNAPI_PROC(void,SDL_ClearComposition,(void),(),)
|
||||
SDL_DYNAPI_PROC(void,SDL_ClearError,(void),(),)
|
||||
SDL_DYNAPI_PROC(void,SDL_ClearHints,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_ClearQueuedAudio,(SDL_AudioDeviceID a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_CloseAudioDevice,(SDL_AudioDeviceID a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_CloseGamepad,(SDL_Gamepad *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_CloseJoystick,(SDL_Joystick *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_CloseSensor,(SDL_Sensor *a),(a),)
|
||||
@@ -184,13 +184,13 @@ SDL_DYNAPI_PROC(Uint32,SDL_DequeueAudio,(SDL_AudioDeviceID a, void *b, Uint32 c)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyAudioStream,(SDL_AudioStream *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyCond,(SDL_cond *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyMutex,(SDL_mutex *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_DestroyPalette,(SDL_Palette *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_DestroyPixelFormat,(SDL_PixelFormat *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_DestroyRenderer,(SDL_Renderer *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyPalette,(SDL_Palette *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyPixelFormat,(SDL_PixelFormat *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyRenderer,(SDL_Renderer *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroySemaphore,(SDL_sem *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroySurface,(SDL_Surface *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_DestroyTexture,(SDL_Texture *a),(a),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_DestroyWindow,(SDL_Window *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyTexture,(SDL_Texture *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DestroyWindow,(SDL_Window *a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_DetachThread,(SDL_Thread *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_DetachVirtualJoystick,(SDL_JoystickID a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_DisableScreenSaver,(void),(),)
|
||||
@@ -722,7 +722,7 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_TextInputShown,(void),(),return)
|
||||
SDL_DYNAPI_PROC(SDL_threadID,SDL_ThreadID,(void),(),return)
|
||||
SDL_DYNAPI_PROC(int,SDL_TryLockMutex,(SDL_mutex *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_UnloadObject,(void *a),(a),)
|
||||
SDL_DYNAPI_PROC(int,SDL_UnlockAudioDevice,(SDL_AudioDeviceID a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_UnlockAudioDevice,(SDL_AudioDeviceID a),(a),)
|
||||
SDL_DYNAPI_PROC(void,SDL_UnlockJoysticks,(void),(),)
|
||||
SDL_DYNAPI_PROC(int,SDL_UnlockMutex,(SDL_mutex *a),(a),return)
|
||||
SDL_DYNAPI_PROC(void,SDL_UnlockSurface,(SDL_Surface *a),(a),)
|
||||
|
||||
@@ -4089,9 +4089,9 @@ static int SDL_DestroyTextureInternal(SDL_Texture *texture, SDL_bool is_destroyi
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SDL_DestroyTexture(SDL_Texture *texture)
|
||||
void SDL_DestroyTexture(SDL_Texture *texture)
|
||||
{
|
||||
return SDL_DestroyTextureInternal(texture, SDL_FALSE /* is_destroying */);
|
||||
SDL_DestroyTextureInternal(texture, SDL_FALSE /* is_destroying */);
|
||||
}
|
||||
|
||||
static void SDL_DiscardAllCommands(SDL_Renderer *renderer)
|
||||
@@ -4116,9 +4116,9 @@ static void SDL_DiscardAllCommands(SDL_Renderer *renderer)
|
||||
}
|
||||
}
|
||||
|
||||
int SDL_DestroyRenderer(SDL_Renderer *renderer)
|
||||
void SDL_DestroyRenderer(SDL_Renderer *renderer)
|
||||
{
|
||||
CHECK_RENDERER_MAGIC(renderer, -1);
|
||||
CHECK_RENDERER_MAGIC(renderer,);
|
||||
|
||||
SDL_DelEventWatch(SDL_RendererEventWatch, renderer);
|
||||
|
||||
@@ -4147,7 +4147,6 @@ int SDL_DestroyRenderer(SDL_Renderer *renderer)
|
||||
|
||||
/* Free the renderer instance */
|
||||
renderer->DestroyRenderer(renderer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
|
||||
|
||||
@@ -623,19 +623,19 @@ int SDL_InitFormat(SDL_PixelFormat *format, Uint32 pixel_format)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int SDL_DestroyPixelFormat(SDL_PixelFormat *format)
|
||||
void SDL_DestroyPixelFormat(SDL_PixelFormat *format)
|
||||
{
|
||||
SDL_PixelFormat *prev;
|
||||
|
||||
if (format == NULL) {
|
||||
return SDL_InvalidParamError("format");
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_AtomicLock(&formats_lock);
|
||||
|
||||
if (--format->refcount > 0) {
|
||||
SDL_AtomicUnlock(&formats_lock);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Remove this format from our list */
|
||||
@@ -656,7 +656,7 @@ int SDL_DestroyPixelFormat(SDL_PixelFormat *format)
|
||||
SDL_DestroyPalette(format->palette);
|
||||
}
|
||||
SDL_free(format);
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_Palette *
|
||||
@@ -744,17 +744,16 @@ int SDL_SetPaletteColors(SDL_Palette *palette, const SDL_Color *colors,
|
||||
return status;
|
||||
}
|
||||
|
||||
int SDL_DestroyPalette(SDL_Palette *palette)
|
||||
void SDL_DestroyPalette(SDL_Palette *palette)
|
||||
{
|
||||
if (palette == NULL) {
|
||||
return SDL_InvalidParamError("palette");
|
||||
return;
|
||||
}
|
||||
if (--palette->refcount > 0) {
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
SDL_free(palette->colors);
|
||||
SDL_free(palette);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -3128,11 +3128,11 @@ SDL_Window *SDL_GetFocusWindow(void)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int SDL_DestroyWindow(SDL_Window *window)
|
||||
void SDL_DestroyWindow(SDL_Window *window)
|
||||
{
|
||||
SDL_VideoDisplay *display;
|
||||
|
||||
CHECK_WINDOW_MAGIC(window, -1);
|
||||
CHECK_WINDOW_MAGIC(window,);
|
||||
|
||||
window->is_destroying = SDL_TRUE;
|
||||
|
||||
@@ -3209,7 +3209,6 @@ int SDL_DestroyWindow(SDL_Window *window)
|
||||
}
|
||||
|
||||
SDL_free(window);
|
||||
return 0;
|
||||
}
|
||||
|
||||
SDL_bool SDL_ScreenSaverEnabled()
|
||||
|
||||
Reference in New Issue
Block a user