]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed compiler warnings on Windows in release mode (#349)
authorNathan Moinvaziri <nathan@solidstatenetworks.com>
Tue, 4 Jun 2019 08:50:22 +0000 (01:50 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Tue, 4 Jun 2019 08:50:22 +0000 (10:50 +0200)
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]
```

deflate.h

index 76b7f3bcf4217daff6ec0d8ac7311d27dd21e9d5..bbe8f6b07ea937b1940330506abe1d0814c5cba2 100644 (file)
--- 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
 
 /* ===========================================================================