summaryrefslogtreecommitdiff
path: root/deflate_p.h
diff options
context:
space:
mode:
authorNathan Moinvaziri <nathan@nathanm.com>2020-05-25 15:26:37 -0700
committerHans Kristian Rosbach <hk-github@circlestorm.org>2020-05-30 21:25:18 +0200
commitd569bfe23acf2983c6e97aea89e3db5954c33e96 (patch)
treebe3053afdf540eb65ff0c00676ed72249eec4e43 /deflate_p.h
parent870416ca986218ebeb323c196f2af689c9502a8f (diff)
Fixed dist casting warnings in zng_tr_tally_dist.
deflate_p.h(42,37): warning C4244: '=': conversion from 'unsigned int' to 'unsigned char', possible loss of data deflate_p.h(43,42): warning C4244: '=': conversion from 'unsigned int' to 'unsigned char', possible loss of data
Diffstat (limited to 'deflate_p.h')
-rw-r--r--deflate_p.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/deflate_p.h b/deflate_p.h
index b519d45..6983902 100644
--- a/deflate_p.h
+++ b/deflate_p.h
@@ -39,8 +39,8 @@ static inline int zng_tr_tally_lit(deflate_state *s, unsigned char c) {
static inline int zng_tr_tally_dist(deflate_state *s, unsigned dist, unsigned char len) {
/* dist: distance of matched string */
/* len: match length-MIN_MATCH */
- s->sym_buf[s->sym_next++] = dist;
- s->sym_buf[s->sym_next++] = dist >> 8;
+ 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->matches++;
dist--;