commit 85afcb144bebd3e57b36c0377324f1f4a2347fa2 Author: Vadim Zeitlin
Date: Tue Feb 9 16:14:23 2016 +0100 Avoid variable shadowing warnings with MSVC14 Suppress several instances of the following warnings when building with MSVC14: warning C4456: declaration of 'xxx' hides previous local declaration warning C4458: declaration of 'xxx' hides class member (the latter for AccountValue::mode member only). diff --git a/account_value.hpp b/account_value.hpp index 5823b9f..5e159d9 100644 --- a/account_value.hpp +++ b/account_value.hpp @@ -460,7 +460,7 @@ class LMI_SO AccountValue // Intermediate values within annual or monthly loop only. double pmt; // Antediluvian. - mcenum_mode mode; // Antediluvian. + mcenum_mode pmt_mode; // Antediluvian. int ModeIndex; // Antediluvian. double GenAcctIntCred; diff --git a/accountvalue.cpp b/accountvalue.cpp index b12485c..2328485 100644 --- a/accountvalue.cpp +++ b/accountvalue.cpp @@ -124,7 +124,7 @@ AccountValue::AccountValue(Input const& input) ,RunBasis_ (mce_run_gen_curr_sep_full) ,GenBasis_ (mce_gen_curr) ,SepBasis_ (mce_sep_full) - ,mode (mce_annual) + ,pmt_mode (mce_annual) ,OldDBOpt (mce_option1) ,YearsDBOpt (mce_option1) { @@ -299,8 +299,8 @@ void AccountValue::DoYear ActualSpecAmt = InvariantValues().SpecAmt[Year]; // These variables are set for each pass independently. - mode = InvariantValues().EeMode[Year].value(); - ModeIndex = get_mode_index(mode); + pmt_mode = InvariantValues().EeMode[Year].value(); + ModeIndex = get_mode_index(pmt_mode); RequestedLoan = Outlay_->new_cash_loans()[Year]; wd = Outlay_->withdrawals()[Year]; mlyguarv = @@ -621,7 +621,7 @@ void AccountValue::PerformPmtStrategy(double* a_Pmt) { *a_Pmt = GetModalMinPrem (Year - ,mode + ,pmt_mode ,ActualSpecAmt ); } @@ -630,7 +630,7 @@ void AccountValue::PerformPmtStrategy(double* a_Pmt) { *a_Pmt = GetModalTgtPrem (Year - ,mode + ,pmt_mode ,ActualSpecAmt ); } diff --git a/assert_lmi.hpp b/assert_lmi.hpp index 008c203..4d1c0b4 100644 --- a/assert_lmi.hpp +++ b/assert_lmi.hpp @@ -48,13 +48,13 @@ { \ if(!(condition)) \ { \ - std::ostringstream oss; \ - oss \ + std::ostringstream assert_message; \ + assert_message \ << "Assertion '" << (#condition) << "' failed." \ << "\n[file " << __FILE__ \ << ", line " << __LINE__ << "]\n" \ ; \ - throw std::runtime_error(oss.str()); \ + throw std::runtime_error(assert_message.str()); \ } \ } \ while(0) @@ -70,14 +70,14 @@ { \ if(!(condition)) \ { \ - std::ostringstream oss; \ - oss \ + std::ostringstream assert_message; \ + assert_message \ << "Assertion '" << (#condition) << "' failed" \ << "\n(" << message << ")." \ << "\n[file " << __FILE__ \ << ", line " << __LINE__ << "]\n" \ ; \ - throw std::runtime_error(oss.str()); \ + throw std::runtime_error(assert_message.str()); \ } \ } \ while(0) diff --git a/dbdict.cpp b/dbdict.cpp index f622575..8e50151 100644 --- a/dbdict.cpp +++ b/dbdict.cpp @@ -1111,9 +1111,9 @@ void print_databases() fs::ofstream os(out_file, ios_out_trunc_binary()); DBDictionary const& z = DBDictionary::instance(); typedef std::vector