Skip to content

Commit

Permalink
Fix initialization order in CEngine (microsoft#118)
Browse files Browse the repository at this point in the history
The order of initialization of fields is required to match the one in
class member fields declaration.
  • Loading branch information
janisozaur authored and mcooley committed Mar 6, 2019
1 parent 1eb717f commit 07ff1c3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/CalcManager/CEngine/History.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ void CHistoryCollector::ReinitHistory()
CHistoryCollector::CHistoryCollector(ICalcDisplay *pCalcDisplay, std::shared_ptr<IHistoryDisplay> pHistoryDisplay, wchar_t decimalSymbol) :
m_pHistoryDisplay(pHistoryDisplay),
m_pCalcDisplay(pCalcDisplay),
m_decimalSymbol(decimalSymbol),
m_iCurLineHistStart(-1)
m_iCurLineHistStart(-1),
m_decimalSymbol(decimalSymbol)
{
ReinitHistory();
}
Expand Down
36 changes: 18 additions & 18 deletions src/CalcManager/CEngine/calc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,41 +55,41 @@ void CCalcEngine::InitialOneTimeOnlySetup(CalculationManager::IResourceProvider&
//
//////////////////////////////////////////////////
CCalcEngine::CCalcEngine(bool fPrecedence, bool fIntegerMode, CalculationManager::IResourceProvider* const pResourceProvider, __in_opt ICalcDisplay *pCalcDisplay, __in_opt shared_ptr<IHistoryDisplay> pHistoryDisplay) :
m_HistoryCollector(pCalcDisplay, pHistoryDisplay, DEFAULT_DEC_SEPARATOR),
m_resourceProvider(pResourceProvider),
m_bSetCalcState(false),
m_fPrecedence(fPrecedence),
m_fIntegerMode(fIntegerMode),
m_pCalcDisplay(pCalcDisplay),
m_input(DEFAULT_DEC_SEPARATOR),
m_resourceProvider(pResourceProvider),
m_nOpCode(0),
m_nPrevOpCode(0),
m_openParenCount(0),
m_precedenceOpCount(0),
m_nTempCom(0),
m_nLastCom(0),
m_parenVals{},
m_precedenceVals{},
m_bChangeOp(false),
m_bRecord(false),
m_bSetCalcState(false),
m_input(DEFAULT_DEC_SEPARATOR),
m_nFE(FMT_FLOAT),
m_memoryValue{ make_unique<Rational>() },
m_holdVal{},
m_currentVal{},
m_lastVal{},
m_parenVals{},
m_precedenceVals{},
m_bError(false),
m_bInv(false),
m_nFE(FMT_FLOAT),
m_bNoPrevEqu(true),
m_numwidth(QWORD_WIDTH),
m_angletype(ANGLE_DEG),
m_radix(DEFAULT_RADIX),
m_precision(DEFAULT_PRECISION),
m_cIntDigitsSav(DEFAULT_MAX_DIGITS),
m_decGrouping(),
m_groupSeparator(DEFAULT_GRP_SEPARATOR),
m_numberString(DEFAULT_NUMBER_STR),
m_nTempCom(0),
m_openParenCount(0),
m_nOp(),
m_nPrecOp(),
m_memoryValue{ make_unique<Rational>() },
m_holdVal{},
m_currentVal{},
m_lastVal{}
m_precedenceOpCount(0),
m_nLastCom(0),
m_angletype(ANGLE_DEG),
m_numwidth(QWORD_WIDTH),
m_HistoryCollector(pCalcDisplay, pHistoryDisplay, DEFAULT_DEC_SEPARATOR),
m_groupSeparator(DEFAULT_GRP_SEPARATOR)
{
InitChopNumbers();

Expand Down
10 changes: 5 additions & 5 deletions src/CalcManager/Header Files/CalcInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ namespace CalcEngine
{
public:
CalcNumSec() :
m_isNegative(false),
value()
value(),
m_isNegative(false)
{}

void Clear();
Expand All @@ -37,12 +37,12 @@ namespace CalcEngine
{}

CalcInput(wchar_t decSymbol) :
m_base(),
m_exponent(),
m_hasExponent(false),
m_hasDecimal(false),
m_decPtIndex(0),
m_decSymbol(decSymbol)
m_decSymbol(decSymbol),
m_base(),
m_exponent()
{}

void Clear();
Expand Down

0 comments on commit 07ff1c3

Please sign in to comment.