From 434bedcda0a7edb4fcc2dda6eb3df0310c2d0774 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Tue, 15 Mar 2011 19:46:38 +0200 Subject: Fix compilation warnings in ZLib (MSVC) Yes, we are changing the Zlib code. This is dangerous and uncool. Fortunately, these are just some implicit casts. --- deps/zlib/deflate.h | 6 +++--- deps/zlib/trees.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'deps') diff --git a/deps/zlib/deflate.h b/deps/zlib/deflate.h index cbf0d1ea5..d7d26f8a9 100644 --- a/deps/zlib/deflate.h +++ b/deps/zlib/deflate.h @@ -317,15 +317,15 @@ void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, #endif # define _tr_tally_lit(s, c, flush) \ - { uch cc = (c); \ + { uch cc = (uch)(c); \ s->d_buf[s->last_lit] = 0; \ s->l_buf[s->last_lit++] = cc; \ s->dyn_ltree[cc].Freq++; \ flush = (s->last_lit == s->lit_bufsize-1); \ } # define _tr_tally_dist(s, distance, length, flush) \ - { uch len = (length); \ - ush dist = (distance); \ + { uch len = (uch)(length); \ + ush dist = (ush)(distance); \ s->d_buf[s->last_lit] = dist; \ s->l_buf[s->last_lit++] = len; \ dist--; \ diff --git a/deps/zlib/trees.c b/deps/zlib/trees.c index 56e9bb1c1..3e9a138c7 100644 --- a/deps/zlib/trees.c +++ b/deps/zlib/trees.c @@ -605,7 +605,7 @@ local void gen_codes (tree, max_code, bl_count) int len = tree[n].Len; if (len == 0) continue; /* Now reverse the bits */ - tree[n].Code = bi_reverse(next_code[len]++, len); + tree[n].Code = (ush)bi_reverse(next_code[len]++, len); Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ", n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1)); @@ -729,7 +729,7 @@ local void scan_tree (s, tree, 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++; -- cgit v1.2.1