Skip to content

Commit 53796e9

Browse files
committed
fix catching of exceptions by value
1 parent 8026e31 commit 53796e9

7 files changed

Lines changed: 8 additions & 8 deletions

File tree

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#
66

77
AC_PREREQ([2.68])
8-
AC_INIT([cosi], [2.3.1], [ilya_shl@alum.mit.edu])
8+
AC_INIT([cosi], [2.3.2rc5], [ilya_shl@alum.mit.edu])
99
AC_CONFIG_AUX_DIR([build-aux])
1010
AC_CONFIG_MACRO_DIR([m4])
1111
AM_INIT_AUTOMAKE([1.9 tar-pax parallel-tests -Wall])

cosi/condsnp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class CondSnpDef {
6868
pop2cond.insert( make_pair( lexical_cast< popid >( condParts.front() ), util::ValRange<nchroms_t>( condParts.back() ) ) );
6969
}
7070
}
71-
} catch( std::exception& e ) {
71+
} catch( const std::exception& e ) {
7272
std::cerr << "error: " << e.what() << "\n";
7373
}
7474

cosi/cositop.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CoSiMain::CoSiMain():
6666
void CoSiMain::printCompileOptions() {
6767
using std::cerr;
6868

69-
cerr << "cosi coalescent simulator, version 2.3.1\n\n";
69+
cerr << "cosi coalescent simulator, version 2.3.2rc5\n\n";
7070
cerr << "Compile-time options:\n";
7171

7272
cerr << " COSI_SUPPORT_COALAPX (support for approximating the coalescent): " <<

cosi/file.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ ParamFileReader::file_get_data (FILE *fileptr, FILE *segfp)
342342
}
343343
try {
344344
try { file_proc_buff(var, buffer, segfp); }
345-
catch( const std::ios_base::failure& e ) {
345+
catch( const std::ios_base::failure& ) {
346346
BOOST_THROW_EXCEPTION( cosi_param_file_error()
347347
<< boost::errinfo_errno( errno ) );
348348
}
349-
catch( std::exception const& e ) {
349+
catch( const std::exception& e ) {
350350

351351
std::cerr << "genMap::readFrom - caught UNKNOWN exception of type " <<
352352
typeid( e ).name() << " demangled " <<

cosi/historical.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ HistEvents::EventP HistEvents::parseEvent( const char *buffer ) {
864864
else if ( typestr == Event_MSweep::typeStr_standing_variation() )
865865
event.reset( new Event_MSweep( this, is, Event_MSweep::standing_variation_tag() ) );
866866
else chkCond( False, "could not parse event %s", buffer );
867-
} catch( ios::failure e ) {
867+
} catch( const ios::failure& ) {
868868
chkCond( False, "could not parse event %s", buffer );
869869
}
870870
return event;

cosi/sweep.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ void Sweep::sweep_load_traj() {
9393
genid gen;
9494
freq_t freq;
9595
try { f >> gen >> freq; }
96-
catch( std::ios::failure fe ) { break; }
96+
catch( const std::ios::failure& ) { break; }
9797
//PRINT2( gen, freq );
9898
selAlleleFreqTraj.addPt( gen, freq );
9999
}

cosi/traj.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ TrajFromFile::TrajFromFile( filename_t fname, genid firstGen_, freq_t firstFreq_
2525
freq_t a_freq;
2626
trajStrm >> a_gen >> a_freq;
2727
traj.insert( std::make_pair( a_gen, a_freq ) );
28-
} catch( std::ifstream::failure e ) {
28+
} catch( const std::ifstream::failure& ) {
2929
break;
3030
}
3131
}

0 commit comments

Comments
 (0)