summaryrefslogtreecommitdiffstats
path: root/lzip.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:00:31 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 10:00:31 +0000
commit3f2a7dc31b4309fbd1a946b0fc3317764f0eb905 (patch)
tree382b32f3f4cd342b2858c258e7beca901e5ca506 /lzip.h
parentAdding upstream version 1.15~rc1. (diff)
downloadlzip-3f2a7dc31b4309fbd1a946b0fc3317764f0eb905.tar.xz
lzip-3f2a7dc31b4309fbd1a946b0fc3317764f0eb905.zip
Adding upstream version 1.15.upstream/1.15
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'lzip.h')
-rw-r--r--lzip.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/lzip.h b/lzip.h
index b563833..b4b51e2 100644
--- a/lzip.h
+++ b/lzip.h
@@ -48,6 +48,7 @@ enum {
pos_states = 1 << pos_state_bits,
pos_state_mask = pos_states - 1,
+ len_states = 4,
dis_slot_bits = 6,
start_dis_model = 4,
end_dis_model = 14,
@@ -65,12 +66,10 @@ enum {
min_match_len = 2, // must be 2
max_match_len = min_match_len + max_len_symbols - 1, // 273
- min_match_len_limit = 5,
+ min_match_len_limit = 5 };
- max_dis_states = 4 };
-
-inline int get_dis_state( const int len )
- { return std::min( len - min_match_len, max_dis_states - 1 ); }
+inline int get_len_state( const int len )
+ { return std::min( len - min_match_len, len_states - 1 ); }
inline int get_lit_state( const uint8_t prev_byte )
{ return ( prev_byte >> ( 8 - literal_context_bits ) ); }
@@ -111,7 +110,7 @@ public:
for( unsigned i = 0; i < filenames.size(); ++i )
{
const std::string & s = filenames[i];
- const unsigned len = ( ( s == "-" ) ? stdin_name_len : s.size() );
+ const unsigned len = ( s == "-" ) ? stdin_name_len : s.size();
if( len > longest_name ) longest_name = len;
}
if( longest_name == 0 ) longest_name = stdin_name_len;