]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed a warning about a comparison of an unsigned with a signed type
authorAdam Stylinski <kungfujesus06@gmail.com>
Tue, 22 Mar 2022 23:39:41 +0000 (19:39 -0400)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Thu, 24 Mar 2022 10:18:52 +0000 (11:18 +0100)
arch/x86/adler32_ssse3.c

index 1767572a0471c0debceac53ac05839eff08b3ff5..5d28ac95fcd1913b061207ba10230e1c31715ea2 100644 (file)
@@ -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;