Fix declarations of functions (#186)
Move file-scope functions to anonymous namespaces. Drop #pragma once from .cpp files
This commit is contained in:
parent
251578047f
commit
be31288187
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "Header Files/CalcEngine.h"
|
#include "Header Files/CalcEngine.h"
|
||||||
|
#include "Header Files/CalcUtils.h"
|
||||||
|
|
||||||
bool IsOpInRange(WPARAM op, uint32_t x, uint32_t y)
|
bool IsOpInRange(WPARAM op, uint32_t x, uint32_t y)
|
||||||
{
|
{
|
||||||
|
@ -2,18 +2,25 @@
|
|||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#pragma once
|
|
||||||
#include "Header Files/CalcEngine.h"
|
#include "Header Files/CalcEngine.h"
|
||||||
#include "Command.h"
|
#include "Command.h"
|
||||||
#include "CalculatorVector.h"
|
#include "CalculatorVector.h"
|
||||||
#include "ExpressionCommand.h"
|
#include "ExpressionCommand.h"
|
||||||
#include "CalcException.h"
|
|
||||||
|
|
||||||
constexpr int ASCII_0 = 48;
|
constexpr int ASCII_0 = 48;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace CalcEngine;
|
using namespace CalcEngine;
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
void IFT(HRESULT hr)
|
||||||
|
{
|
||||||
|
if (FAILED(hr))
|
||||||
|
{
|
||||||
|
throw hr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
void CHistoryCollector::ReinitHistory()
|
void CHistoryCollector::ReinitHistory()
|
||||||
{
|
{
|
||||||
m_lastOpStartIndex = -1;
|
m_lastOpStartIndex = -1;
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace CalcEngine;
|
using namespace CalcEngine;
|
||||||
|
|
||||||
|
namespace {
|
||||||
// NPrecedenceOfOp
|
// NPrecedenceOfOp
|
||||||
//
|
//
|
||||||
// returns a virtual number for precedence for the operator. We expect binary operator only, otherwise the lowest number
|
// returns a virtual number for precedence for the operator. We expect binary operator only, otherwise the lowest number
|
||||||
@ -49,6 +50,7 @@ INT NPrecedenceOfOp(int nopCode)
|
|||||||
return rgbPrec[iPrec + 1];
|
return rgbPrec[iPrec + 1];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// HandleErrorCommand
|
// HandleErrorCommand
|
||||||
//
|
//
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
||||||
// Licensed under the MIT License.
|
|
||||||
|
|
||||||
class CalcException : public std::exception
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CalcException(HRESULT hr)
|
|
||||||
{
|
|
||||||
m_hr = hr;
|
|
||||||
}
|
|
||||||
HRESULT GetException()
|
|
||||||
{
|
|
||||||
return m_hr;
|
|
||||||
}
|
|
||||||
private:
|
|
||||||
HRESULT m_hr;
|
|
||||||
};
|
|
||||||
|
|
||||||
void IFT(HRESULT hr)
|
|
||||||
{
|
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
|
||||||
CalcException exception(hr);
|
|
||||||
throw(exception);
|
|
||||||
}
|
|
||||||
}
|
|
@ -119,7 +119,6 @@
|
|||||||
<ClInclude Include="Ratpack\ratpak.h">
|
<ClInclude Include="Ratpack\ratpak.h">
|
||||||
<Filter>RatPack</Filter>
|
<Filter>RatPack</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="CalcException.h" />
|
|
||||||
<ClInclude Include="CalculatorVector.h" />
|
<ClInclude Include="CalculatorVector.h" />
|
||||||
<ClInclude Include="Header Files\CalcEngine.h">
|
<ClInclude Include="Header Files\CalcEngine.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "AppResourceProvider.h"
|
#include "AppResourceProvider.h"
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "TraceLogger.h"
|
#include "TraceLogger.h"
|
||||||
#include "NetworkManager.h"
|
#include "NetworkManager.h"
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||||
// Licensed under the MIT License.
|
// Licensed under the MIT License.
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "CurrencyHttpClient.h"
|
#include "CurrencyHttpClient.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user