]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed casting warnings
authorPavel P <pavlov.pavel@gmail.com>
Sat, 25 Apr 2020 11:24:12 +0000 (17:24 +0600)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sat, 20 Jun 2020 07:11:11 +0000 (09:11 +0200)
deflate.c
gzlib.c

index 9494c9573ec55c98e3703af8b0c4ccfcd547e287..1d1cf5bc92ad7b0508a700e0c7b40d08a7f9f9c8 100644 (file)
--- a/deflate.c
+++ b/deflate.c
@@ -1058,7 +1058,7 @@ int32_t ZEXPORT PREFIX(deflate)(PREFIX3(stream) *strm, int32_t flush) {
         crc_finalize(s);
 #  endif
         put_uint32(s, strm->adler);
-        put_uint32(s, strm->total_in);
+        put_uint32(s, (uint32_t)strm->total_in);
     } else
 #endif
     {
diff --git a/gzlib.c b/gzlib.c
index 2443965431fcfbc5a67635d4084a738a50d2c836..cef3606f0cba4c6308f08893bf11a8ecca51a125 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -136,7 +136,7 @@ static gzFile gz_open(const void *path, int fd, const char *mode) {
     /* save the path name for error messages */
 #ifdef WIDECHAR
     if (fd == -2) {
-        len = wcstombs(NULL, path, 0);
+        len = wcstombs(NULL, (const wchar_t *)path, 0);
         if (len == (size_t)-1)
             len = 0;
     } else
@@ -150,7 +150,7 @@ static gzFile gz_open(const void *path, int fd, const char *mode) {
 #ifdef WIDECHAR
     if (fd == -2)
         if (len) {
-            wcstombs(state->path, path, len + 1);
+            wcstombs(state->path, (const wchar_t *)path, len + 1);
         } else {
             *(state->path) = 0;
         }
@@ -182,7 +182,7 @@ static gzFile gz_open(const void *path, int fd, const char *mode) {
     /* open the file with the appropriate flags (or just use fd) */
     state->fd = fd > -1 ? fd : (
 #if defined(_WIN32)
-        fd == -2 ? _wopen(path, oflag, 0666) :
+        fd == -2 ? _wopen((const wchar_t *)path, oflag, 0666) :
 #elif __CYGWIN__
         fd == -2 ? open(state->path, oflag, 0666) :
 #endif