arrfab / rpms / zlib

Forked from rpms/zlib 5 years ago
Clone

Blame SOURCES/zlib-1.2.7-optimized-s390.patch

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