3d479f
diff -upr zlib-1.2.7.orig/deflate.c zlib-1.2.7/deflate.c
3d479f
--- zlib-1.2.7.orig/deflate.c	2012-10-04 12:18:50.750427902 +0200
3d479f
+++ zlib-1.2.7/deflate.c	2012-10-04 12:20:04.222190460 +0200
3d479f
@@ -1150,15 +1150,16 @@ local void lm_init (s)
3d479f
 /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
3d479f
  * match.S. The code will be functionally equivalent.
3d479f
  */
3d479f
-local uInt longest_match(s, cur_match)
3d479f
+local uInt longest_match(s, pcur_match)
3d479f
     deflate_state *s;
3d479f
-    IPos cur_match;                             /* current match */
3d479f
+    IPos pcur_match;                             /* current match */
3d479f
 {
3d479f
+    ptrdiff_t cur_match = pcur_match; /* extend to pointer width */
3d479f
     unsigned chain_length = s->max_chain_length;/* max hash chain length */
3d479f
     register Bytef *scan = s->window + s->strstart; /* current string */
3d479f
     register Bytef *match;                       /* matched string */
3d479f
     register int len;                           /* length of current match */
3d479f
-    int best_len = s->prev_length;              /* best match length so far */
3d479f
+    ptrdiff_t best_len = s->prev_length;              /* best match length so far */
3d479f
     int nice_match = s->nice_match;             /* stop if match long enough */
3d479f
     IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
3d479f
         s->strstart - (IPos)MAX_DIST(s) : NIL;
3d479f
@@ -1173,12 +1174,12 @@ local uInt longest_match(s, cur_match)
3d479f
      * Try with and without -DUNALIGNED_OK to check.
3d479f
      */
3d479f
     register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
3d479f
-    register ush scan_start = *(ushf*)scan;
3d479f
-    register ush scan_end   = *(ushf*)(scan+best_len-1);
3d479f
+    register uInt scan_start = *(ushf*)scan;
3d479f
+    register uInt scan_end   = *(ushf*)(scan+best_len-1);
3d479f
 #else
3d479f
     register Bytef *strend = s->window + s->strstart + MAX_MATCH;
3d479f
-    register Byte scan_end1  = scan[best_len-1];
3d479f
-    register Byte scan_end   = scan[best_len];
3d479f
+    register uInt scan_end1  = scan[best_len-1];
3d479f
+    register uInt scan_end   = scan[best_len];
3d479f
 #endif
3d479f
 
3d479f
     /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.