SDL_FontCache icon indicating copy to clipboard operation
SDL_FontCache copied to clipboard

-Wnarrowing warning spam

Open SnapperTT opened this issue 6 years ago • 1 comments

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

SnapperTT avatar Aug 30 '19 01:08 SnapperTT

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

grimfang4 avatar Aug 30 '19 17:08 grimfang4