diff options
author | Nathan Moinvaziri <nathan@nathanm.com> | 2020-10-01 22:53:50 -0700 |
---|---|---|
committer | Hans Kristian Rosbach <hk-github@circlestorm.org> | 2020-11-02 17:01:58 +0100 |
commit | 778d65f3b31509cf92d86458dda2eee83c4bf19e (patch) | |
tree | f7a9d491f7999674eaa1b2f53d45b32373757158 /deflate_p.h | |
parent | 020b5be33e379c16ee6f42733b8f3a0ea93ec3ff (diff) |
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
Diffstat (limited to 'deflate_p.h')
-rw-r--r-- | deflate_p.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/deflate_p.h b/deflate_p.h index 4c40003..9cec34d 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) && |