grimfang4 / SDL_FontCache

A generic font caching C library with loading and rendering support for SDL.
MIT License
305 stars 66 forks source link

-Wnarrowing warning spam #38

Open SnapperTT opened 5 years ago

SnapperTT commented 5 years ago

Here is the problem:

SDL_FontCache/SDL_FontCache.c:2724:26: warning: narrowing conversion of ‘y’ from ‘float’ to ‘int’ [-Wnarrowing]
 2724 |     FC_Rect result = {x, y, 0, 0};

I'm getting ~20 of these

Possible fix: Wrap all instances with FC_Rect result = { int(x), int(y), int(0), int(0) }

Are you happy for me to make the required changes and submit a PR? Cheers

grimfang4 commented 5 years ago

I'm good with the change, but use the C-style cast, as SDL_FontCache is a C library: (int)x