summaryrefslogtreecommitdiff
path: root/deflate.c
diff options
context:
space:
mode:
Diffstat (limited to 'deflate.c')
-rw-r--r--deflate.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/deflate.c b/deflate.c
index 70095e6..c531856 100644
--- a/deflate.c
+++ b/deflate.c
@@ -524,8 +524,8 @@ local int longest_match(s, cur_match)
524 * Try with and without -DUNALIGNED_OK to check. 524 * Try with and without -DUNALIGNED_OK to check.
525 */ 525 */
526 register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1; 526 register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
527 register ush scan_start = *(ush*)scan; 527 register ush scan_start = *(ushf*)scan;
528 register ush scan_end = *(ush*)(scan+best_len-1); 528 register ush scan_end = *(ushf*)(scan+best_len-1);
529#else 529#else
530 register Bytef *strend = s->window + s->strstart + MAX_MATCH; 530 register Bytef *strend = s->window + s->strstart + MAX_MATCH;
531 register Byte scan_end1 = scan[best_len-1]; 531 register Byte scan_end1 = scan[best_len-1];
@@ -554,8 +554,8 @@ local int longest_match(s, cur_match)
554 /* This code assumes sizeof(unsigned short) == 2. Do not use 554 /* This code assumes sizeof(unsigned short) == 2. Do not use
555 * UNALIGNED_OK if your compiler uses a different size. 555 * UNALIGNED_OK if your compiler uses a different size.
556 */ 556 */
557 if (*(ush*)(match+best_len-1) != scan_end || 557 if (*(ushf*)(match+best_len-1) != scan_end ||
558 *(ush*)match != scan_start) continue; 558 *(ushf*)match != scan_start) continue;
559 559
560 /* It is not necessary to compare scan[2] and match[2] since they are 560 /* It is not necessary to compare scan[2] and match[2] since they are
561 * always equal when the other bytes match, given that the hash keys 561 * always equal when the other bytes match, given that the hash keys
@@ -569,10 +569,10 @@ local int longest_match(s, cur_match)
569 Assert(scan[2] == match[2], "scan[2]?"); 569 Assert(scan[2] == match[2], "scan[2]?");
570 scan++, match++; 570 scan++, match++;
571 do { 571 do {
572 } while (*(ush*)(scan+=2) == *(ush*)(match+=2) && 572 } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
573 *(ush*)(scan+=2) == *(ush*)(match+=2) && 573 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
574 *(ush*)(scan+=2) == *(ush*)(match+=2) && 574 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
575 *(ush*)(scan+=2) == *(ush*)(match+=2) && 575 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
576 scan < strend); 576 scan < strend);
577 /* The funny "do {}" generates better code on most compilers */ 577 /* The funny "do {}" generates better code on most compilers */
578 578
@@ -621,7 +621,7 @@ local int longest_match(s, cur_match)
621 best_len = len; 621 best_len = len;
622 if (len >= s->nice_match) break; 622 if (len >= s->nice_match) break;
623#ifdef UNALIGNED_OK 623#ifdef UNALIGNED_OK
624 scan_end = *(ush*)(scan+best_len-1); 624 scan_end = *(ushf*)(scan+best_len-1);
625#else 625#else
626 scan_end1 = scan[best_len-1]; 626 scan_end1 = scan[best_len-1];
627 scan_end = scan[best_len]; 627 scan_end = scan[best_len];