From 778d65f3b31509cf92d86458dda2eee83c4bf19e Mon Sep 17 00:00:00 2001 From: Nathan Moinvaziri Date: Thu, 1 Oct 2020 22:53:50 -0700 Subject: [PATCH] Fixed conversion warning when calling zng_tr_tally_dist. Signature for dist and len now match zng_emit_dist. deflate.c(1575,67): warning C4244: 'function': conversion from 'uint32_t' to 'unsigned char', possible loss of data deflate_fast.c(60,94): warning C4244: 'function': conversion from 'uint32_t' to 'unsigned char', possible loss of data deflate_medium.c(39,102): warning C4244: 'function': conversion from 'int' to 'unsigned char', possible loss of data deflate_slow.c(75,101): warning C4244: 'function': conversion from 'unsigned int' to 'unsigned char', possible loss of data --- deflate_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deflate_p.h b/deflate_p.h index 4c400035..9cec34dc 100644 --- a/deflate_p.h +++ b/deflate_p.h @@ -37,12 +37,12 @@ static inline int zng_tr_tally_lit(deflate_state *s, unsigned char c) { return (s->sym_next == s->sym_end); } -static inline int zng_tr_tally_dist(deflate_state *s, unsigned dist, unsigned char len) { +static inline int zng_tr_tally_dist(deflate_state *s, uint32_t dist, uint32_t len) { /* dist: distance of matched string */ /* len: match length-MIN_MATCH */ s->sym_buf[s->sym_next++] = (uint8_t)(dist); s->sym_buf[s->sym_next++] = (uint8_t)(dist >> 8); - s->sym_buf[s->sym_next++] = len; + s->sym_buf[s->sym_next++] = (uint8_t)len; s->matches++; dist--; Assert((uint16_t)dist < (uint16_t)MAX_DIST(s) && -- 2.47.2