From 8a76f02e0e05860f72a269d305a0e11af224f609 Mon Sep 17 00:00:00 2001 From: Levi Broderick Date: Wed, 30 Aug 2023 10:50:57 -0700 Subject: [PATCH] Avoid implicit conversion warnings in deflate.c and trees.c. --- deflate.c | 8 ++++---- trees.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/deflate.c b/deflate.c index edea7e5..4b804e6 100644 --- a/deflate.c +++ b/deflate.c @@ -1671,10 +1671,10 @@ local block_state deflate_stored(deflate_state *s, int flush) { _tr_stored_block(s, (char *)0, 0L, last); /* Replace the lengths in the dummy stored block with len. */ - s->pending_buf[s->pending - 4] = len; - s->pending_buf[s->pending - 3] = len >> 8; - s->pending_buf[s->pending - 2] = ~len; - s->pending_buf[s->pending - 1] = ~len >> 8; + s->pending_buf[s->pending - 4] = (Bytef)len; + s->pending_buf[s->pending - 3] = (Bytef)(len >> 8); + s->pending_buf[s->pending - 2] = (Bytef)~len; + s->pending_buf[s->pending - 1] = (Bytef)(~len >> 8); /* Write the stored block header bytes. */ flush_pending(s->strm); diff --git a/trees.c b/trees.c index 6a523ef..979ae41 100644 --- a/trees.c +++ b/trees.c @@ -724,7 +724,7 @@ local void scan_tree(deflate_state *s, ct_data *tree, int max_code) { if (++count < max_count && curlen == nextlen) { continue; } else if (count < min_count) { - s->bl_tree[curlen].Freq += count; + s->bl_tree[curlen].Freq += (ush)count; } else if (curlen != 0) { if (curlen != prevlen) s->bl_tree[curlen].Freq++; s->bl_tree[REP_3_6].Freq++;