Fix compiler warnings

* Explicitly cast to types.
* Mark parameter unused in release.
This commit is contained in:
Kawe Mazidjatari 2023-04-10 23:45:09 +02:00
parent c6915fcf42
commit 2aa20fbf18
2 changed files with 4 additions and 2 deletions

View File

@ -457,10 +457,10 @@ template <typename BITCOUNTTYPE>
inline CVarBitVecBase<BITCOUNTTYPE>::CVarBitVecBase(int numBits)
{
Assert( numBits );
m_numBits = numBits;
m_numBits = BITCOUNTTYPE( numBits );
// Figure out how many ints are needed
m_numInts = CalcNumIntsForBits( numBits );
m_numInts = BITCOUNTTYPE( CalcNumIntsForBits( numBits ) );
m_pInt = NULL;
AllocInts( m_numInts );
}

View File

@ -454,6 +454,8 @@ inline void bf_write::WriteOneBitAt(int iBit, int nValue)
}
}
Assert(numbits >= 0 && numbits <= 32);
#else
NOTE_UNUSED(bCheckRange);
#endif
// Bounds checking..