Internals: Fix remaining cppcheck errors (#6319)

Fixed the non const-related issue and added suppressions for the const
ones. With that `make cppcheck` should be clean.
This commit is contained in:
Geza Lore
2025-08-21 09:43:37 +01:00
committed by GitHub
parent bd91b619ad
commit 327d55d13d
64 changed files with 266 additions and 134 deletions
+3 -3
View File
@@ -383,7 +383,7 @@ class InlineRelinkVisitor final : public VNVisitor {
iterateChildren(nodep);
}
void visit(AstNodeAssign* nodep) override {
if (AstVarRef* const varrefp = VN_CAST(nodep->lhsp(), VarRef)) {
if (const AstVarRef* const varrefp = VN_CAST(nodep->lhsp(), VarRef)) {
if (m_initialStatic && varrefp->varp()->user2() && varrefp->varp()->user4()) {
// Initial assignment to i/o we are overriding, can remove
UINFO(9, "Remove InitialStatic " << nodep);
@@ -400,7 +400,7 @@ class InlineRelinkVisitor final : public VNVisitor {
&& !VN_IS(nodep->backp(), AssignAlias)
// Forced signals do not use aliases
&& !nodep->varp()->isForced()) {
AstVar* const varp = nodep->varp();
const AstVar* const varp = nodep->varp();
if (AstConst* const constp = VN_CAST(varp->user2p(), Const)) {
nodep->replaceWith(constp->cloneTree(false));
VL_DO_DANGLING(nodep->deleteTree(), nodep);
@@ -426,7 +426,7 @@ class InlineRelinkVisitor final : public VNVisitor {
if (pos == string::npos || pos == 0) {
break;
} else {
tryname = tryname.substr(0, pos);
tryname.resize(pos);
}
}
iterateChildren(nodep);