Fix C++11 warnings

This commit is contained in:
Wilson Snyder 2022-11-12 16:02:58 -05:00
parent eaf09ba0e7
commit 218dd4322b
3 changed files with 4 additions and 2 deletions

View File

@ -2398,7 +2398,9 @@ void VerilatedContext::timeunit(int value) VL_MT_SAFE {
}
void VerilatedContext::timeprecision(int value) VL_MT_SAFE {
if (value < 0) value = -value; // Stored as 0..15
#ifdef SYSTEMC_VERSION
int sc_prec = 99;
#endif
{
const VerilatedLockGuard lock{m_mutex};
m_s.m_timeprecision = value;

View File

@ -217,7 +217,7 @@ public:
int numThreads() const { return m_workers.size(); }
VlWorkerThread* workerp(int index) {
assert(index >= 0);
assert(index < m_workers.size());
assert(static_cast<size_t>(index) < m_workers.size());
return m_workers[index];
}

View File

@ -616,7 +616,7 @@ void VerilatedTrace<VL_SUB_T, VL_BUF_T>::dump(uint64_t timeui) VL_MT_SAFE_EXCLUD
*m_offloadBufferWritep++ = VerilatedTraceOffloadCommand::END;
// Assert no buffer overflow
assert(m_offloadBufferWritep - bufferp <= m_offloadBufferSize);
assert(static_cast<size_t>(m_offloadBufferWritep - bufferp) <= m_offloadBufferSize);
// Reset our pointers as we are giving up the buffer
m_offloadBufferWritep = nullptr;