diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 05:08:40 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-11-07 05:08:40 +0000 |
commit | 764b37c93badf5e9c029b43efaba917bf871928e (patch) | |
tree | 82ba102c617592b6c73a95a2a217d8f5d591eeb2 /decoder.h | |
parent | Adding debian version 1.6-2. (diff) | |
download | lunzip-764b37c93badf5e9c029b43efaba917bf871928e.tar.xz lunzip-764b37c93badf5e9c029b43efaba917bf871928e.zip |
Merging upstream version 1.7~pre1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
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 */ |