diff --git a/include/verilated_vcd_c.cpp b/include/verilated_vcd_c.cpp index 9f3f5c72e..ff5ea45cc 100644 --- a/include/verilated_vcd_c.cpp +++ b/include/verilated_vcd_c.cpp @@ -569,7 +569,7 @@ void VerilatedVcd::declare (vluint32_t code, const char* name, const char* wirep sprintf(buf, " %2d ", bits); decl += buf; if (m_evcd) { - sprintf(buf, "<%d", code); + sprintf(buf, "<%u", code); decl += buf; } else { decl += stringCode(code); diff --git a/src/V3Case.cpp b/src/V3Case.cpp index 97bb08f30..1417f6d1e 100644 --- a/src/V3Case.cpp +++ b/src/V3Case.cpp @@ -166,7 +166,7 @@ private: } UINFO(8,"Simple case statement: "<fileline(), iconstp->width()); numval.opBitsOne(iconstp->num()); uint32_t val = numval.toUInt(); - for (uint32_t i=0; i<(1UL<isDefault()) { // Case statement's default... Fill the table - for (uint32_t i=0; i<(1UL<v3warn(CASEINCOMPLETE,"Case values incompletely covered (example pattern 0x"<exprp()->unlinkFrBack(); if (debug()>=9) { - for (uint32_t i=0; i<(1UL<varp()->prettyName()); } } - AstVarScope* createVarSc(AstVarScope* oldvarscp, string name, int width/*0==fromoldvar*/, AstNodeDType* newdtypep) { + AstVarScope* createVarSc(AstVarScope* oldvarscp, const string& name, + int width/*0==fromoldvar*/, AstNodeDType* newdtypep) { // Because we've already scoped it, we may need to add both the AstVar and the AstVarScope if (!oldvarscp->scopep()) oldvarscp->v3fatalSrc("Var unscoped"); AstVar* varp; diff --git a/src/V3DepthBlock.cpp b/src/V3DepthBlock.cpp index 42792f250..a201bb3c9 100644 --- a/src/V3DepthBlock.cpp +++ b/src/V3DepthBlock.cpp @@ -126,8 +126,10 @@ private: public: // CONSTUCTORS explicit DepthBlockVisitor(AstNetlist* nodep) { - m_modp=NULL; - m_depth=0; + m_modp = NULL; + m_funcp = NULL; + m_depth = 0; + m_deepNum = 0; // nodep->accept(*this); } diff --git a/src/V3EmitC.cpp b/src/V3EmitC.cpp index 3a9f4c08e..7fd7b8c5d 100644 --- a/src/V3EmitC.cpp +++ b/src/V3EmitC.cpp @@ -993,7 +993,7 @@ class EmitCImp : EmitCStmts { // High level void emitImp(AstNodeModule* modp); void emitStaticDecl(AstNodeModule* modp); - void emitSettleLoop(std::string eval_call, bool initial); + void emitSettleLoop(const std::string& eval_call, bool initial); void emitWrapEval(AstNodeModule* modp); void emitInt(AstNodeModule* modp); void maybeSplit(AstNodeModule* modp); @@ -1752,7 +1752,7 @@ void EmitCImp::emitSensitives() { } } -void EmitCImp::emitSettleLoop(std::string eval_call, bool initial) { +void EmitCImp::emitSettleLoop(const std::string& eval_call, bool initial) { putsDecoration("// Evaluate till stable\n"); puts("int __VclockLoop = 0;\n"); puts("QData __Vchange = 1;\n"); diff --git a/src/V3Expand.cpp b/src/V3Expand.cpp index bff192936..d66e6157a 100644 --- a/src/V3Expand.cpp +++ b/src/V3Expand.cpp @@ -829,6 +829,8 @@ private: // Rather than doing a (slowish) ==##, we OR in the bits that aren't part of the mask eqp = new AstOr (nodep->fileline(), new AstConst (nodep->fileline(), notWideMask(nodep->lhsp())), + // Bug in cppcheck + // cppcheck-suppress memleak eqp); } newp = (newp==NULL) ? eqp : (new AstAnd (nodep->fileline(), newp, eqp)); diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 6950277ca..723dd15dd 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -1612,7 +1612,7 @@ void OrderVisitor::process() { UINFO(2," Process Circulars...\n"); processCircular(); // must be before processDomains - // Assign logic verticesto new domains + // Assign logic vertices to new domains UINFO(2," Domains...\n"); processDomains(); m_graph.dumpDotFilePrefixed("orderg_domain"); diff --git a/src/V3Os.cpp b/src/V3Os.cpp index fb39cd98b..55c65201b 100644 --- a/src/V3Os.cpp +++ b/src/V3Os.cpp @@ -211,9 +211,9 @@ uint64_t V3Os::memUsageBytes() { if (!fp) { return 0; } - uint64_t size, resident, share, text, lib, data, dt; // All in pages - if (7 != fscanf(fp, "%" VL_PRI64 "d %" VL_PRI64 "d %" VL_PRI64 "d %" - VL_PRI64 "d %" VL_PRI64 "d %" VL_PRI64 "d %" VL_PRI64 "d", + vluint64_t size, resident, share, text, lib, data, dt; // All in pages + if (7 != fscanf(fp, "%" VL_PRI64 "u %" VL_PRI64 "u %" VL_PRI64 "u %" + VL_PRI64 "u %" VL_PRI64 "u %" VL_PRI64 "u %" VL_PRI64 "u", &size, &resident, &share, &text, &lib, &data, &dt)) { fclose(fp); return 0; diff --git a/src/V3Task.cpp b/src/V3Task.cpp index bd99f3133..9832b2d72 100644 --- a/src/V3Task.cpp +++ b/src/V3Task.cpp @@ -1258,7 +1258,9 @@ public: m_modp = NULL; m_topScopep = NULL; m_scopep = NULL; + m_insMode = IM_BEFORE; m_insStmtp = NULL; + m_modNCalls = 0; AstNode::user1ClearTree(); nodep->accept(*this); } diff --git a/src/V3Trace.cpp b/src/V3Trace.cpp index 5f3abdaf5..35714c3a5 100644 --- a/src/V3Trace.cpp +++ b/src/V3Trace.cpp @@ -700,6 +700,8 @@ public: m_chgSubFuncp = NULL; m_chgSubParentp = NULL; m_chgSubStmts = 0; + m_code = 0; + m_finding = false; m_funcNum = 0; nodep->accept(*this); } diff --git a/src/V3Unroll.cpp b/src/V3Unroll.cpp index 55ab2227f..bd7448a59 100644 --- a/src/V3Unroll.cpp +++ b/src/V3Unroll.cpp @@ -461,9 +461,11 @@ public: UnrollVisitor(AstNode* nodep, bool generate, const string& beginName) { m_forVarp = NULL; m_forVscp = NULL; + m_varValuep = NULL; m_ignoreIncp = NULL; m_varModeCheck = false; m_varModeReplace = false; + m_varAssignHit = false; m_generate = generate; m_beginName = beginName; //