]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed match_byte casting warning in compare256_unaligned_64_static.
authorNathan Moinvaziri <nathan@nathanm.com>
Mon, 14 Sep 2020 05:12:40 +0000 (22:12 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Wed, 16 Sep 2020 07:10:48 +0000 (09:10 +0200)
  compare258.c(158,36): warning C4244: 'return': conversion from 'uint64_t' to 'uint32_t', possible loss of data

compare258.c

index ab8c29abee484d057ed7728ae98eed83cf93a24a..bc41638ae861e92a80437558c24e0c773ce2f578 100644 (file)
@@ -155,7 +155,7 @@ static inline uint32_t compare256_unaligned_64_static(const unsigned char *src0,
 
         if (diff) {
             uint64_t match_byte = __builtin_ctzll(diff) / 8;
-            return len + match_byte;
+            return len + (uint32_t)match_byte;
         }
 
         src0 += 8, src1 += 8, len += 8;