diff options
Diffstat (limited to 'decoder.cc')
-rw-r--r-- | decoder.cc | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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; } |