lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [6536] Avoid shadowing variable names (VZ)


From: Greg Chicares
Subject: [lmi-commits] [6536] Avoid shadowing variable names (VZ)
Date: Sun, 27 Mar 2016 13:05:34 +0000

Revision: 6536
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6536
Author:   chicares
Date:     2016-03-27 13:05:33 +0000 (Sun, 27 Mar 2016)
Log Message:
-----------
Avoid shadowing variable names (VZ)

Modified Paths:
--------------
    lmi/trunk/ChangeLog
    lmi/trunk/account_value.hpp
    lmi/trunk/accountvalue.cpp
    lmi/trunk/assert_lmi.hpp
    lmi/trunk/dbdict.cpp
    lmi/trunk/group_values.cpp
    lmi/trunk/ihs_acctval.cpp
    lmi/trunk/ledger_xml_io.cpp
    lmi/trunk/xml_lmi.cpp

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/ChangeLog 2016-03-27 13:05:33 UTC (rev 6536)
@@ -38789,3 +38789,27 @@
   group_quote_pdf_gen_wx.cpp
 Avoid needless conversions of std::string to wxString (VZ).
 
+20160327T1129Z <address@hidden> [454]
+
+  msw_workarounds.cpp
+  msw_workarounds.hpp
+Make this platform-specific code empty for other platforms (VZ).
+
+20160327T1130Z <address@hidden> [454]
+
+  configure.ac
+Fix defect introduced 20160325T1225Z: invalid warning (VZ).
+
+20160327T1305Z <address@hidden> [454]
+
+  account_value.hpp
+  accountvalue.cpp
+  assert_lmi.hpp
+  dbdict.cpp
+  group_values.cpp
+  ihs_acctval.cpp
+  ledger_xml_io.cpp
+  xml_lmi.cpp
+Avoid shadowing variable names (VZ). See:
+  http://lists.nongnu.org/archive/html/lmi/2016-02/msg00017.html
+

Modified: lmi/trunk/account_value.hpp
===================================================================
--- lmi/trunk/account_value.hpp 2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/account_value.hpp 2016-03-27 13:05:33 UTC (rev 6536)
@@ -460,7 +460,7 @@
 
     // 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;

Modified: lmi/trunk/accountvalue.cpp
===================================================================
--- lmi/trunk/accountvalue.cpp  2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/accountvalue.cpp  2016-03-27 13:05:33 UTC (rev 6536)
@@ -124,7 +124,7 @@
     ,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 @@
     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 @@
             {
             *a_Pmt = GetModalMinPrem
                 (Year
-                ,mode
+                ,pmt_mode
                 ,ActualSpecAmt
                 );
             }
@@ -630,7 +630,7 @@
             {
             *a_Pmt = GetModalTgtPrem
                 (Year
-                ,mode
+                ,pmt_mode
                 ,ActualSpecAmt
                 );
             }

Modified: lmi/trunk/assert_lmi.hpp
===================================================================
--- lmi/trunk/assert_lmi.hpp    2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/assert_lmi.hpp    2016-03-27 13:05:33 UTC (rev 6536)
@@ -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)

Modified: lmi/trunk/dbdict.cpp
===================================================================
--- lmi/trunk/dbdict.cpp        2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/dbdict.cpp        2016-03-27 13:05:33 UTC (rev 6536)
@@ -1111,9 +1111,9 @@
         fs::ofstream os(out_file, ios_out_trunc_binary());
         DBDictionary const& z = DBDictionary::instance();
         typedef std::vector<std::string>::const_iterator svci;
-        for(svci i = z.member_names().begin(); i != z.member_names().end(); 
++i)
+        for(svci j = z.member_names().begin(); j != z.member_names().end(); 
++j)
             {
-            z.datum(*i).write(os);
+            z.datum(*j).write(os);
             }
         }
 }

Modified: lmi/trunk/group_values.cpp
===================================================================
--- lmi/trunk/group_values.cpp  2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/group_values.cpp  2016-03-27 13:05:33 UTC (rev 6536)
@@ -357,12 +357,10 @@
             MaxYr = std::max(MaxYr, (*i)->GetLength());
             }
 
-        boost::shared_ptr<progress_meter> meter
-            (create_progress_meter
-                (MaxYr - first_cell_inforce_year
-                ,mc_str(*run_basis)
-                ,progress_meter_mode(emission)
-                )
+        meter = create_progress_meter
+            (MaxYr - first_cell_inforce_year
+            ,mc_str(*run_basis)
+            ,progress_meter_mode(emission)
             );
 
         // Variables to support tiering and experience rating.

Modified: lmi/trunk/ihs_acctval.cpp
===================================================================
--- lmi/trunk/ihs_acctval.cpp   2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/ihs_acctval.cpp   2016-03-27 13:05:33 UTC (rev 6536)
@@ -116,7 +116,7 @@
     LapseYear                = 0;          // Antediluvian.
     AVUnloaned               = 0.0;        // Antediluvian.
     pmt                      = 0.0;        // Antediluvian.
-    mode                     = mce_annual; // Antediluvian.
+    pmt_mode                 = mce_annual; // Antediluvian.
     ModeIndex                = 0;          // Antediluvian.
     wd                       = 0.0;        // Antediluvian.
     mlyguarv                 = 0.0;        // Antediluvian.

Modified: lmi/trunk/ledger_xml_io.cpp
===================================================================
--- lmi/trunk/ledger_xml_io.cpp 2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/ledger_xml_io.cpp 2016-03-27 13:05:33 UTC (rev 6536)
@@ -717,7 +717,7 @@
 
     // First we'll get the invariant stuff--the copy we made,
     // along with all the stuff we plugged into it above.
-
+    {
     std::string suffix = "";
     for
         (scalar_map::const_iterator j = scalars.begin()
@@ -745,6 +745,7 @@
         if(format_exists(j->first, suffix, format_map))
             stringvectors[j->first + suffix] = ledger_format(*j->second, 
format_map[j->first]);
         }
+    }
 
 //    stringscalars["GuarMaxMandE"] = ledger_format(*scalars["GuarMaxMandE"], 
2, true);
 //    stringvectors["CorridorFactor"] = 
ledger_format(*vectors["CorridorFactor"], 0, true);
@@ -753,8 +754,8 @@
     // That was the tricky part. Now it's all downhill.
 
     ledger_map_t const& l_map_rep = ledger_map_->held();
-    ledger_map_t::const_iterator i = l_map_rep.begin();
-    for(;i != l_map_rep.end(); i++)
+    typedef ledger_map_t::const_iterator lmci;
+    for(lmci i = l_map_rep.begin(); i != l_map_rep.end(); i++)
         {
         std::string suffix = suffixes[i->first];
         for

Modified: lmi/trunk/xml_lmi.cpp
===================================================================
--- lmi/trunk/xml_lmi.cpp       2016-03-27 11:30:16 UTC (rev 6535)
+++ lmi/trunk/xml_lmi.cpp       2016-03-27 13:05:33 UTC (rev 6536)
@@ -241,7 +241,6 @@
 
 void xml_lmi::xml_document::add_comment(std::string const& s)
 {
-    xml::node::iterator i = document_->begin();
     for(xml::node::iterator i = document_->begin(); i != document_->end(); ++i)
         {
         if(xml::node::type_element == i->get_type())




reply via email to

[Prev in Thread] Current Thread [Next in Thread]