Digit should be MANTTYPE

It makes more sense that way, especially when directly cast to one.
This commit is contained in:
Rose 2022-09-30 09:21:58 -04:00
commit 150f905bde
3 changed files with 5 additions and 8 deletions

View file

@ -482,8 +482,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
ResolveHighestPrecedenceOperation(); ResolveHighestPrecedenceOperation();
while (m_fPrecedence && m_precedenceOpCount > 0) while (m_fPrecedence && m_precedenceOpCount > 0)
{ {
m_precedenceOpCount--; m_nOpCode = m_nPrecOp[--m_precedenceOpCount];
m_nOpCode = m_nPrecOp[m_precedenceOpCount];
m_lastVal = m_precedenceVals[m_precedenceOpCount]; m_lastVal = m_precedenceVals[m_precedenceOpCount];
// Precedence Inversion check // Precedence Inversion check
@ -601,9 +600,7 @@ void CCalcEngine::ProcessCommandWorker(OpCode wParam)
m_HistoryCollector.AddCloseBraceToHistory(); m_HistoryCollector.AddCloseBraceToHistory();
// Now get back the operation and opcode at the beginning of this parenthesis pair // Now get back the operation and opcode at the beginning of this parenthesis pair
m_lastVal = m_parenVals[--m_openParenCount];
m_openParenCount -= 1;
m_lastVal = m_parenVals[m_openParenCount];
m_nOpCode = m_nOp[m_openParenCount]; m_nOpCode = m_nOp[m_openParenCount];
// m_bChangeOp should be true if m_nOpCode is valid // m_bChangeOp should be true if m_nOpCode is valid

View file

@ -298,7 +298,7 @@ void _divnumx(PNUMBER* pa, PNUMBER b, int32_t precision)
while (cdigits++ < thismax && !zernum(rem)) while (cdigits++ < thismax && !zernum(rem))
{ {
int32_t digit = 0; MANTTYPE digit = 0;
*ptrc = 0; *ptrc = 0;
while (!lessnum(rem, b)) while (!lessnum(rem, b))
{ {
@ -334,7 +334,7 @@ void _divnumx(PNUMBER* pa, PNUMBER b, int32_t precision)
cdigits--; cdigits--;
if (c->mant != ++ptrc) if (c->mant != ++ptrc)
{ {
memmove(c->mant, ptrc, (int)(cdigits * sizeof(MANTTYPE))); memmove(c->mant, ptrc, cdigits * sizeof(MANTTYPE));
} }
if (!cdigits) if (!cdigits)

View file

@ -573,7 +573,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
temp[i] = data[j++]; temp[i] = data[j++];
} }
temp[i] = L'\0'; temp[i] = L'\0';
commandIndex += 1; commandIndex++;
} }
} }