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
+2 -2
View File
@@ -269,9 +269,9 @@ class ScopeVisitor final : public VNVisitor {
// Make new scope variable
if (!nodep->user1p()) {
AstScope* scopep = m_scopep;
if (AstIfaceRefDType* const ifacerefp = VN_CAST(nodep->dtypep(), IfaceRefDType)) {
if (const AstIfaceRefDType* const ifrefp = VN_CAST(nodep->dtypep(), IfaceRefDType)) {
// Attach every non-virtual interface variable its inner scope
if (ifacerefp->cellp()) scopep = VN_AS(ifacerefp->cellp()->user2p(), Scope);
if (ifrefp->cellp()) scopep = VN_AS(ifrefp->cellp()->user2p(), Scope);
}
AstVarScope* const varscp = new AstVarScope{nodep->fileline(), scopep, nodep};
UINFO(6, " New scope " << varscp);