summaryrefslogtreecommitdiffstats
path: root/decoder.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:41:41 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:41:41 +0000
commit9317e4b89644635a9ce309c4626d917d886ae20b (patch)
tree768c1cbb87e5c29ddcfcf2853ff1d5ce5b511e6b /decoder.h
parentAdding debian version 1.14-1. (diff)
downloadlziprecover-9317e4b89644635a9ce309c4626d917d886ae20b.tar.xz
lziprecover-9317e4b89644635a9ce309c4626d917d886ae20b.zip
Merging upstream version 1.15~pre1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.h')
-rw-r--r--decoder.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/decoder.h b/decoder.h
index a153bcb..0c4697b 100644
--- a/decoder.h
+++ b/decoder.h
@@ -176,11 +176,11 @@ public:
match_byte <<= 1;
const int match_bit = match_byte & 0x100;
const int bit = decode_bit( bm1[match_bit+symbol] );
- symbol = ( symbol << 1 ) + bit;
+ symbol = ( symbol << 1 ) | bit;
if( match_bit != bit << 8 )
{
while( symbol < 0x100 )
- symbol = ( symbol << 1 ) + decode_bit( bm[symbol] );
+ symbol = ( symbol << 1 ) | decode_bit( bm[symbol] );
break;
}
}
@@ -213,7 +213,6 @@ class LZ_decoder
int stream_pos; // first byte not yet written to file
uint32_t crc_;
const int outfd; // output file descriptor
- const int member_version;
unsigned long long stream_position() const { return partial_data_pos + stream_pos; }
void flush_data();
@@ -273,8 +272,7 @@ public:
pos( 0 ),
stream_pos( 0 ),
crc_( 0xFFFFFFFFU ),
- outfd( ofd ),
- member_version( header.version() )
+ outfd( ofd )
{ buffer[buffer_size-1] = 0; } // prev_byte of first_byte
~LZ_decoder() { delete[] buffer; }