diff options
Diffstat (limited to 'decoder.cc')
-rw-r--r-- | decoder.cc | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1,5 +1,5 @@ /* Lzip - LZMA lossless data compressor - Copyright (C) 2008-2014 Antonio Diaz Diaz. + Copyright (C) 2008-2015 Antonio Diaz Diaz. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,7 +62,7 @@ int readblock( const int fd, uint8_t * const buf, const int size ) { const int n = read( fd, buf + sz, 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; } @@ -201,9 +201,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; @@ -213,7 +213,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 = peek1(); if( state.is_char() ) { state.set_char1(); @@ -223,7 +223,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 @@ -250,7 +250,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 ); @@ -272,16 +272,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; } |