From 931662ae6ed9957be812a0bac134d9d856bcc0cf Mon Sep 17 00:00:00 2001 From: Fabian Giesen Date: Sat, 22 Jul 2017 16:04:07 -0700 Subject: [PATCH] stb_image_write: Warning fix. --- stb_image_write.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stb_image_write.h b/stb_image_write.h index 4dc45d4..68c5f24 100644 --- a/stb_image_write.h +++ b/stb_image_write.h @@ -1267,9 +1267,9 @@ static int stbi_write_jpg_core(stbi__write_context *s, int width, int height, in for(i = 0; i < 64; ++i) { int uvti, yti = (YQT[i]*quality+50)/100; - YTable[stbiw__jpg_ZigZag[i]] = yti < 1 ? 1 : yti > 255 ? 255 : yti; + YTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (yti < 1 ? 1 : yti > 255 ? 255 : yti); uvti = (UVQT[i]*quality+50)/100; - UVTable[stbiw__jpg_ZigZag[i]] = uvti < 1 ? 1 : uvti > 255 ? 255 : uvti; + UVTable[stbiw__jpg_ZigZag[i]] = (unsigned char) (uvti < 1 ? 1 : uvti > 255 ? 255 : uvti); } for(row = 0, k = 0; row < 8; ++row) {