From: Mika Lindqvist Date: Mon, 13 Feb 2017 19:50:12 +0000 (+0200) Subject: Fix build with nmake. X-Git-Tag: 1.9.9-b1~684^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=174ee8972db99eb771902169ce6ee78b28c28810;p=thirdparty%2Fzlib-ng.git Fix build with nmake. --- diff --git a/gzread.c b/gzread.c index 0928310fe..50b924447 100644 --- a/gzread.c +++ b/gzread.c @@ -286,7 +286,7 @@ static size_t gz_read(gz_statep state, void *buf, size_t len) { /* set n to the maximum amount of len that fits in an unsigned int */ n = -1; if (n > len) - n = len; + n = (unsigned)len; /* first just try copying data from the output buffer */ if (state->x.have) { @@ -363,7 +363,7 @@ int ZEXPORT gzread(gzFile file, void *buf, unsigned len) { } /* read len or fewer bytes to buf */ - len = gz_read(state, buf, len); + len = (unsigned)gz_read(state, buf, len); /* check for an error */ if (len == 0 && state->err != Z_OK && state->err != Z_BUF_ERROR) @@ -423,7 +423,7 @@ int ZEXPORT gzgetc(gzFile file) { } /* nothing there -- try gz_read() */ - ret = gz_read(state, buf, 1); + ret = (int)gz_read(state, buf, 1); return ret < 1 ? -1 : buf[0]; } diff --git a/gzwrite.c b/gzwrite.c index 07417f41b..0ebc32f7b 100644 --- a/gzwrite.c +++ b/gzwrite.c @@ -187,7 +187,7 @@ static size_t gz_write(gz_statep state, void const *buf, size_t len) { state->in); copy = state->size - have; if (copy > len) - copy = len; + copy = (unsigned)len; memcpy(state->in + have, buf, copy); state->strm.avail_in += copy; state->x.pos += copy; @@ -206,7 +206,7 @@ static size_t gz_write(gz_statep state, void const *buf, size_t len) { do { unsigned n = (unsigned)-1; if (n > len) - n = len; + n = (unsigned)len; state->strm.avail_in = n; state->x.pos += n; if (gz_comp(state, Z_NO_FLUSH) == -1) @@ -330,7 +330,7 @@ int ZEXPORT gzputs(gzFile file, const char *str) { /* write string */ len = strlen(str); - ret = gz_write(state, str, len); + ret = (int)gz_write(state, str, len); return ret == 0 && len != 0 ? -1 : ret; } diff --git a/win32/zlib.def b/win32/zlib.def index a2188b000..67644205a 100644 --- a/win32/zlib.def +++ b/win32/zlib.def @@ -35,38 +35,7 @@ EXPORTS compressBound uncompress uncompress2 - gzopen - gzdopen - gzbuffer - gzsetparams - gzread - gzfread - gzwrite - gzfwrite - gzprintf - gzvprintf - gzputs - gzgets - gzputc - gzgetc - gzungetc - gzflush - gzseek - gzrewind - gztell - gzoffset - gzeof - gzdirect - gzclose - gzclose_r - gzclose_w - gzerror - gzclearerr ; large file functions - gzopen64 - gzseek64 - gztell64 - gzoffset64 adler32_combine64 crc32_combine64 ; checksum functions @@ -82,7 +51,6 @@ EXPORTS inflateInit_ inflateInit2_ inflateBackInit_ - gzgetc_ zError inflateSyncPoint get_crc_table @@ -91,4 +59,3 @@ EXPORTS inflateCodesUsed inflateResetKeep deflateResetKeep - gzopen_w diff --git a/win32/zlibcompat.def b/win32/zlibcompat.def index face65518..a2188b000 100644 --- a/win32/zlibcompat.def +++ b/win32/zlibcompat.def @@ -8,6 +8,7 @@ EXPORTS inflateEnd ; advanced functions deflateSetDictionary + deflateGetDictionary deflateCopy deflateReset deflateParams @@ -33,12 +34,15 @@ EXPORTS compress2 compressBound uncompress + uncompress2 gzopen gzdopen gzbuffer gzsetparams gzread + gzfread gzwrite + gzfwrite gzprintf gzvprintf gzputs @@ -67,7 +71,9 @@ EXPORTS crc32_combine64 ; checksum functions adler32 + adler32_z crc32 + crc32_z adler32_combine crc32_combine ; various hacks, don't look :) @@ -81,6 +87,8 @@ EXPORTS inflateSyncPoint get_crc_table inflateUndermine + inflateValidate + inflateCodesUsed inflateResetKeep deflateResetKeep gzopen_w