Updated source to match SDL function prototype style

This commit is contained in:
Sam Lantinga
2023-05-23 11:29:41 -07:00
parent 737aa881fa
commit ddbdd73258
173 changed files with 481 additions and 942 deletions

View File

@@ -42,8 +42,7 @@ SDL_COMPILE_TIME_ASSERT(can_indicate_overflow, SDL_SIZE_MAX > SDL_MAX_SINT32);
*
* for FOURCC, use SDL_CalculateYUVSize()
*/
static int
SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal)
static int SDL_CalculateRGBSize(Uint32 format, size_t width, size_t height, size_t *size, size_t *pitch, SDL_bool minimal)
{
if (SDL_BITSPERPIXEL(format) >= 8) {
if (SDL_size_mul_overflow(width, SDL_BYTESPERPIXEL(format), pitch)) {
@@ -113,8 +112,7 @@ int SDL_CalculateSize(Uint32 format, int width, int height, size_t *size, size_t
* Create an empty RGB surface of the appropriate depth using the given
* enum SDL_PIXELFORMAT_* format
*/
SDL_Surface *
SDL_CreateSurface(int width, int height, Uint32 format)
SDL_Surface *SDL_CreateSurface(int width, int height, Uint32 format)
{
size_t pitch, size;
SDL_Surface *surface;
@@ -206,8 +204,7 @@ SDL_CreateSurface(int width, int height, Uint32 format)
* Create an RGB surface from an existing memory buffer using the given given
* enum SDL_PIXELFORMAT_* format
*/
SDL_Surface *
SDL_CreateSurfaceFrom(void *pixels,
SDL_Surface *SDL_CreateSurfaceFrom(void *pixels,
int width, int height, int pitch,
Uint32 format)
{
@@ -285,8 +282,7 @@ int SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)
return 0;
}
SDL_bool
SDL_SurfaceHasRLE(SDL_Surface *surface)
SDL_bool SDL_SurfaceHasRLE(SDL_Surface *surface)
{
if (surface == NULL) {
return SDL_FALSE;
@@ -329,8 +325,7 @@ int SDL_SetSurfaceColorKey(SDL_Surface *surface, int flag, Uint32 key)
return 0;
}
SDL_bool
SDL_SurfaceHasColorKey(SDL_Surface *surface)
SDL_bool SDL_SurfaceHasColorKey(SDL_Surface *surface)
{
if (surface == NULL) {
return SDL_FALSE;
@@ -595,8 +590,7 @@ int SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)
return 0;
}
SDL_bool
SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
SDL_bool SDL_SetSurfaceClipRect(SDL_Surface *surface, const SDL_Rect *rect)
{
SDL_Rect full_rect;
@@ -1087,8 +1081,7 @@ void SDL_UnlockSurface(SDL_Surface *surface)
/*
* Creates a new surface identical to the existing surface
*/
SDL_Surface *
SDL_DuplicateSurface(SDL_Surface *surface)
SDL_Surface *SDL_DuplicateSurface(SDL_Surface *surface)
{
return SDL_ConvertSurface(surface, surface->format);
}
@@ -1096,8 +1089,7 @@ SDL_DuplicateSurface(SDL_Surface *surface)
/*
* Convert a surface into the specified pixel format.
*/
SDL_Surface *
SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format)
SDL_Surface *SDL_ConvertSurface(SDL_Surface *surface, const SDL_PixelFormat *format)
{
SDL_Surface *convert;
Uint32 copy_flags;
@@ -1350,8 +1342,7 @@ end:
return convert;
}
SDL_Surface *
SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format)
SDL_Surface *SDL_ConvertSurfaceFormat(SDL_Surface *surface, Uint32 pixel_format)
{
SDL_PixelFormat *fmt;
SDL_Surface *convert = NULL;