1
0
Fork 0

Merging upstream version 1.1.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 04:02:23 +01:00
parent e3a927d005
commit 6f6daf480e
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
10 changed files with 52 additions and 46 deletions

6
lzip.h
View file

@ -89,15 +89,15 @@ struct File_header
return sz;
}
bool dictionary_size( const int sz )
bool dictionary_size( const unsigned sz )
{
if( sz >= min_dictionary_size && sz <= max_dictionary_size )
{
data[5] = real_bits( sz - 1 );
if( sz > min_dictionary_size )
{
const int base_size = 1 << data[5];
const int wedge = base_size / 16;
const unsigned base_size = 1 << data[5];
const unsigned wedge = base_size / 16;
for( int i = 7; i >= 1; --i )
if( base_size - ( i * wedge ) >= sz )
{ data[5] |= ( i << 5 ); break; }