mirror of
https://github.com/Microsoft/calculator.git
synced 2025-08-22 06:13:14 -07:00
Remove CalcException as requested in review
This commit is contained in:
parent
0d21d65fc6
commit
c38f5694b7
2 changed files with 5 additions and 21 deletions
|
@ -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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue