Replace INT -> int

This commit is contained in:
Michał Janiszewski 2019-03-08 21:50:41 +01:00
commit 3a85bbe244
2 changed files with 9 additions and 9 deletions

View file

@ -31,7 +31,7 @@ namespace {
// //
// 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
// 0 is returned. Higher the number, higher the precedence of the operator. // 0 is returned. Higher the number, higher the precedence of the operator.
INT NPrecedenceOfOp(int nopCode) int NPrecedenceOfOp(int nopCode)
{ {
static BYTE rgbPrec[] = { 0,0, IDC_OR,0, IDC_XOR,0, IDC_AND,1, static BYTE rgbPrec[] = { 0,0, IDC_OR,0, IDC_XOR,0, IDC_AND,1,
IDC_ADD,2, IDC_SUB,2, IDC_RSHF,3, IDC_LSHF,3, IDC_ADD,2, IDC_SUB,2, IDC_RSHF,3, IDC_LSHF,3,
@ -96,7 +96,7 @@ void CCalcEngine::ProcessCommand(WPARAM wParam)
void CCalcEngine::ProcessCommandWorker(WPARAM wParam) void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
{ {
INT nx, ni; int nx, ni;
// Save the last command. Some commands are not saved in this manor, these // Save the last command. Some commands are not saved in this manor, these
// commands are: // commands are:
@ -107,7 +107,7 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
if (!IsGuiSettingOpCode(wParam)) if (!IsGuiSettingOpCode(wParam))
{ {
m_nLastCom = m_nTempCom; m_nLastCom = m_nTempCom;
m_nTempCom = (INT)wParam; m_nTempCom = (int)wParam;
} }
if (m_bError) if (m_bError)
@ -185,10 +185,10 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
// Change the operation if last input was operation. // Change the operation if last input was operation.
if (IsBinOpCode(m_nLastCom)) if (IsBinOpCode(m_nLastCom))
{ {
INT nPrev; int nPrev;
bool fPrecInvToHigher = false; // Is Precedence Inversion from lower to higher precedence happening ?? bool fPrecInvToHigher = false; // Is Precedence Inversion from lower to higher precedence happening ??
m_nOpCode = (INT)wParam; m_nOpCode = (int)wParam;
// Check to see if by changing this binop, a Precedence inversion is happening. // Check to see if by changing this binop, a Precedence inversion is happening.
// Eg. 1 * 2 + and + is getting changed to ^. The previous precedence rules would have already computed // Eg. 1 * 2 + and + is getting changed to ^. The previous precedence rules would have already computed
@ -285,7 +285,7 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
DisplayAnnounceBinaryOperator(); DisplayAnnounceBinaryOperator();
m_lastVal = m_currentVal; m_lastVal = m_currentVal;
m_nOpCode = (INT)wParam; m_nOpCode = (int)wParam;
m_HistoryCollector.AddBinOpToHistory(m_nOpCode); m_HistoryCollector.AddBinOpToHistory(m_nOpCode);
m_bNoPrevEqu = m_bChangeOp = true; m_bNoPrevEqu = m_bChangeOp = true;
return; return;
@ -313,7 +313,7 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
m_HistoryCollector.AddOpndToHistory(m_numberString, m_currentVal); m_HistoryCollector.AddOpndToHistory(m_numberString, m_currentVal);
} }
m_HistoryCollector.AddUnaryOpToHistory((INT)wParam, m_bInv, m_angletype); m_HistoryCollector.AddUnaryOpToHistory((int)wParam, m_bInv, m_angletype);
} }
if ((wParam == IDC_SIN) || (wParam == IDC_COS) || (wParam == IDC_TAN) || (wParam == IDC_SINH) || (wParam == IDC_COSH) || (wParam == IDC_TANH)) if ((wParam == IDC_SIN) || (wParam == IDC_COS) || (wParam == IDC_TAN) || (wParam == IDC_SINH) || (wParam == IDC_COSH) || (wParam == IDC_TANH))
@ -442,7 +442,7 @@ void CCalcEngine::ProcessCommandWorker(WPARAM wParam)
m_nTempCom = m_nLastCom; // Put back this last saved command to the prev state so ) can be handled properly m_nTempCom = m_nLastCom; // Put back this last saved command to the prev state so ) can be handled properly
ProcessCommand(IDC_CLOSEP); ProcessCommand(IDC_CLOSEP);
m_nLastCom = m_nTempCom; // Actually this is IDC_CLOSEP m_nLastCom = m_nTempCom; // Actually this is IDC_CLOSEP
m_nTempCom = (INT)wParam; // put back in the state where last op seen was IDC_CLOSEP, and current op is IDC_EQU m_nTempCom = (int)wParam; // put back in the state where last op seen was IDC_CLOSEP, and current op is IDC_EQU
} }
if (!m_bNoPrevEqu) if (!m_bNoPrevEqu)

View file

@ -39,7 +39,7 @@ typedef struct {
Rational value; Rational value;
int32_t precision; int32_t precision;
uint32_t radix; uint32_t radix;
INT nFE; int nFE;
NUM_WIDTH numwidth; NUM_WIDTH numwidth;
bool fIntMath; bool fIntMath;
bool bRecord; bool bRecord;