/W4: Fix verbose compiler warnings caused by incorrect type conversion

Fixed bug caused by incorrect type conversion. Type should be as wide as the type used for 'CUtlMemory::m_nAllocationCount', which is 64-bits on this particular implementation.
This commit is contained in:
Kawe Mazidjatari 2023-04-02 15:51:08 +02:00
parent 09553e3e2c
commit 922709f4d9

View File

@ -703,7 +703,7 @@ inline bool CUtlMemory<T, I>::IsIdxValid(I i) const
{
// GCC warns if I is an unsigned type and we do a ">= 0" against it (since the comparison is always 0).
// We get the warning even if we cast inside the expression. It only goes away if we assign to another variable.
long x = i;
int64 x = i;
return (x >= 0) && (x < m_nAllocationCount);
}