From: Nathan Moinvaziri Date: Wed, 27 May 2020 00:19:17 +0000 (-0700) Subject: Fixed casting warnings in calls to put_short and put_short_msb. X-Git-Tag: 1.9.9-b1~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d420aa05d3ea52a30885db9013902644098c55ac;p=thirdparty%2Fzlib-ng.git Fixed casting warnings in calls to put_short and put_short_msb. deflate.c(845,32): warning C4244: 'function': conversion from 'unsigned int' to 'uint16_t', possible loss of data deflate.c(894,50): warning C4244: 'function': conversion from 'unsigned int' to 'uint16_t', possible loss of data --- diff --git a/deflate.c b/deflate.c index dbee56d0..5e31ad0b 100644 --- a/deflate.c +++ b/deflate.c @@ -842,7 +842,7 @@ int ZEXPORT PREFIX(deflate)(PREFIX3(stream) *strm, int flush) { if (s->strstart != 0) header |= PRESET_DICT; header += 31 - (header % 31); - put_short_msb(s, header); + put_short_msb(s, (uint16_t)header); /* Save the adler32 of the preset dictionary: */ if (s->strstart != 0) { @@ -891,7 +891,7 @@ int ZEXPORT PREFIX(deflate)(PREFIX3(stream) *strm, int flush) { (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2 ? 4 : 0)); put_byte(s, s->gzhead->os & 0xff); if (s->gzhead->extra != NULL) { - put_short(s, s->gzhead->extra_len); + put_short(s, (uint16_t)s->gzhead->extra_len); } if (s->gzhead->hcrc) strm->adler = PREFIX(crc32)(strm->adler, s->pending_buf, s->pending);