summaryrefslogtreecommitdiffstats
path: root/main.cc
diff options
context:
space:
mode:
authorDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:32:03 +0000
committerDaniel Baumann <mail@daniel-baumann.ch>2015-11-07 09:32:03 +0000
commit415e3e6d437f5cadbf4d7c3727e0bb1d0106b437 (patch)
treeafb6be0c266301843a8ff7e0ac10c452394de3c0 /main.cc
parentAdding upstream version 1.13~rc2. (diff)
downloadlzip-415e3e6d437f5cadbf4d7c3727e0bb1d0106b437.tar.xz
lzip-415e3e6d437f5cadbf4d7c3727e0bb1d0106b437.zip
Adding upstream version 1.13.upstream/1.13
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
Diffstat (limited to 'main.cc')
-rw-r--r--main.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/main.cc b/main.cc
index 3e95eb9..276fe30 100644
--- a/main.cc
+++ b/main.cc
@@ -108,7 +108,7 @@ mode_t outfd_mode = usr_rw;
bool delete_output_on_interrupt = false;
-void show_help() throw()
+void show_help()
{
std::printf( "%s - Data compressor based on the LZMA algorithm.\n", Program_name );
std::printf( "\nUsage: %s [options] [files]\n", invocation_name );
@@ -144,7 +144,7 @@ void show_help() throw()
}
-void show_version() throw()
+void show_version()
{
std::printf( "%s %s\n", Program_name, PROGVERSION );
std::printf( "Copyright (C) %s Antonio Diaz Diaz.\n", program_year );
@@ -154,7 +154,7 @@ void show_version() throw()
}
-const char * format_num( long long num ) throw()
+const char * format_num( long long num )
{
const char * const prefix[8] =
{ "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi" };
@@ -173,7 +173,7 @@ const char * format_num( long long num ) throw()
long long getnum( const char * const ptr,
const long long llimit = LLONG_MIN + 1,
- const long long ulimit = LLONG_MAX ) throw()
+ const long long ulimit = LLONG_MAX )
{
errno = 0;
char *tail;
@@ -226,7 +226,7 @@ long long getnum( const char * const ptr,
}
-int get_dict_size( const char * const arg ) throw()
+int get_dict_size( const char * const arg )
{
char *tail;
int bits = std::strtol( arg, &tail, 0 );
@@ -237,7 +237,7 @@ int get_dict_size( const char * const arg ) throw()
}
-int extension_index( const std::string & name ) throw()
+int extension_index( const std::string & name )
{
for( int i = 0; known_extensions[i].from; ++i )
{
@@ -252,7 +252,7 @@ int extension_index( const std::string & name ) throw()
int open_instream( const std::string & name, struct stat * const in_statsp,
const Mode program_mode, const int eindex,
- const bool recompress, const bool to_stdout ) throw()
+ const bool recompress, const bool to_stdout )
{
int infd = -1;
if( program_mode == m_compress && !recompress && eindex >= 0 )
@@ -294,7 +294,7 @@ int open_instream( const std::string & name, struct stat * const in_statsp,
}
-void set_c_outname( const std::string & name, const bool multifile ) throw()
+void set_c_outname( const std::string & name, const bool multifile )
{
output_filename = name;
if( multifile ) output_filename += "00001";
@@ -302,7 +302,7 @@ void set_c_outname( const std::string & name, const bool multifile ) throw()
}
-void set_d_outname( const std::string & name, const int i ) throw()
+void set_d_outname( const std::string & name, const int i )
{
if( i >= 0 )
{
@@ -321,7 +321,7 @@ void set_d_outname( const std::string & name, const int i ) throw()
}
-bool open_outstream( const bool force ) throw()
+bool open_outstream( const bool force )
{
int flags = O_CREAT | O_WRONLY | o_binary;
if( force ) flags |= O_TRUNC; else flags |= O_EXCL;
@@ -340,7 +340,7 @@ bool open_outstream( const bool force ) throw()
}
-bool check_tty( const int infd, const Mode program_mode ) throw()
+bool check_tty( const int infd, const Mode program_mode )
{
if( program_mode == m_compress && outfd >= 0 && isatty( outfd ) )
{
@@ -357,7 +357,7 @@ bool check_tty( const int infd, const Mode program_mode ) throw()
}
-void cleanup_and_fail( const int retval ) throw()
+void cleanup_and_fail( const int retval )
{
if( delete_output_on_interrupt )
{
@@ -460,7 +460,7 @@ int compress( const long long member_size, const long long volume_size,
if( retval == 0 && verbosity >= 1 )
{
if( in_size <= 0 || out_size <= 0 )
- std::fprintf( stderr, "No data compressed.\n" );
+ std::fprintf( stderr, " no data compressed.\n" );
else
std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, "
"%5.2f%% saved, %lld in, %lld out.\n",
@@ -523,7 +523,7 @@ int fcompress( const long long member_size, const long long volume_size,
if( retval == 0 && verbosity >= 1 )
{
if( in_size <= 0 || out_size <= 0 )
- std::fprintf( stderr, "No data compressed.\n" );
+ std::fprintf( stderr, " no data compressed.\n" );
else
std::fprintf( stderr, "%6.3f:1, %6.3f bits/byte, "
"%5.2f%% saved, %lld in, %lld out.\n",
@@ -543,7 +543,7 @@ int fcompress( const long long member_size, const long long volume_size,
}
-unsigned char xdigit( const int value ) throw()
+unsigned char xdigit( const int value )
{
if( value >= 0 && value <= 9 ) return '0' + value;
if( value >= 10 && value <= 15 ) return 'A' + value - 10;
@@ -552,7 +552,7 @@ unsigned char xdigit( const int value ) throw()
void show_trailing_garbage( const uint8_t * const data, const int size,
- const Pretty_print & pp, const bool all ) throw()
+ const Pretty_print & pp, const bool all )
{
std::string garbage_msg;
if( !all ) garbage_msg = "first bytes of ";
@@ -566,7 +566,7 @@ void show_trailing_garbage( const uint8_t * const data, const int size,
garbage_msg.append( (const char *)data, size );
garbage_msg += '\'';
}
- else
+ else
{
for( int i = 0; i < size; ++i )
{
@@ -590,7 +590,7 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
{
File_header header;
rdec.reset_member_position();
- const int size = rdec.read( header.data, File_header::size );
+ const int size = rdec.read_data( header.data, File_header::size );
if( rdec.finished() ) // End Of File
{
if( first_member )
@@ -663,14 +663,14 @@ int decompress( const int infd, const Pretty_print & pp, const bool testing )
}
-extern "C" void signal_handler( int ) throw()
+extern "C" void signal_handler( int )
{
show_error( "Control-C or similar caught, quitting." );
cleanup_and_fail( 1 );
}
-void set_signals() throw()
+void set_signals()
{
std::signal( SIGHUP, signal_handler );
std::signal( SIGINT, signal_handler );
@@ -680,7 +680,7 @@ void set_signals() throw()
} // end namespace
-void show_error( const char * const msg, const int errcode, const bool help ) throw()
+void show_error( const char * const msg, const int errcode, const bool help )
{
if( verbosity >= 0 )
{
@@ -698,7 +698,7 @@ void show_error( const char * const msg, const int errcode, const bool help ) th
}
-void internal_error( const char * const msg ) throw()
+void internal_error( const char * const msg )
{
if( verbosity >= 0 )
std::fprintf( stderr, "%s: internal error: %s.\n", program_name, msg );