From 3a900fe47b95c44a1c8a1812ebfdb623d828d1a9 Mon Sep 17 00:00:00 2001 From: Adam Stylinski Date: Tue, 22 Mar 2022 19:39:41 -0400 Subject: [PATCH] Fixed a warning about a comparison of an unsigned with a signed type --- arch/x86/adler32_ssse3.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/adler32_ssse3.c b/arch/x86/adler32_ssse3.c index 1767572a..5d28ac95 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; -- 2.47.2