From 764b37c93badf5e9c029b43efaba917bf871928e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 7 Nov 2015 06:08:40 +0100 Subject: Merging upstream version 1.7~pre1. Signed-off-by: Daniel Baumann --- decoder.h | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'decoder.h') diff --git a/decoder.h b/decoder.h index 97ef189..6d40fbc 100644 --- a/decoder.h +++ b/decoder.h @@ -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 */ -- cgit v1.2.3