lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 78fd8b8 01/10: Remove undesirable 'default:'


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

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

    Remove undesirable 'default:' from 'switch'
    
    Removed 'default:' where it prevented gcc's '-Wswitch' from diagnosing
    missing enumerators.
---
 accountvalue.cpp           | 6 +-----
 group_quote_pdf_gen_wx.cpp | 8 --------
 input_sequence_parser.cpp  | 5 +----
 3 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/accountvalue.cpp b/accountvalue.cpp
index 0db43c4..a6dae2a 100644
--- a/accountvalue.cpp
+++ b/accountvalue.cpp
@@ -74,12 +74,8 @@ namespace
         case mce_semiannual: return 1; // S
         case mce_quarterly:  return 2; // Q
         case mce_monthly:    return 3; // M
-        default:
-            {
-            alarum() << "Case " << a_mode << " not found." << LMI_FLUSH;
-            throw "Unreachable--silences a compiler diagnostic.";
-            }
         }
+    throw "Unreachable--silences a compiler diagnostic.";
     }
 } // Unnamed namespace.
 
diff --git a/group_quote_pdf_gen_wx.cpp b/group_quote_pdf_gen_wx.cpp
index 226d3b6..ffb22f0 100644
--- a/group_quote_pdf_gen_wx.cpp
+++ b/group_quote_pdf_gen_wx.cpp
@@ -631,10 +631,6 @@ void group_quote_pdf_generator_wx::add_ledger(Ledger 
const& ledger)
                 alarum() << "Unreachable." << LMI_FLUSH;
                 }
                 break;
-            default:
-                {
-                alarum() << "Case " << col << " not found." << LMI_FLUSH;
-                }
             }
         }
 
@@ -727,10 +723,6 @@ void group_quote_pdf_generator_wx::save(std::string const& 
output_filename)
                 alarum() << "Unreachable." << LMI_FLUSH;
                 }
                 break;
-            default:
-                {
-                alarum() << "Case " << col << " not found." << LMI_FLUSH;
-                }
             }
 
         table_gen.add_column(header, cd.widest_text_);
diff --git a/input_sequence_parser.cpp b/input_sequence_parser.cpp
index 6e80501..2c90426 100644
--- a/input_sequence_parser.cpp
+++ b/input_sequence_parser.cpp
@@ -99,11 +99,8 @@ std::string 
SequenceParser::token_type_name(SequenceParser::token_type t)
             {
             return "keyword";
             }
-        default:
-            {
-            return std::string("unknown: ") + static_cast<char>(t);
-            }
         }
+    throw "Unreachable--silences a compiler diagnostic.";
 }
 
 // GRAMMAR interval-begin: one of [ (



reply via email to

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