Change return type from void to int, for functions that set an error

(SDL_SetError(), SDL_OutOfMemory(), SDL_Unsupported(), SDL_InvalidParam())

Update prototype to forward errors to generic layer, for the functions:
MoveCursor, WarpMouse, GL_DeleteContext, GetDisplayModes.

Check invalid parameter in SDL_SetTextInputRect() generic layer.
This commit is contained in:
Sylvain
2023-02-06 20:24:12 +01:00
committed by Sam Lantinga
parent 6c37d5b57f
commit c5c94a6be6
100 changed files with 472 additions and 389 deletions

View File

@@ -416,12 +416,14 @@ extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_CreatePixelFormat(Uint32 pixel_for
* Free an SDL_PixelFormat structure allocated by SDL_CreatePixelFormat().
*
* \param format the SDL_PixelFormat structure to free
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreatePixelFormat
*/
extern DECLSPEC void SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
extern DECLSPEC int SDLCALL SDL_DestroyPixelFormat(SDL_PixelFormat *format);
/**
* Create a palette structure with the specified number of color entries.
@@ -478,12 +480,14 @@ extern DECLSPEC int SDLCALL SDL_SetPaletteColors(SDL_Palette * palette,
* Free a palette created with SDL_CreatePalette().
*
* \param palette the SDL_Palette structure to be freed
* \returns 0 on success or a negative error code on failure; call
* SDL_GetError() for more information.
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_CreatePalette
*/
extern DECLSPEC void SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
extern DECLSPEC int SDLCALL SDL_DestroyPalette(SDL_Palette * palette);
/**
* Map an RGB triple to an opaque pixel value for a given pixel format.