Skip to content

Commit 6ccbb8d

Browse files
committed
Remove lzxd_stream.intel_curpos, just use offset
1 parent 3e0fcb6 commit 6ccbb8d

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

libmspack/mspack/lzx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ struct lzxd_stream {
6767
unsigned int block_remaining; /* uncompressed bytes still left to decode */
6868

6969
signed int intel_filesize; /* magic header value used for transform */
70-
signed int intel_curpos; /* current offset in transform space */
7170

7271
unsigned char intel_started; /* has intel E8 decoding started? */
7372
unsigned char block_type; /* type of the current block */

libmspack/mspack/lzxd.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,6 @@ struct lzxd_stream *lzxd_init(struct mspack_system *system,
339339
lzx->frame = 0;
340340
lzx->reset_interval = reset_interval;
341341
lzx->intel_filesize = 0;
342-
lzx->intel_curpos = 0;
343342
lzx->intel_started = 0;
344343
lzx->error = MSPACK_ERR_OK;
345344
lzx->num_offsets = position_slots[window_bits - 15] << 3;
@@ -831,7 +830,7 @@ int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) {
831830
{
832831
unsigned char *data = &lzx->e8_buf[0];
833832
unsigned char *dataend = &lzx->e8_buf[frame_size - 10];
834-
signed int curpos = lzx->intel_curpos;
833+
signed int curpos = (int) lzx->offset;
835834
signed int filesize = lzx->intel_filesize;
836835
signed int abs_off, rel_off;
837836

@@ -852,11 +851,9 @@ int lzxd_decompress(struct lzxd_stream *lzx, off_t out_bytes) {
852851
data += 4;
853852
curpos += 5;
854853
}
855-
lzx->intel_curpos += frame_size;
856854
}
857855
else {
858856
lzx->o_ptr = &lzx->window[lzx->frame_posn];
859-
if (lzx->intel_filesize) lzx->intel_curpos += frame_size;
860857
}
861858
lzx->o_end = &lzx->o_ptr[frame_size];
862859

0 commit comments

Comments
 (0)