Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Address C4244 warnings in MSVC build #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1553,10 +1553,10 @@ local block_state deflate_stored(s, 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);
Expand Down
4 changes: 2 additions & 2 deletions deflate_quick.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ local inline void quick_send_bits(deflate_state *z_const s, z_const int value,

b = w >> 3;
s->pending += b;
s->bi_buf = out >> (b << 3);
s->bi_buf = (ush)(out >> (b << 3));
s->bi_valid = w - (b << 3);
}

Expand Down Expand Up @@ -224,7 +224,7 @@ block_state deflate_quick(deflate_state *s, int flush)
}

if (s->lookahead >= MIN_MATCH) {
hash_head = quick_insert_string(s, s->strstart);
hash_head = quick_insert_string(s, (Pos)s->strstart);
dist = s->strstart - hash_head;

if ((dist-1) < (s->w_size - 1)) {
Expand Down
2 changes: 1 addition & 1 deletion slide_sse.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void slide_hash_sse(deflate_state *s)
unsigned n;
Posf *p;
uInt wsize = s->w_size;
z_const __m128i xmm_wsize = _mm_set1_epi16(s->w_size);
z_const __m128i xmm_wsize = _mm_set1_epi16((short)s->w_size);

n = s->hash_size;
p = &s->head[n] - 8;
Expand Down
2 changes: 1 addition & 1 deletion trees.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,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++;
Expand Down