lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master b0576c8 02/10: Remove undesirable 'default:'


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b0576c8 02/10: Remove undesirable 'default:' from 'switch'
Date: Thu, 8 Feb 2018 08:40:09 -0500 (EST)

branch: master
commit b0576c809627087be3d65f43b98afb64147b090d
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Remove undesirable 'default:' from 'switch'
    
    Added a case for the only enumerator that lacked one. Then removed
    'default:' because it prevented gcc's '-Wswitch' from diagnosing
    other missing enumerators.
---
 ihs_avsolve.cpp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 572b548..2e7d5b1 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -352,6 +352,11 @@ double AccountValue::Solve
 
     switch(a_SolveType)
         {
+        case mce_solve_none:
+            {
+            alarum() << "Unreachable--cannot solve for nothing." << LMI_FLUSH;
+            }
+            break;
         case mce_solve_specamt:
             {
             solve_set_fn = &AccountValue::SolveSetSpecAmt;
@@ -402,10 +407,6 @@ double AccountValue::Solve
                 }
             }
             break;
-        default:
-            {
-            alarum() << "Case " << a_SolveType << " not found." << LMI_FLUSH;
-            }
         }
 
     std::ostream os_trace(status().rdbuf());



reply via email to

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