Use cast operators in headers to avoid warnings

This avoids compiler warnings when consuming the
headers from C++.
This commit is contained in:
Albin Johansson
2025-10-26 00:46:29 +02:00
committed by Ryan C. Gordon
parent e08edab180
commit 7381a2b072
3 changed files with 9 additions and 9 deletions

View File

@@ -128,10 +128,10 @@ typedef struct SDL_FRect
*/
SDL_FORCE_INLINE void SDL_RectToFRect(const SDL_Rect *rect, SDL_FRect *frect)
{
frect->x = (float)rect->x;
frect->y = (float)rect->y;
frect->w = (float)rect->w;
frect->h = (float)rect->h;
frect->x = SDL_static_cast(float, rect->x);
frect->y = SDL_static_cast(float, rect->y);
frect->w = SDL_static_cast(float, rect->w);
frect->h = SDL_static_cast(float, rect->h);
}
/**