diff options
Diffstat (limited to 'deflate.c')
-rw-r--r-- | deflate.c | 24 |
1 files changed, 12 insertions, 12 deletions
@@ -84,7 +84,7 @@ local block_state deflate_huff OF((deflate_state *s, int flush)); | |||
84 | local void lm_init OF((deflate_state *s)); | 84 | local void lm_init OF((deflate_state *s)); |
85 | local void putShortMSB OF((deflate_state *s, uInt b)); | 85 | local void putShortMSB OF((deflate_state *s, uInt b)); |
86 | local void flush_pending OF((z_streamp strm)); | 86 | local void flush_pending OF((z_streamp strm)); |
87 | local int read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); | 87 | local unsigned read_buf OF((z_streamp strm, Bytef *buf, unsigned size)); |
88 | #ifdef ASMV | 88 | #ifdef ASMV |
89 | void match_init OF((void)); /* asm code initialization */ | 89 | void match_init OF((void)); /* asm code initialization */ |
90 | uInt longest_match OF((deflate_state *s, IPos cur_match)); | 90 | uInt longest_match OF((deflate_state *s, IPos cur_match)); |
@@ -277,11 +277,11 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy, | |||
277 | 277 | ||
278 | s->wrap = wrap; | 278 | s->wrap = wrap; |
279 | s->gzhead = Z_NULL; | 279 | s->gzhead = Z_NULL; |
280 | s->w_bits = windowBits; | 280 | s->w_bits = (uInt)windowBits; |
281 | s->w_size = 1 << s->w_bits; | 281 | s->w_size = 1 << s->w_bits; |
282 | s->w_mask = s->w_size - 1; | 282 | s->w_mask = s->w_size - 1; |
283 | 283 | ||
284 | s->hash_bits = memLevel + 7; | 284 | s->hash_bits = (uInt)memLevel + 7; |
285 | s->hash_size = 1 << s->hash_bits; | 285 | s->hash_size = 1 << s->hash_bits; |
286 | s->hash_mask = s->hash_size - 1; | 286 | s->hash_mask = s->hash_size - 1; |
287 | s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); | 287 | s->hash_shift = ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH); |
@@ -534,10 +534,10 @@ int ZEXPORT deflateTune(strm, good_length, max_lazy, nice_length, max_chain) | |||
534 | 534 | ||
535 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; | 535 | if (strm == Z_NULL || strm->state == Z_NULL) return Z_STREAM_ERROR; |
536 | s = strm->state; | 536 | s = strm->state; |
537 | s->good_match = good_length; | 537 | s->good_match = (uInt)good_length; |
538 | s->max_lazy_match = max_lazy; | 538 | s->max_lazy_match = (uInt)max_lazy; |
539 | s->nice_match = nice_length; | 539 | s->nice_match = nice_length; |
540 | s->max_chain_length = max_chain; | 540 | s->max_chain_length = (uInt)max_chain; |
541 | return Z_OK; | 541 | return Z_OK; |
542 | } | 542 | } |
543 | 543 | ||
@@ -1068,7 +1068,7 @@ int ZEXPORT deflateCopy (dest, source) | |||
1068 | * allocating a large strm->next_in buffer and copying from it. | 1068 | * allocating a large strm->next_in buffer and copying from it. |
1069 | * (See also flush_pending()). | 1069 | * (See also flush_pending()). |
1070 | */ | 1070 | */ |
1071 | local int read_buf(strm, buf, size) | 1071 | local unsigned read_buf(strm, buf, size) |
1072 | z_streamp strm; | 1072 | z_streamp strm; |
1073 | Bytef *buf; | 1073 | Bytef *buf; |
1074 | unsigned size; | 1074 | unsigned size; |
@@ -1092,7 +1092,7 @@ local int read_buf(strm, buf, size) | |||
1092 | strm->next_in += len; | 1092 | strm->next_in += len; |
1093 | strm->total_in += len; | 1093 | strm->total_in += len; |
1094 | 1094 | ||
1095 | return (int)len; | 1095 | return len; |
1096 | } | 1096 | } |
1097 | 1097 | ||
1098 | /* =========================================================================== | 1098 | /* =========================================================================== |
@@ -1148,7 +1148,7 @@ local uInt longest_match(s, cur_match) | |||
1148 | register Bytef *scan = s->window + s->strstart; /* current string */ | 1148 | register Bytef *scan = s->window + s->strstart; /* current string */ |
1149 | register Bytef *match; /* matched string */ | 1149 | register Bytef *match; /* matched string */ |
1150 | register int len; /* length of current match */ | 1150 | register int len; /* length of current match */ |
1151 | int best_len = s->prev_length; /* best match length so far */ | 1151 | int best_len = (int)s->prev_length; /* best match length so far */ |
1152 | int nice_match = s->nice_match; /* stop if match long enough */ | 1152 | int nice_match = s->nice_match; /* stop if match long enough */ |
1153 | IPos limit = s->strstart > (IPos)MAX_DIST(s) ? | 1153 | IPos limit = s->strstart > (IPos)MAX_DIST(s) ? |
1154 | s->strstart - (IPos)MAX_DIST(s) : NIL; | 1154 | s->strstart - (IPos)MAX_DIST(s) : NIL; |
@@ -1183,7 +1183,7 @@ local uInt longest_match(s, cur_match) | |||
1183 | /* Do not look for matches beyond the end of the input. This is necessary | 1183 | /* Do not look for matches beyond the end of the input. This is necessary |
1184 | * to make deflate deterministic. | 1184 | * to make deflate deterministic. |
1185 | */ | 1185 | */ |
1186 | if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead; | 1186 | if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead; |
1187 | 1187 | ||
1188 | Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); | 1188 | Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead"); |
1189 | 1189 | ||
@@ -1589,7 +1589,7 @@ local block_state deflate_stored(s, flush) | |||
1589 | s->lookahead = 0; | 1589 | s->lookahead = 0; |
1590 | 1590 | ||
1591 | /* Emit a stored block if pending_buf will be full: */ | 1591 | /* Emit a stored block if pending_buf will be full: */ |
1592 | max_start = s->block_start + max_block_size; | 1592 | max_start = max_block_size + (ulg)s->block_start; |
1593 | if (s->strstart == 0 || (ulg)s->strstart >= max_start) { | 1593 | if (s->strstart == 0 || (ulg)s->strstart >= max_start) { |
1594 | /* strstart == 0 is possible when wraparound on 16-bit machine */ | 1594 | /* strstart == 0 is possible when wraparound on 16-bit machine */ |
1595 | s->lookahead = (uInt)(s->strstart - max_start); | 1595 | s->lookahead = (uInt)(s->strstart - max_start); |
@@ -1887,7 +1887,7 @@ local block_state deflate_rle(s, flush) | |||
1887 | prev == *++scan && prev == *++scan && | 1887 | prev == *++scan && prev == *++scan && |
1888 | prev == *++scan && prev == *++scan && | 1888 | prev == *++scan && prev == *++scan && |
1889 | scan < strend); | 1889 | scan < strend); |
1890 | s->match_length = MAX_MATCH - (int)(strend - scan); | 1890 | s->match_length = MAX_MATCH - (uInt)(strend - scan); |
1891 | if (s->match_length > s->lookahead) | 1891 | if (s->match_length > s->lookahead) |
1892 | s->match_length = s->lookahead; | 1892 | s->match_length = s->lookahead; |
1893 | } | 1893 | } |