- updated patch optimizing deflate on s390(x) architectures

This commit is contained in:
Peter Schiffer 2012-10-04 14:39:29 +02:00
parent 4ee54807a9
commit 4cde8d52f1
2 changed files with 10 additions and 15 deletions

View File

@ -1,7 +1,7 @@
diff -upr zlib-1.2.7.orig/deflate.c zlib-1.2.7/deflate.c 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.orig/deflate.c 2012-10-04 12:18:50.750427902 +0200
+++ zlib-1.2.7/deflate.c 2012-08-13 12:58:49.275911722 +0200 +++ zlib-1.2.7/deflate.c 2012-10-04 12:20:04.222190460 +0200
@@ -1143,15 +1143,16 @@ local void lm_init (s) @@ -1150,15 +1150,16 @@ local void lm_init (s)
/* For 80x86 and 680x0, an optimized version will be provided in match.asm or /* For 80x86 and 680x0, an optimized version will be provided in match.asm or
* match.S. The code will be functionally equivalent. * match.S. The code will be functionally equivalent.
*/ */
@ -11,25 +11,17 @@ diff -upr zlib-1.2.7.orig/deflate.c zlib-1.2.7/deflate.c
- IPos cur_match; /* current match */ - IPos cur_match; /* current match */
+ IPos pcur_match; /* current match */ + IPos pcur_match; /* current match */
{ {
+ uLong cur_match = pcur_match; /* extend to pointer width */ + ptrdiff_t cur_match = pcur_match; /* extend to pointer width */
unsigned chain_length = s->max_chain_length;/* max hash chain length */ unsigned chain_length = s->max_chain_length;/* max hash chain length */
register Bytef *scan = s->window + s->strstart; /* current string */ register Bytef *scan = s->window + s->strstart; /* current string */
register Bytef *match; /* matched string */ register Bytef *match; /* matched string */
register int len; /* length of current match */ register int len; /* length of current match */
- int best_len = s->prev_length; /* best match length so far */ - int best_len = s->prev_length; /* best match length so far */
+ uLong best_len = s->prev_length; /* best match length so far */ + ptrdiff_t best_len = s->prev_length; /* best match length so far */
int nice_match = s->nice_match; /* stop if match long enough */ int nice_match = s->nice_match; /* stop if match long enough */
IPos limit = s->strstart > (IPos)MAX_DIST(s) ? IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
s->strstart - (IPos)MAX_DIST(s) : NIL; s->strstart - (IPos)MAX_DIST(s) : NIL;
@@ -1159,19 +1160,19 @@ local uInt longest_match(s, cur_match) @@ -1173,12 +1174,12 @@ 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. * Try with and without -DUNALIGNED_OK to check.
*/ */
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;

View File

@ -1,7 +1,7 @@
Summary: The compression and decompression library Summary: The compression and decompression library
Name: zlib Name: zlib
Version: 1.2.7 Version: 1.2.7
Release: 8%{?dist} Release: 9%{?dist}
# /contrib/dotzlib/ have Boost license # /contrib/dotzlib/ have Boost license
License: zlib and Boost License: zlib and Boost
Group: System Environment/Libraries Group: System Environment/Libraries
@ -126,6 +126,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
%{_libdir}/pkgconfig/minizip.pc %{_libdir}/pkgconfig/minizip.pc
%changelog %changelog
* Thu Oct 4 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-9
- updated patch optimizing deflate on s390(x) architectures
* Wed Aug 29 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-8 * Wed Aug 29 2012 Peter Schiffer <pschiffe@redhat.com> - 1.2.7-8
- related: #832545 - related: #832545
reverted changes for this bug, static libraries shouldn't be compiled with reverted changes for this bug, static libraries shouldn't be compiled with