2022-10-17 14:31:23 +00:00
|
|
|
--- zlib-1.2.13/deflate.c.old 2022-11-24 16:41:34.527200490 +0000
|
|
|
|
+++ zlib-1.2.13/deflate.c 2022-11-24 16:43:28.064200490 +0000
|
|
|
|
@@ -1305,15 +1305,16 @@ local void lm_init(s)
|
|
|
|
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
|
|
|
|
* OUT assertion: the match length is not greater than s->lookahead.
|
|
|
|
*/
|
2012-08-13 11:34:16 +00:00
|
|
|
-local uInt longest_match(s, cur_match)
|
|
|
|
+local uInt longest_match(s, pcur_match)
|
|
|
|
deflate_state *s;
|
|
|
|
- IPos cur_match; /* current match */
|
|
|
|
+ IPos pcur_match; /* current match */
|
|
|
|
{
|
2012-10-04 12:39:29 +00:00
|
|
|
+ ptrdiff_t cur_match = pcur_match; /* extend to pointer width */
|
2012-08-13 11:34:16 +00:00
|
|
|
unsigned chain_length = s->max_chain_length;/* max hash chain length */
|
|
|
|
register Bytef *scan = s->window + s->strstart; /* current string */
|
2017-02-09 14:01:10 +00:00
|
|
|
register Bytef *match; /* matched string */
|
2012-08-13 11:34:16 +00:00
|
|
|
register int len; /* length of current match */
|
2017-02-09 14:01:10 +00:00
|
|
|
- int best_len = (int)s->prev_length; /* best match length so far */
|
2012-10-04 12:39:29 +00:00
|
|
|
+ ptrdiff_t best_len = s->prev_length; /* best match length so far */
|
2012-08-13 11:34:16 +00:00
|
|
|
int nice_match = s->nice_match; /* stop if match long enough */
|
|
|
|
IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
|
|
|
|
s->strstart - (IPos)MAX_DIST(s) : NIL;
|
2022-10-17 14:31:23 +00:00
|
|
|
@@ -1328,12 +1329,12 @@ local uInt longest_match(s, cur_match)
|
2012-08-13 11:34:16 +00:00
|
|
|
* Try with and without -DUNALIGNED_OK to check.
|
|
|
|
*/
|
|
|
|
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
|
|
|
|
- register ush scan_start = *(ushf*)scan;
|
2022-10-17 14:31:23 +00:00
|
|
|
- register ush scan_end = *(ushf*)(scan + best_len - 1);
|
2012-08-13 11:34:16 +00:00
|
|
|
+ register uInt scan_start = *(ushf*)scan;
|
|
|
|
+ register uInt scan_end = *(ushf*)(scan+best_len-1);
|
|
|
|
#else
|
|
|
|
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
|
2022-10-17 14:31:23 +00:00
|
|
|
- register Byte scan_end1 = scan[best_len - 1];
|
2012-08-13 11:34:16 +00:00
|
|
|
- register Byte scan_end = scan[best_len];
|
|
|
|
+ register uInt scan_end1 = scan[best_len-1];
|
|
|
|
+ register uInt scan_end = scan[best_len];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
|