From: Nathan Moinvaziri Date: Tue, 4 Jun 2019 08:50:22 +0000 (-0700) Subject: Fixed compiler warnings on Windows in release mode (#349) X-Git-Tag: 1.9.9-b1~481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d229a141cc32318897816096a22d24ea1ac166cd;p=thirdparty%2Fzlib-ng.git Fixed compiler warnings on Windows in release mode (#349) This pull request attempts to fix some compiler warnings on Windows when compiled in Release mode. ``` "zlib-ng\ALL_BUILD.vcxproj" (default target) (1) -> "zlib-ng\zlibstatic.vcxproj" (default target) (6) -> zlib-ng\deflate.c(1626): warning C4244: '=': conversion from 'uint16_t' to 'unsigned cha r', possible loss of data [zlib-ng\zlibstatic.vcxproj] zlib-ng\deflate_fast.c(61): warning C4244: '=': conversion from 'uint16_t' to 'unsigned char', possible loss of data [zlib-ng\zlibstatic.vcxproj] zlib-ng\deflate_slow.c(89): warning C4244: '=': conversion from 'uint16_t' to 'unsigned char', possible loss of data [zlib-ng\zlibstatic.vcxproj] ``` --- diff --git a/deflate.h b/deflate.h index 76b7f3bc..bbe8f6b0 100644 --- a/deflate.h +++ b/deflate.h @@ -378,7 +378,7 @@ void ZLIB_INTERNAL flush_pending(PREFIX3(streamp) strm); #else # define _tr_tally_lit(s, c, flush) flush = _tr_tally(s, 0, c) # define _tr_tally_dist(s, distance, length, flush) \ - flush = _tr_tally(s, distance, length) + flush = _tr_tally(s, (unsigned)(distance), (unsigned)(length)) #endif /* ===========================================================================