Hello, I noticed I when I try to compile SFML with VS 2019, I get the following compilation warning (that gets treated as an error)
Severity Code Description Project File Line Suppression State
Warning C4242 '=': conversion from 'int' to 'unsigned char', possible loss of data sfml-graphics C:\SFML-2.6.0-sources\SFML-2.6.0\extlibs\headers\stb_image\stb_image.h 3425
I noticed this is because, j->marker in stbi__decode_jpeg_image is unsigned char while stbi__skip_jpeg_junk_at_end returns an int. In the method stbi__skip_jpeg_junk_at_end, I see we should really be returning an unsigned char, but return int instead. Specifically changing
static int stbi__skip_jpeg_junk_at_end(stbi__jpeg *j) to
static unsigned char stbi__skip_jpeg_junk_at_end(stbi__jpeg *j)
and
int x = stbi__get8(j->s); to
unsigned char x = stbi__get8(j->s); fixes the problem.
There is a similar issue with arguments passed to stbi__mul2shorts_valid (method takes short, but passing in int)
Should I open an issue ?