1
0
Fork 0

Merging upstream version 1.4.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-24 04:10:09 +01:00
parent e627412516
commit 8b0a7cb0e8
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
16 changed files with 182 additions and 181 deletions

View file

@ -375,11 +375,10 @@ extern "C" void * cworker( void * arg )
Packet * const packet = courier.distribute_packet();
if( !packet ) break; // no more packets to process
int dict_size;
if( dictionary_size == 65535 && match_len_limit == 16 )
dict_size = dictionary_size;
else dict_size = std::max( LZ_min_dictionary_size(),
std::min( dictionary_size, packet->size ) );
const bool fast = dictionary_size == 65535 && match_len_limit == 16;
const int dict_size = fast ? dictionary_size :
std::max( std::min( dictionary_size, packet->size ),
LZ_min_dictionary_size() );
LZ_Encoder * const encoder =
LZ_compress_open( dict_size, match_len_limit, LLONG_MAX );
if( !encoder || LZ_compress_errno( encoder ) != LZ_ok )
@ -413,7 +412,7 @@ extern "C" void * cworker( void * arg )
{
pp();
if( verbosity >= 0 )
std::fprintf( stderr, "LZ_compress_read error: %s.\n",
std::fprintf( stderr, "LZ_compress_read error: %s\n",
LZ_strerror( LZ_compress_errno( encoder ) ) );
cleanup_and_fail();
}
@ -521,7 +520,7 @@ int compress( const int data_size, const int dictionary_size,
if( verbosity >= 1 )
{
if( in_size == 0 || out_size == 0 )
std::fprintf( stderr, " no data compressed.\n" );
std::fputs( " no data compressed.\n", stderr );
else
std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, "
"%5.2f%% saved, %llu in, %llu out.\n",