Fix cppcheck warnings. No functional change intended.

This commit is contained in:
Wilson Snyder 2018-06-14 19:04:52 -04:00
parent 7fc565a1bd
commit 9f5a4c9b22
9 changed files with 20 additions and 6 deletions

View File

@ -409,7 +409,7 @@ template <class Key,
Equal key_eq;
public:
KeyEqual() {}
bool operator()(const value_type& kv_a, const value_type kv_b) const {
bool operator()(const value_type& kv_a, const value_type& kv_b) const {
return key_eq.operator()(kv_a.first, kv_b.first);
}
};

View File

@ -5694,7 +5694,7 @@ public:
class AstSplitPlaceholder : public AstNode {
public:
// Dummy node used within V3Split; never exists outside of V3Split.
AstSplitPlaceholder(FileLine* filelinep)
explicit AstSplitPlaceholder(FileLine* filelinep)
: AstNode(filelinep) {}
ASTNODE_NODE_FUNCS(SplitPlaceholder)
};

View File

@ -207,7 +207,7 @@ private:
if (m_caseItems <= 3) return false; // Not worth simplifing
// Convert valueItem from AstCaseItem* to the expression
// Not done earlier, as we may now have a NULL because it's just a ";" NOP branch
for (uint32_t i=0; i<(1UL<<m_caseWidth); i++) {
for (uint32_t i=0; i<(1UL<<m_caseWidth); ++i) {
m_valueItem[i] = VN_CAST(m_valueItem[i], CaseItem)->bodysp();
}
return true; // All is fine
@ -467,7 +467,12 @@ private:
public:
// CONSTUCTORS
explicit CaseVisitor(AstNetlist* nodep) {
m_caseWidth = 0;
m_caseItems = 0;
m_caseNoOverlapsAllCovered = false;
for (uint32_t i=0; i<(1UL<<CASE_OVERLAP_WIDTH); ++i) {
m_valueItem[i] = NULL;
}
iterate(nodep);
}
virtual ~CaseVisitor() {

View File

@ -283,6 +283,7 @@ private:
public:
// CONSTUCTORS
explicit CleanVisitor(AstNetlist* nodep) {
m_modp = NULL;
iterate(nodep);
}
virtual ~CleanVisitor() {}

View File

@ -454,9 +454,12 @@ private:
public:
// CONSTUCTORS
explicit CombineVisitor(AstNetlist* nodep) {
m_modp=NULL;
m_funcp = NULL;
m_state = STATE_IDLE;
m_modp = NULL;
m_funcp = NULL;
m_modNFuncs = 0;
m_walkLast1p = NULL;
m_walkLast2p = NULL;
iterate(nodep);
}
virtual ~CombineVisitor() {

View File

@ -210,7 +210,8 @@ private:
public:
// CONSTRUCTORS
explicit LifePostDlyVisitor(AstNetlist* nodep)
: m_tracingCall(false) {
: m_sequence(0)
, m_tracingCall(false) {
iterate(nodep);
}
virtual ~LifePostDlyVisitor() {

View File

@ -134,6 +134,7 @@ private:
public:
// CONSTUCTORS
explicit NameVisitor(AstNetlist* nodep) {
m_modp = NULL;
iterate(nodep);
}
virtual ~NameVisitor() {}

View File

@ -406,6 +406,7 @@ public:
m_stmtp = NULL;
m_inWhilep = NULL;
m_inTracep = NULL;
m_assignLhs = false;
iterate(nodep);
}
virtual ~PremitVisitor() {}

View File

@ -126,6 +126,8 @@ public:
SplitAsCleanVisitor(AstAlways* nodep, AstVarScope* vscp, bool modeMatch) {
m_splitVscp = vscp;
m_modeMatch = modeMatch;
m_keepStmt = false;
m_matches = false;
iterate(nodep);
}
virtual ~SplitAsCleanVisitor() {}