From: Colin Cross Date: Fri, 2 Dec 2016 00:56:18 +0000 (-0800) Subject: Fix sign mismatch comparison warnings X-Git-Tag: 1.5.2~24 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0f4fcced0a386a5c8179bc7b9068868543be2b38;p=libjpeg-turbo Fix sign mismatch comparison warnings Fixes: rdppm.c:257:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] if (temp > maxval) ~~~~ ^ ~~~~~~ rdppm.c:284:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] if (temp > maxval) ~~~~ ^ ~~~~~~ rdppm.c:289:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] if (temp > maxval) ~~~~ ^ ~~~~~~ rdppm.c:294:14: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare] if (temp > maxval) --- diff --git a/rdppm.c b/rdppm.c index b71d337..33ff749 100644 --- a/rdppm.c +++ b/rdppm.c @@ -251,7 +251,7 @@ get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) ptr = source->pub.buffer[0]; bufferptr = source->iobuffer; for (col = cinfo->image_width; col > 0; col--) { - register int temp; + register unsigned int temp; temp = UCH(*bufferptr++) << 8; temp |= UCH(*bufferptr++); if (temp > maxval) @@ -278,7 +278,7 @@ get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) ptr = source->pub.buffer[0]; bufferptr = source->iobuffer; for (col = cinfo->image_width; col > 0; col--) { - register int temp; + register unsigned int temp; temp = UCH(*bufferptr++) << 8; temp |= UCH(*bufferptr++); if (temp > maxval)