diff -upr zlib-1.2.7.orig/deflate.c zlib-1.2.7/deflate.c --- zlib-1.2.7.orig/deflate.c 2012-02-13 01:15:47.000000000 +0100 +++ zlib-1.2.7/deflate.c 2012-08-13 12:58:49.275911722 +0200 @@ -1143,15 +1143,16 @@ local void lm_init (s) /* For 80x86 and 680x0, an optimized version will be provided in match.asm or * match.S. The code will be functionally equivalent. */ -local uInt longest_match(s, cur_match) +local uInt longest_match(s, pcur_match) deflate_state *s; - IPos cur_match; /* current match */ + IPos pcur_match; /* current match */ { + uLong cur_match = pcur_match; /* extend to pointer width */ unsigned chain_length = s->max_chain_length;/* max hash chain length */ register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *match; /* matched string */ register int len; /* length of current match */ - int best_len = s->prev_length; /* best match length so far */ + uLong best_len = s->prev_length; /* best match length so far */ int nice_match = s->nice_match; /* stop if match long enough */ IPos limit = s->strstart > (IPos)MAX_DIST(s) ? s->strstart - (IPos)MAX_DIST(s) : NIL; @@ -1159,19 +1160,19 @@ local uInt longest_match(s, cur_match) * we prevent matches with the string of window index 0. */ Posf *prev = s->prev; - uInt wmask = s->w_mask; + uLong wmask = s->w_mask; #ifdef UNALIGNED_OK /* Compare two bytes at a time. Note: this is not always beneficial. * Try with and without -DUNALIGNED_OK to check. */ register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; - register ush scan_start = *(ushf*)scan; - register ush scan_end = *(ushf*)(scan+best_len-1); + register uInt scan_start = *(ushf*)scan; + register uInt scan_end = *(ushf*)(scan+best_len-1); #else register Bytef *strend = s->window + s->strstart + MAX_MATCH; - register Byte scan_end1 = scan[best_len-1]; - register Byte scan_end = scan[best_len]; + register uInt scan_end1 = scan[best_len-1]; + register uInt scan_end = scan[best_len]; #endif /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.