[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 [ (
- [lmi-commits] [lmi] master updated (eafa74e -> 246f754), Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 9cc3f6b 05/10: Avoid passing an enum by reference, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 20e866a 06/10: Simplify an overwrought expression, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master b0576c8 02/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master e26d308 09/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 422e64a 03/10: Remove an unimplemented 'case', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 92911ca 07/10: Improve documentation, Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 9797cbc 04/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 78fd8b8 01/10: Remove undesirable 'default:' from 'switch',
Greg Chicares <=
- [lmi-commits] [lmi] master 246f754 10/10: In unit tests, reflect removal of undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08
- [lmi-commits] [lmi] master 3952bd0 08/10: Remove undesirable 'default:' from 'switch', Greg Chicares, 2018/02/08