Skip to content

Commit d849421

Browse files
committed
Digit should be MANTTYPE
It makes more sense that way, especially when directly cast to one.
1 parent b0f3002 commit d849421

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/CalcManager/CEngine/scicomm.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,8 +482,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
482482
ResolveHighestPrecedenceOperation();
483483
while (m_fPrecedence && m_precedenceOpCount > 0)
484484
{
485-
m_precedenceOpCount--;
486-
m_nOpCode = m_nPrecOp[m_precedenceOpCount];
485+
m_nOpCode = m_nPrecOp[--m_precedenceOpCount];
487486
m_lastVal = m_precedenceVals[m_precedenceOpCount];
488487

489488
// Precedence Inversion check
@@ -601,9 +600,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
601600
m_HistoryCollector.AddCloseBraceToHistory();
602601

603602
// Now get back the operation and opcode at the beginning of this parenthesis pair
604-
605-
m_openParenCount -= 1;
606-
m_lastVal = m_parenVals[m_openParenCount];
603+
m_lastVal = m_parenVals[--m_openParenCount];
607604
m_nOpCode = m_nOp[m_openParenCount];
608605

609606
// m_bChangeOp should be true if m_nOpCode is valid

src/CalcManager/Ratpack/basex.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ void _divnumx(PNUMBER* pa, PNUMBER b, int32_t precision)
298298

299299
while (cdigits++ < thismax && !zernum(rem))
300300
{
301-
int32_t digit = 0;
301+
MANTTYPE digit = 0;
302302
*ptrc = 0;
303303
while (!lessnum(rem, b))
304304
{
@@ -334,7 +334,7 @@ void _divnumx(PNUMBER* pa, PNUMBER b, int32_t precision)
334334
cdigits--;
335335
if (c->mant != ++ptrc)
336336
{
337-
memmove(c->mant, ptrc, (int)(cdigits * sizeof(MANTTYPE)));
337+
memmove(c->mant, ptrc, cdigits * sizeof(MANTTYPE));
338338
}
339339

340340
if (!cdigits)

src/CalcViewModel/StandardCalculatorViewModel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
573573
temp[i] = data[j++];
574574
}
575575
temp[i] = L'\0';
576-
commandIndex += 1;
576+
commandIndex++;
577577
}
578578
}
579579

0 commit comments

Comments
 (0)