From: Adam Stylinski Date: Tue, 22 Mar 2022 23:39:41 +0000 (-0400) Subject: Fixed a warning about a comparison of an unsigned with a signed type X-Git-Tag: 2.1.0-beta1~309 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3a900fe47b95c44a1c8a1812ebfdb623d828d1a9;p=thirdparty%2Fzlib-ng.git Fixed a warning about a comparison of an unsigned with a signed type --- diff --git a/arch/x86/adler32_ssse3.c b/arch/x86/adler32_ssse3.c index 1767572a0..5d28ac95f 100644 --- a/arch/x86/adler32_ssse3.c +++ b/arch/x86/adler32_ssse3.c @@ -59,10 +59,10 @@ Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size * additions worthwhile or if it's worth it to just eat the cost of an unaligned * load. This is a pretty simple test, just test if 16 - the remainder + len is * < 16 */ - int max_iters = NMAX; - int rem = (uintptr_t)buf & 15; - int align_offset = 16 - rem; - int k = 0; + uint32_t max_iters = NMAX; + uint32_t rem = (uintptr_t)buf & 15; + uint32_t align_offset = 16 - rem; + uint32_t k = 0; if (rem) { if (len < 16 + align_offset) { /* Let's eat the cost of this one unaligned load so that @@ -79,7 +79,7 @@ Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size goto unaligned_jmp; } - for (int i = 0; i < align_offset; ++i) { + for (uint32_t i = 0; i < align_offset; ++i) { adler += *(buf++); sum2 += adler; } @@ -98,7 +98,7 @@ Z_INTERNAL uint32_t adler32_ssse3(uint32_t adler, const unsigned char *buf, size vs2_0 = _mm_setzero_si128(); vs1_0 = vs1; - k = (len < max_iters ? (int)len : max_iters); + k = (len < max_iters ? len : max_iters); k -= k % 16; len -= k;