2017-05-11 09:48:12 +02:00
|
|
|
Index: deflate.c
|
|
|
|
===================================================================
|
|
|
|
--- deflate.c.orig
|
|
|
|
+++ deflate.c
|
2023-10-19 18:28:40 +02:00
|
|
|
@@ -1233,12 +1233,13 @@ local void lm_init (s)
|
2023-01-19 12:29:57 +01:00
|
|
|
* string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
|
|
|
|
* OUT assertion: the match length is not greater than s->lookahead.
|
2017-05-11 09:48:12 +02:00
|
|
|
*/
|
2023-10-19 18:28:40 +02:00
|
|
|
-local uInt longest_match(deflate_state *s, IPos cur_match) {
|
|
|
|
+local uInt longest_match(deflate_state *s, IPos pcur_match) {
|
2017-05-11 09:48:12 +02:00
|
|
|
+ ptrdiff_t cur_match = pcur_match; /* extend to pointer width */
|
|
|
|
unsigned chain_length = s->max_chain_length;/* max hash chain length */
|
|
|
|
register Bytef *scan = s->window + s->strstart; /* current string */
|
|
|
|
register Bytef *match; /* matched string */
|
|
|
|
register int len; /* length of current match */
|
|
|
|
- int best_len = (int)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 */
|
|
|
|
IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
|
|
|
|
s->strstart - (IPos)MAX_DIST(s) : NIL;
|
|
|
|
@@ -1256,12 +1257,12 @@ local uInt longest_match(s, cur_match)
|
|
|
|
* Try with and without -DUNALIGNED_OK to check.
|
|
|
|
*/
|
|
|
|
register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
|
|
|
|
- register ush scan_start = *(ushf*)scan;
|
2023-01-19 12:29:57 +01:00
|
|
|
- register ush scan_end = *(ushf*)(scan + best_len - 1);
|
2017-05-11 09:48:12 +02:00
|
|
|
+ register uInt scan_start = *(ushf*)scan;
|
2023-01-19 12:29:57 +01:00
|
|
|
+ register uInt scan_end = *(ushf*)(scan + best_len - 1);
|
2017-05-11 09:48:12 +02:00
|
|
|
#else
|
|
|
|
register Bytef *strend = s->window + s->strstart + MAX_MATCH;
|
2023-01-19 12:29:57 +01:00
|
|
|
- register Byte scan_end1 = scan[best_len - 1];
|
2017-05-11 09:48:12 +02:00
|
|
|
- register Byte scan_end = scan[best_len];
|
2023-01-19 12:29:57 +01:00
|
|
|
+ register uInt scan_end1 = scan[best_len - 1];
|
2017-05-11 09:48:12 +02:00
|
|
|
+ register uInt scan_end = scan[best_len];
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16.
|