From 98125af3c955a25e1ae686d5afc3c47d2e2c4332 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 1 Dec 2016 16:56:18 -0800 Subject: 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) (cherry picked from commit d22fd541bf9dd87889c25909e19a640a580bcad7) Test: mma -j Change-Id: I8e1e32d490aa89fca9f8c901c00b9f24409520f4 --- README.android | 7 ++++++- rdppm.c | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.android b/README.android index d7140fe2..0fa01750 100644 --- a/README.android +++ b/README.android @@ -28,4 +28,9 @@ the extra underscore). Fix broken build with NDK platforms < android-21 Cherry picked from upstream: -https://github.com/libjpeg-turbo/libjpeg-turbo/commit/dfefba77520ded5c5fd4864e76352a5f3eb23e74 \ No newline at end of file +https://github.com/libjpeg-turbo/libjpeg-turbo/commit/dfefba77520ded5c5fd4864e76352a5f3eb23e74 + +(4) rdppm.c +Fix sign mismatch comparison warnings +Cherry picked from upstream: +https://github.com/libjpeg-turbo/libjpeg-turbo/commit/d22fd541bf9dd87889c25909e19a640a580bcad7 diff --git a/rdppm.c b/rdppm.c index b71d3378..33ff7495 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) -- cgit v1.2.3