summaryrefslogtreecommitdiffstats
path: root/clzip.h
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:33:36 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-06 11:33:36 +0000
commit8b42f93e9b42a93caddaa897a237acb5acbf3231 (patch)
tree0385d43238b978b7be02fb442fb64fadc92ad7dc /clzip.h
parentAdding upstream version 1.2. (diff)
downloadclzip-8b42f93e9b42a93caddaa897a237acb5acbf3231.tar.xz
clzip-8b42f93e9b42a93caddaa897a237acb5acbf3231.zip
Adding upstream version 1.3.upstream/1.3
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'clzip.h')
-rw-r--r--clzip.h27
1 files changed, 11 insertions, 16 deletions
diff --git a/clzip.h b/clzip.h
index b534d66..42c014e 100644
--- a/clzip.h
+++ b/clzip.h
@@ -1,5 +1,5 @@
/* Clzip - Data compressor based on the LZMA algorithm
- Copyright (C) 2010, 2011 Antonio Diaz Diaz.
+ Copyright (C) 2010, 2011, 2012 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
@@ -108,7 +108,7 @@ static inline void Bm_init( Bit_model * const probability )
struct Pretty_print
{
- const char * name_;
+ const char * name;
const char * stdin_name;
int longest_name;
int verbosity;
@@ -122,13 +122,13 @@ static inline void Pp_set_name( struct Pretty_print * const pp,
const char * const filename )
{
if( filename && filename[0] && strcmp( filename, "-" ) )
- pp->name_ = filename;
- else pp->name_ = pp->stdin_name;
+ pp->name = filename;
+ else pp->name = pp->stdin_name;
pp->first_post = true;
}
static inline void Pp_reset( struct Pretty_print * const pp )
- { if( pp->name_ && pp->name_[0] ) pp->first_post = true; }
+ { if( pp->name && pp->name[0] ) pp->first_post = true; }
void Pp_show_msg( struct Pretty_print * const pp, const char * const msg );
@@ -160,11 +160,11 @@ static inline void CRC32_update_buf( uint32_t * crc, const uint8_t * const buffe
}
-static inline int real_bits( const int value )
+static inline int real_bits( const unsigned int value )
{
- int bits = 0, i, mask;
- for( i = 1, mask = 1; mask > 0; ++i, mask <<= 1 )
- if( value & mask ) bits = i;
+ int bits = 0, i = 1;
+ unsigned int mask = 1;
+ for( ; mask > 0; ++i, mask <<= 1 ) if( value & mask ) bits = i;
return bits;
}
@@ -177,15 +177,10 @@ typedef uint8_t File_header[6]; /* 0-3 magic bytes */
enum { Fh_size = 6 };
static inline void Fh_set_magic( File_header data )
- {
- memcpy( data, magic_string, 4 );
- data[4] = 1;
- }
+ { memcpy( data, magic_string, 4 ); data[4] = 1; }
static inline bool Fh_verify_magic( const File_header data )
- {
- return ( memcmp( data, magic_string, 4 ) == 0 );
- }
+ { return ( memcmp( data, magic_string, 4 ) == 0 ); }
static inline uint8_t Fh_version( const File_header data )
{ return data[4]; }