Remove CalcException as requested in review

This commit is contained in:
Michał Janiszewski 2019-03-09 00:30:24 +01:00 committed by Michał Janiszewski
commit c38f5694b7
2 changed files with 5 additions and 21 deletions

View file

@ -12,28 +12,12 @@ constexpr int ASCII_0 = 48;
using namespace std; using namespace std;
using namespace CalcEngine; 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 { namespace {
void IFT(HRESULT hr) void IFT(HRESULT hr)
{ {
if (FAILED(hr)) if (FAILED(hr))
{ {
CalcException exception(hr); throw hr;
throw(exception);
} }
} }
} }

View file

@ -26,11 +26,11 @@
using namespace std; using namespace std;
using namespace CalcEngine; 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 { 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) INT NPrecedenceOfOp(int nopCode)
{ {
static BYTE rgbPrec[] = { 0,0, IDC_OR,0, IDC_XOR,0, IDC_AND,1, static BYTE rgbPrec[] = { 0,0, IDC_OR,0, IDC_XOR,0, IDC_AND,1,