diff options
Diffstat (limited to '')
-rw-r--r-- | decoder.h | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1,5 +1,5 @@ /* Lunzip - Decompressor for lzip files - Copyright (C) 2010, 2011, 2012, 2013, 2014 Antonio Diaz Diaz. + Copyright (C) 2010-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 @@ -259,14 +259,14 @@ void LZd_flush_data( struct LZ_decoder * const d ); int seek_read( const int fd, uint8_t * const buf, const int size, const int offset ); -static inline uint8_t LZd_get_prev_byte( const struct LZ_decoder * const d ) +static inline uint8_t LZd_peek1( const struct LZ_decoder * const d ) { const int i = ( ( d->pos > 0 ) ? d->pos : d->buffer_size ) - 1; return d->buffer[i]; } -static inline uint8_t LZd_get_byte( const struct LZ_decoder * const d, - const int distance ) +static inline uint8_t LZd_peek( const struct LZ_decoder * const d, + const int distance ) { uint8_t b; const int i = d->pos - distance - 1; @@ -319,7 +319,7 @@ static inline void LZd_copy_block2( struct LZ_decoder * const d, } } for( ; len > 0; --len ) - LZd_put_byte( d, LZd_get_byte( d, distance ) ); + LZd_put_byte( d, LZd_peek( d, distance ) ); } static inline bool LZd_init( struct LZ_decoder * const d, @@ -348,7 +348,6 @@ static inline bool LZd_init( struct LZ_decoder * const d, Bm_array_init( d->bm_dis_slot[0], len_states * (1 << dis_slot_bits) ); Bm_array_init( d->bm_dis, modeled_distances - end_dis_model ); Bm_array_init( d->bm_align, dis_align_size ); - Lm_init( &d->match_len_model ); Lm_init( &d->rep_len_model ); d->buffer[d->buffer_size-1] = 0; /* prev_byte of first byte */ |