Use cast operators in headers to avoid warnings
Some checks failed
Build (All) / Create test plan (push) Has been cancelled
Build (All) / level1 (push) Has been cancelled
Build (All) / level2 (push) Has been cancelled

This avoids compiler warnings when consuming the
headers from C++.

(cherry picked from commit 7381a2b072)
This commit is contained in:
Albin Johansson
2025-10-26 00:46:29 +02:00
committed by Sam Lantinga
parent 95977f41b7
commit 16d9f7316f
3 changed files with 9 additions and 9 deletions

View File

@@ -125,10 +125,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);
}
/**