From ca01a7e44424a44543ac1f83939cf50bbcbaba72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 6 Mar 2019 23:21:58 +0100 Subject: [PATCH 1/2] Add explicit [[fallthrough]] attribute --- src/CalcManager/CEngine/scifunc.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CalcManager/CEngine/scifunc.cpp b/src/CalcManager/CEngine/scifunc.cpp index eb513ea8..75fbbfcf 100644 --- a/src/CalcManager/CEngine/scifunc.cpp +++ b/src/CalcManager/CEngine/scifunc.cpp @@ -173,6 +173,7 @@ CalcEngine::Rational CCalcEngine::SciCalcFunctions(CalcEngine::Rational const& r // the degrees functionality was achieved as 'Inv' of 'dms' operation, // so setting the IDC_INV command first and then performing 'dms' operation as global variables m_bInv, m_bRecord // are set properly through ProcessCommand(IDC_INV) + [[fallthrough]]; case IDC_DMS: { if (!m_fIntegerMode) From 6c0e4e81e744186107a5ca60b398b7efa357e232 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Wed, 6 Mar 2019 23:44:07 +0100 Subject: [PATCH 2/2] Remove unused values --- src/CalcManager/CEngine/History.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/CalcManager/CEngine/History.cpp b/src/CalcManager/CEngine/History.cpp index 631c254b..3520b974 100644 --- a/src/CalcManager/CEngine/History.cpp +++ b/src/CalcManager/CEngine/History.cpp @@ -161,7 +161,7 @@ void CHistoryCollector::PopLastOpndStart() void CHistoryCollector::AddOpenBraceToHistory() { - int iCommandEnd = AddCommand(std::make_shared(IDC_OPENP)); + AddCommand(std::make_shared(IDC_OPENP)); int ichOpndStart = IchAddSzToEquationSz(CCalcEngine::OpCodeToString(IDC_OPENP), -1); PushLastOpndStart(ichOpndStart); @@ -171,7 +171,7 @@ void CHistoryCollector::AddOpenBraceToHistory() void CHistoryCollector::AddCloseBraceToHistory() { - int iCommandEnd = AddCommand(std::make_shared(IDC_CLOSEP)); + AddCommand(std::make_shared(IDC_CLOSEP)); IchAddSzToEquationSz(CCalcEngine::OpCodeToString(IDC_CLOSEP), -1); SetExpressionDisplay(); PopLastOpndStart(); @@ -450,20 +450,16 @@ std::shared_ptr> CHistoryCollector::GetOperandCommandsFrom std::shared_ptr> commands = std::make_shared>(); // Check for negate bool fNegative = (numStr[0] == L'-'); - bool fSciFmt = false; - bool fDecimal = false; for (size_t i = (fNegative ? 1 : 0); i < numStr.length(); i++) { if (numStr[i] == m_decimalSymbol) { IFT(commands->Append(IDC_PNT)); - fDecimal = true; } else if (numStr[i] == L'e') { IFT(commands->Append(IDC_EXP)); - fSciFmt = true; } else if (numStr[i] == L'-') {