Secondary formatting changes (#489)
Description of the changes: Adjusted some of the values in .clang-format Add clang-format-all.ps1 Fix path to .clang-format in Calculator.sln How changes were validated: Manual.
This commit is contained in:
@@ -40,7 +40,10 @@ void CHistoryCollector::ReinitHistory()
|
||||
// Constructor
|
||||
// Can throw Out of memory error
|
||||
CHistoryCollector::CHistoryCollector(ICalcDisplay* pCalcDisplay, std::shared_ptr<IHistoryDisplay> pHistoryDisplay, wchar_t decimalSymbol)
|
||||
: m_pHistoryDisplay(pHistoryDisplay), m_pCalcDisplay(pCalcDisplay), m_iCurLineHistStart(-1), m_decimalSymbol(decimalSymbol)
|
||||
: m_pHistoryDisplay(pHistoryDisplay)
|
||||
, m_pCalcDisplay(pCalcDisplay)
|
||||
, m_iCurLineHistStart(-1)
|
||||
, m_decimalSymbol(decimalSymbol)
|
||||
{
|
||||
ReinitHistory();
|
||||
}
|
||||
@@ -300,8 +303,8 @@ void CHistoryCollector::CompleteHistoryLine(wstring_view numStr)
|
||||
{
|
||||
if (nullptr != m_pCalcDisplay)
|
||||
{
|
||||
m_pCalcDisplay->SetExpressionDisplay(std::make_shared<CalculatorVector<std::pair<std::wstring, int>>>(),
|
||||
std::make_shared<CalculatorVector<std::shared_ptr<IExpressionCommand>>>());
|
||||
m_pCalcDisplay->SetExpressionDisplay(
|
||||
std::make_shared<CalculatorVector<std::pair<std::wstring, int>>>(), std::make_shared<CalculatorVector<std::shared_ptr<IExpressionCommand>>>());
|
||||
}
|
||||
|
||||
if (nullptr != m_pHistoryDisplay)
|
||||
@@ -322,8 +325,8 @@ void CHistoryCollector::ClearHistoryLine(wstring_view errStr)
|
||||
{
|
||||
if (nullptr != m_pCalcDisplay)
|
||||
{
|
||||
m_pCalcDisplay->SetExpressionDisplay(std::make_shared<CalculatorVector<std::pair<std::wstring, int>>>(),
|
||||
std::make_shared<CalculatorVector<std::shared_ptr<IExpressionCommand>>>());
|
||||
m_pCalcDisplay->SetExpressionDisplay(
|
||||
std::make_shared<CalculatorVector<std::pair<std::wstring, int>>>(), std::make_shared<CalculatorVector<std::shared_ptr<IExpressionCommand>>>());
|
||||
}
|
||||
m_iCurLineHistStart = -1; // It will get recomputed at the first Opnd
|
||||
ReinitHistory();
|
||||
|
||||
@@ -7,15 +7,22 @@ using namespace std;
|
||||
|
||||
namespace CalcEngine
|
||||
{
|
||||
Number::Number() noexcept : Number(1, 0, { 0 })
|
||||
Number::Number() noexcept
|
||||
: Number(1, 0, { 0 })
|
||||
{
|
||||
}
|
||||
|
||||
Number::Number(int32_t sign, int32_t exp, vector<uint32_t> const& mantissa) noexcept : m_sign{ sign }, m_exp{ exp }, m_mantissa{ mantissa }
|
||||
Number::Number(int32_t sign, int32_t exp, vector<uint32_t> const& mantissa) noexcept
|
||||
: m_sign{ sign }
|
||||
, m_exp{ exp }
|
||||
, m_mantissa{ mantissa }
|
||||
{
|
||||
}
|
||||
|
||||
Number::Number(PNUMBER p) noexcept : m_sign{ p->sign }, m_exp{ p->exp }, m_mantissa{}
|
||||
Number::Number(PNUMBER p) noexcept
|
||||
: m_sign{ p->sign }
|
||||
, m_exp{ p->exp }
|
||||
, m_mantissa{}
|
||||
{
|
||||
m_mantissa.reserve(p->cdigit);
|
||||
copy(p->mant, p->mant + p->cdigit, back_inserter(m_mantissa));
|
||||
|
||||
@@ -7,7 +7,9 @@ using namespace std;
|
||||
|
||||
namespace CalcEngine
|
||||
{
|
||||
Rational::Rational() noexcept : m_p{}, m_q{ 1, 0, { 1 } }
|
||||
Rational::Rational() noexcept
|
||||
: m_p{}
|
||||
, m_q{ 1, 0, { 1 } }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,7 +25,9 @@ namespace CalcEngine
|
||||
m_q = Number(1, qExp, { 1 });
|
||||
}
|
||||
|
||||
Rational::Rational(Number const& p, Number const& q) noexcept : m_p{ p }, m_q{ q }
|
||||
Rational::Rational(Number const& p, Number const& q) noexcept
|
||||
: m_p{ p }
|
||||
, m_q{ q }
|
||||
{
|
||||
}
|
||||
|
||||
@@ -58,7 +62,9 @@ namespace CalcEngine
|
||||
m_q = Number{ temp.Q() };
|
||||
}
|
||||
|
||||
Rational::Rational(PRAT prat) noexcept : m_p{ Number{ prat->pp } }, m_q{ Number{ prat->pq } }
|
||||
Rational::Rational(PRAT prat) noexcept
|
||||
: m_p{ Number{ prat->pp } }
|
||||
, m_q{ Number{ prat->pq } }
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,12 @@ void CCalcEngine::InitialOneTimeOnlySetup(CalculationManager::IResourceProvider&
|
||||
// CCalcEngine::CCalcEngine
|
||||
//
|
||||
//////////////////////////////////////////////////
|
||||
CCalcEngine::CCalcEngine(bool fPrecedence, bool fIntegerMode, CalculationManager::IResourceProvider* const pResourceProvider,
|
||||
__in_opt ICalcDisplay* pCalcDisplay, __in_opt shared_ptr<IHistoryDisplay> pHistoryDisplay)
|
||||
CCalcEngine::CCalcEngine(
|
||||
bool fPrecedence,
|
||||
bool fIntegerMode,
|
||||
CalculationManager::IResourceProvider* const pResourceProvider,
|
||||
__in_opt ICalcDisplay* pCalcDisplay,
|
||||
__in_opt shared_ptr<IHistoryDisplay> pHistoryDisplay)
|
||||
: m_fPrecedence(fPrecedence)
|
||||
, m_fIntegerMode(fIntegerMode)
|
||||
, m_pCalcDisplay(pCalcDisplay)
|
||||
|
||||
@@ -382,8 +382,8 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
|
||||
if (nullptr != m_pCalcDisplay)
|
||||
{
|
||||
m_pCalcDisplay->SetParenthesisNumber(0);
|
||||
m_pCalcDisplay->SetExpressionDisplay(make_shared<CalculatorVector<pair<wstring, int>>>(),
|
||||
make_shared<CalculatorVector<shared_ptr<IExpressionCommand>>>());
|
||||
m_pCalcDisplay->SetExpressionDisplay(
|
||||
make_shared<CalculatorVector<pair<wstring, int>>>(), make_shared<CalculatorVector<shared_ptr<IExpressionCommand>>>());
|
||||
}
|
||||
|
||||
m_HistoryCollector.ClearHistoryLine(wstring());
|
||||
@@ -476,8 +476,8 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
|
||||
m_HistoryCollector.CompleteHistoryLine(groupedString);
|
||||
if (nullptr != m_pCalcDisplay)
|
||||
{
|
||||
m_pCalcDisplay->SetExpressionDisplay(make_shared<CalculatorVector<pair<wstring, int>>>(),
|
||||
make_shared<CalculatorVector<shared_ptr<IExpressionCommand>>>());
|
||||
m_pCalcDisplay->SetExpressionDisplay(
|
||||
make_shared<CalculatorVector<pair<wstring, int>>>(), make_shared<CalculatorVector<shared_ptr<IExpressionCommand>>>());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user