Fix cppcheck warnings
This commit is contained in:
parent
45702e319b
commit
7369500bb7
|
|
@ -131,7 +131,8 @@ class VL_SCOPED_CAPABILITY VerilatedLockGuard {
|
||||||
private:
|
private:
|
||||||
VerilatedMutex& m_mutexr;
|
VerilatedMutex& m_mutexr;
|
||||||
public:
|
public:
|
||||||
VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr) : m_mutexr(mutexr) {
|
explicit VerilatedLockGuard(VerilatedMutex& mutexr) VL_ACQUIRE(mutexr)
|
||||||
|
: m_mutexr(mutexr) {
|
||||||
m_mutexr.lock();
|
m_mutexr.lock();
|
||||||
}
|
}
|
||||||
~VerilatedLockGuard() VL_RELEASE() {
|
~VerilatedLockGuard() VL_RELEASE() {
|
||||||
|
|
@ -144,8 +145,9 @@ class VL_SCOPED_CAPABILITY VerilatedLockGuard {
|
||||||
// Empty classes to avoid #ifdefs everywhere
|
// Empty classes to avoid #ifdefs everywhere
|
||||||
class VerilatedMutex {};
|
class VerilatedMutex {};
|
||||||
class VerilatedLockGuard {
|
class VerilatedLockGuard {
|
||||||
|
VL_UNCOPYABLE(VerilatedLockGuard);
|
||||||
public:
|
public:
|
||||||
VerilatedLockGuard(VerilatedMutex&) {}
|
explicit VerilatedLockGuard(VerilatedMutex&) {}
|
||||||
~VerilatedLockGuard() {}
|
~VerilatedLockGuard() {}
|
||||||
};
|
};
|
||||||
#endif // VL_THREADED
|
#endif // VL_THREADED
|
||||||
|
|
@ -164,11 +166,11 @@ public:
|
||||||
// METHODS
|
// METHODS
|
||||||
/// Check that the current thread ID is the same as the construction thread ID
|
/// Check that the current thread ID is the same as the construction thread ID
|
||||||
void check() VL_MT_UNSAFE_ONE {
|
void check() VL_MT_UNSAFE_ONE {
|
||||||
// Memoize results in local thread, to prevent slow get_id() call
|
// Memoize results in local thread, to prevent slow get_id() call
|
||||||
VL_THREAD_LOCAL bool t_okThread = (m_threadid == VL_THREAD_ID());
|
VL_THREAD_LOCAL bool t_okThread = (m_threadid == VL_THREAD_ID());
|
||||||
if (!VL_LIKELY(t_okThread)) {
|
if (!VL_LIKELY(t_okThread)) {
|
||||||
fatal_different();
|
fatal_different();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static void fatal_different() VL_MT_SAFE;
|
static void fatal_different() VL_MT_SAFE;
|
||||||
#else // !VL_THREADED || !VL_DEBUG
|
#else // !VL_THREADED || !VL_DEBUG
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,8 @@ class VerilatedImp {
|
||||||
|
|
||||||
public: // But only for verilated*.cpp
|
public: // But only for verilated*.cpp
|
||||||
// CONSTRUCTORS
|
// CONSTRUCTORS
|
||||||
VerilatedImp() : m_argVecLoaded(false), m_exportNext(0) {
|
VerilatedImp()
|
||||||
|
: m_argVecLoaded(false), m_exportNext(0), m_spawned(false), m_numThreads(0) {
|
||||||
m_fdps.resize(3);
|
m_fdps.resize(3);
|
||||||
m_fdps[0] = stdin;
|
m_fdps[0] = stdin;
|
||||||
m_fdps[1] = stdout;
|
m_fdps[1] = stdout;
|
||||||
|
|
|
||||||
|
|
@ -1738,8 +1738,8 @@ void vpi_put_value_array(vpiHandle object, p_vpi_arrayvalue arrayvalue_p,
|
||||||
// time processing
|
// time processing
|
||||||
|
|
||||||
void vpi_get_time(vpiHandle object, p_vpi_time time_p) {
|
void vpi_get_time(vpiHandle object, p_vpi_time time_p) {
|
||||||
// cppcheck-suppress nullPointer
|
|
||||||
VerilatedVpiImp::assertOneCheck();
|
VerilatedVpiImp::assertOneCheck();
|
||||||
|
// cppcheck-suppress nullPointer
|
||||||
if (VL_UNLIKELY(!time_p)) {
|
if (VL_UNLIKELY(!time_p)) {
|
||||||
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_get_time with NULL value pointer");
|
_VL_VPI_WARNING(__FILE__, __LINE__, "Ignoring vpi_get_time with NULL value pointer");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -518,15 +518,6 @@ private:
|
||||||
return varVxp;
|
return varVxp;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isClkAssign(AstNodeAssign* nodep) {
|
|
||||||
if (AstVarRef* varrefp = nodep->lhsp()->castVarRef()) {
|
|
||||||
if (varrefp->varp()->attrClocker() == AstVarAttrClocker::CLOCKER_YES) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void process();
|
void process();
|
||||||
void processCircular();
|
void processCircular();
|
||||||
typedef deque<OrderEitherVertex*> VertexVec;
|
typedef deque<OrderEitherVertex*> VertexVec;
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ public:
|
||||||
m_ahead = false;
|
m_ahead = false;
|
||||||
m_curBisonVal.token = 0;
|
m_curBisonVal.token = 0;
|
||||||
m_prevBisonVal.token = 0;
|
m_prevBisonVal.token = 0;
|
||||||
// m_aheadVal not used as m_ahead = false
|
// m_aheadVal not used as m_ahead = false, and not all compilers support initing it
|
||||||
m_tagNodep = NULL;
|
m_tagNodep = NULL;
|
||||||
}
|
}
|
||||||
~V3ParseImp();
|
~V3ParseImp();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue