From 218dd4322bd1d297f0ab8986f941fe68c95371cf Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 12 Nov 2022 16:02:58 -0500 Subject: [PATCH] Fix C++11 warnings --- include/verilated.cpp | 2 ++ include/verilated_threads.h | 2 +- include/verilated_trace_imp.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/verilated.cpp b/include/verilated.cpp index 148c5b459..e88fc0c1b 100644 --- a/include/verilated.cpp +++ b/include/verilated.cpp @@ -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; diff --git a/include/verilated_threads.h b/include/verilated_threads.h index 6100ac057..e4c2b9cc3 100644 --- a/include/verilated_threads.h +++ b/include/verilated_threads.h @@ -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(index) < m_workers.size()); return m_workers[index]; } diff --git a/include/verilated_trace_imp.h b/include/verilated_trace_imp.h index 7718ded13..c863649c6 100644 --- a/include/verilated_trace_imp.h +++ b/include/verilated_trace_imp.h @@ -616,7 +616,7 @@ void VerilatedTrace::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(m_offloadBufferWritep - bufferp) <= m_offloadBufferSize); // Reset our pointers as we are giving up the buffer m_offloadBufferWritep = nullptr;