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