From: Nathan Moinvaziri Date: Sat, 4 Jul 2020 03:28:33 +0000 (-0700) Subject: Fixed conversion from unsigned int to short warning in slide_hash_sse2 and slide_hash... X-Git-Tag: 1.9.9-b1~116 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62e2fb1b64752702c65f6714bd70cbad4470dde7;p=thirdparty%2Fzlib-ng.git Fixed conversion from unsigned int to short warning in slide_hash_sse2 and slide_hash_avx2. slide_sse.c(20,51): warning C4244: 'function': conversion from 'unsigned int' to 'short', possible loss of data slide_avx.c(21,54): warning C4244: 'function': conversion from 'unsigned int' to 'short', possible loss of data --- diff --git a/arch/x86/slide_avx.c b/arch/x86/slide_avx.c index 3157ceeb..7ed7c029 100644 --- a/arch/x86/slide_avx.c +++ b/arch/x86/slide_avx.c @@ -18,7 +18,7 @@ ZLIB_INTERNAL void slide_hash_avx2(deflate_state *s) { Pos *p; unsigned n; unsigned wsize = s->w_size; - const __m256i zmm_wsize = _mm256_set1_epi16(wsize); + const __m256i zmm_wsize = _mm256_set1_epi16((uint16_t)wsize); n = s->hash_size; p = &s->head[n] - 16; diff --git a/arch/x86/slide_sse.c b/arch/x86/slide_sse.c index c7d3b124..f012e04f 100644 --- a/arch/x86/slide_sse.c +++ b/arch/x86/slide_sse.c @@ -17,7 +17,7 @@ ZLIB_INTERNAL void slide_hash_sse2(deflate_state *s) { Pos *p; unsigned n; unsigned wsize = s->w_size; - const __m128i xmm_wsize = _mm_set1_epi16(wsize); + const __m128i xmm_wsize = _mm_set1_epi16((uint16_t)wsize); n = s->hash_size; p = &s->head[n] - 8;