summaryrefslogtreecommitdiffstats
path: root/encoder_base.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 14:39:08 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-01-23 14:39:17 +0000
commit18cc9814761e1b87c81168fd495f54d27176bf71 (patch)
treeaa2fbba67797c895a4d00c0dd9848abf8aa78dc4 /encoder_base.h
parentReleasing debian version 1.13-6. (diff)
downloadlzlib-18cc9814761e1b87c81168fd495f54d27176bf71.tar.xz
lzlib-18cc9814761e1b87c81168fd495f54d27176bf71.zip
Merging upstream version 1.14.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'encoder_base.h')
-rw-r--r--encoder_base.h17
1 files changed, 7 insertions, 10 deletions
diff --git a/encoder_base.h b/encoder_base.h
index 17ffc93..094f679 100644
--- a/encoder_base.h
+++ b/encoder_base.h
@@ -1,5 +1,5 @@
/* Lzlib - Compression library for the lzip format
- Copyright (C) 2009-2022 Antonio Diaz Diaz.
+ Copyright (C) 2009-2024 Antonio Diaz Diaz.
This library is free software. Redistribution and use in source and
binary forms, with or without modification, are permitted provided
@@ -142,7 +142,7 @@ static inline int price1( const Bit_model probability )
{ return get_price( bit_model_total - probability ); }
static inline int price_bit( const Bit_model bm, const bool bit )
- { return ( bit ? price1( bm ) : price0( bm ) ); }
+ { return bit ? price1( bm ) : price0( bm ); }
static inline int price_symbol3( const Bit_model bm[], int symbol )
@@ -276,8 +276,8 @@ static inline int Mb_free_bytes( const struct Matchfinder_base * const mb )
static inline bool
Mb_enough_available_bytes( const struct Matchfinder_base * const mb )
- { return ( mb->pos + mb->after_size <= mb->stream_pos ||
- ( Mb_flushing_or_end( mb ) && mb->pos < mb->stream_pos ) ); }
+ { return mb->pos + mb->after_size <= mb->stream_pos ||
+ ( Mb_flushing_or_end( mb ) && mb->pos < mb->stream_pos ); }
static inline const uint8_t *
Mb_ptr_to_current_pos( const struct Matchfinder_base * const mb )
@@ -340,7 +340,6 @@ static inline void Re_shift_low( struct Range_encoder * const renc )
static inline void Re_reset( struct Range_encoder * const renc,
const unsigned dictionary_size )
{
- int i;
Cb_reset( &renc->cb );
renc->low = 0;
renc->partial_member_pos = 0;
@@ -348,8 +347,7 @@ static inline void Re_reset( struct Range_encoder * const renc,
renc->ff_count = 0;
renc->cache = 0;
Lh_set_dictionary_size( renc->header, dictionary_size );
- for( i = 0; i < Lh_size; ++i )
- Cb_put_byte( &renc->cb, renc->header[i] );
+ int i; for( i = 0; i < Lh_size; ++i ) Cb_put_byte( &renc->cb, renc->header[i] );
}
static inline bool Re_init( struct Range_encoder * const renc,
@@ -398,8 +396,7 @@ static inline void Re_encode( struct Range_encoder * const renc,
{
renc->range >>= 1;
if( symbol & mask ) renc->low += renc->range;
- if( renc->range <= 0x00FFFFFFU )
- { renc->range <<= 8; Re_shift_low( renc ); }
+ if( renc->range <= 0x00FFFFFFU ) { renc->range <<= 8; Re_shift_low( renc ); }
}
}
@@ -559,7 +556,7 @@ static inline bool LZeb_init( struct LZ_encoder_base * const eb,
}
static inline bool LZeb_member_finished( const struct LZ_encoder_base * const eb )
- { return ( eb->member_finished && Cb_empty( &eb->renc.cb ) ); }
+ { return eb->member_finished && Cb_empty( &eb->renc.cb ); }
static inline void LZeb_free( struct LZ_encoder_base * const eb )
{ Re_free( &eb->renc ); Mb_free( &eb->mb ); }