summaryrefslogtreecommitdiffstats
path: root/decoder.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:51:28 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 11:51:28 +0000
commit79cd96ee549de2d24d5ba81d6f8fa4d642943b52 (patch)
tree61504e983e7adf383ff88c409233c92e5ff9ed4a /decoder.cc
parentAdding debian version 1.17~rc1-1. (diff)
downloadlziprecover-79cd96ee549de2d24d5ba81d6f8fa4d642943b52.tar.xz
lziprecover-79cd96ee549de2d24d5ba81d6f8fa4d642943b52.zip
Merging upstream version 1.17~rc2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'decoder.cc')
-rw-r--r--decoder.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/decoder.cc b/decoder.cc
index 59587e0..254b818 100644
--- a/decoder.cc
+++ b/decoder.cc
@@ -62,7 +62,7 @@ long readblock( const int fd, uint8_t * const buf, const long size )
{
const int n = read( fd, buf + sz, std::min( 1L << 20, size - sz ) );
if( n > 0 ) sz += n;
- else if( n == 0 ) break; // EOF
+ else if( n == 0 ) break; /* EOF */
else if( errno != EINTR ) break;
errno = 0;
}
@@ -206,9 +206,9 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
Bit_model bm_align[dis_align_size];
Len_model match_len_model;
Len_model rep_len_model;
- unsigned rep0 = 0; // rep[0-3] latest four distances
- unsigned rep1 = 0; // used for efficient coding of
- unsigned rep2 = 0; // repeated distances
+ unsigned rep0 = 0; /* rep[0-3] latest four distances */
+ unsigned rep1 = 0; /* used for efficient coding of */
+ unsigned rep2 = 0; /* repeated distances */
unsigned rep3 = 0;
State state;
@@ -218,7 +218,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
const int pos_state = data_position() & pos_state_mask;
if( rdec.decode_bit( bm_match[state()][pos_state] ) == 0 ) // 1st bit
{
- const uint8_t prev_byte = get_prev_byte();
+ const uint8_t prev_byte = peek_prev();
if( state.is_char() )
{
state.set_char1();
@@ -228,7 +228,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
{
state.set_char2();
put_byte( rdec.decode_matched( bm_literal[get_lit_state(prev_byte)],
- get_byte( rep0 ) ) );
+ peek( rep0 ) ) );
}
}
else
@@ -255,7 +255,7 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
else
{
if( rdec.decode_bit( bm_len[state()][pos_state] ) == 0 ) // 4th bit
- { state.set_short_rep(); put_byte( get_byte( rep0 ) ); continue; }
+ { state.set_short_rep(); put_byte( peek( rep0 ) ); continue; }
}
state.set_rep();
len = min_match_len + rdec.decode_len( rep_len_model, pos_state );
@@ -277,16 +277,16 @@ int LZ_decoder::decode_member( const Pretty_print & pp )
{
rep0 += rdec.decode( direct_bits - dis_align_bits ) << dis_align_bits;
rep0 += rdec.decode_tree_reversed4( bm_align );
- if( rep0 == 0xFFFFFFFFU ) // marker found
+ if( rep0 == 0xFFFFFFFFU ) /* marker found */
{
rep0 = rep0_saved;
rdec.normalize();
flush_data();
- if( len == min_match_len ) // End Of Stream marker
+ if( len == min_match_len ) /* End Of Stream marker */
{
if( verify_trailer( pp ) ) return 0; else return 3;
}
- if( len == min_match_len + 1 ) // Sync Flush marker
+ if( len == min_match_len + 1 ) /* Sync Flush marker */
{
rdec.load(); continue;
}