From c38f5694b732277fb551ed3dbaa19f39b4bcfbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 9 Mar 2019 00:30:24 +0100 Subject: [PATCH] Remove CalcException as requested in review --- src/CalcManager/CEngine/History.cpp | 18 +----------------- src/CalcManager/CEngine/scicomm.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/CalcManager/CEngine/History.cpp b/src/CalcManager/CEngine/History.cpp index 7f4fd772..c91bc8a5 100644 --- a/src/CalcManager/CEngine/History.cpp +++ b/src/CalcManager/CEngine/History.cpp @@ -12,28 +12,12 @@ constexpr int ASCII_0 = 48; using namespace std; using namespace CalcEngine; -class CalcException : public std::exception -{ -public: - CalcException(HRESULT hr) - { - m_hr = hr; - } - HRESULT GetException() - { - return m_hr; - } -private: - HRESULT m_hr; -}; - namespace { void IFT(HRESULT hr) { if (FAILED(hr)) { - CalcException exception(hr); - throw(exception); + throw hr; } } } diff --git a/src/CalcManager/CEngine/scicomm.cpp b/src/CalcManager/CEngine/scicomm.cpp index 849d9f7f..a72cce15 100644 --- a/src/CalcManager/CEngine/scicomm.cpp +++ b/src/CalcManager/CEngine/scicomm.cpp @@ -26,11 +26,11 @@ using namespace std; using namespace CalcEngine; -// NPrecedenceOfOp -// -// returns a virtual number for precedence for the operator. We expect binary operator only, otherwise the lowest number -// 0 is returned. Higher the number, higher the precedence of the operator. namespace { + // NPrecedenceOfOp + // + // returns a virtual number for precedence for the operator. We expect binary operator only, otherwise the lowest number + // 0 is returned. Higher the number, higher the precedence of the operator. INT NPrecedenceOfOp(int nopCode) { static BYTE rgbPrec[] = { 0,0, IDC_OR,0, IDC_XOR,0, IDC_AND,1,