aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive/bz/compress.c
diff options
context:
space:
mode:
Diffstat (limited to 'archival/libarchive/bz/compress.c')
-rw-r--r--archival/libarchive/bz/compress.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/archival/libarchive/bz/compress.c b/archival/libarchive/bz/compress.c
index c640173e5..534cf665a 100644
--- a/archival/libarchive/bz/compress.c
+++ b/archival/libarchive/bz/compress.c
@@ -50,8 +50,7 @@ static NOINLINE
50void bsFinishWrite(EState* s) 50void bsFinishWrite(EState* s)
51{ 51{
52 while (s->bsLive > 0) { 52 while (s->bsLive > 0) {
53 s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); 53 *s->posZ++ = (uint8_t)(s->bsBuff >> 24);
54 s->numZ++;
55 s->bsBuff <<= 8; 54 s->bsBuff <<= 8;
56 s->bsLive -= 8; 55 s->bsLive -= 8;
57 } 56 }
@@ -67,8 +66,7 @@ ALWAYS_INLINE
67void bsW(EState* s, int32_t n, uint32_t v) 66void bsW(EState* s, int32_t n, uint32_t v)
68{ 67{
69 while (s->bsLive >= 8) { 68 while (s->bsLive >= 8) {
70 s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); 69 *s->posZ++ = (uint8_t)(s->bsBuff >> 24);
71 s->numZ++;
72 s->bsBuff <<= 8; 70 s->bsBuff <<= 8;
73 s->bsLive -= 8; 71 s->bsLive -= 8;
74 } 72 }
@@ -83,8 +81,7 @@ ALWAYS_INLINE
83void bsW16(EState* s, uint32_t v) 81void bsW16(EState* s, uint32_t v)
84{ 82{
85 while (s->bsLive >= 8) { 83 while (s->bsLive >= 8) {
86 s->zbits[s->numZ] = (uint8_t)(s->bsBuff >> 24); 84 *s->posZ++ = (uint8_t)(s->bsBuff >> 24);
87 s->numZ++;
88 s->bsBuff <<= 8; 85 s->bsBuff <<= 8;
89 s->bsLive -= 8; 86 s->bsLive -= 8;
90 } 87 }
@@ -624,12 +621,14 @@ void BZ2_compressBlock(EState* s, int is_last_block)
624 s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31); 621 s->combinedCRC = (s->combinedCRC << 1) | (s->combinedCRC >> 31);
625 s->combinedCRC ^= s->blockCRC; 622 s->combinedCRC ^= s->blockCRC;
626 if (s->blockNo > 1) 623 if (s->blockNo > 1)
627 s->numZ = 0; 624 s->posZ = s->zbits; // was: s->numZ = 0;
628 625
629 BZ2_blockSort(s); 626 BZ2_blockSort(s);
630 } 627 }
631 628
632 s->zbits = &((uint8_t*)s->arr2)[s->nblock]; 629 s->zbits = &((uint8_t*)s->arr2)[s->nblock];
630 s->posZ = s->zbits;
631 s->state_out_pos = s->zbits;
633 632
634 /*-- If this is the first block, create the stream header. --*/ 633 /*-- If this is the first block, create the stream header. --*/
635 if (s->blockNo == 1) { 634 if (s->blockNo == 1) {