adenilson / rpms / zlib

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