mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
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:
+3
-1
@@ -186,6 +186,7 @@ private:
|
||||
|
||||
// VISITORS
|
||||
void visit(AstVar* nodep) override {
|
||||
// cppcheck-suppress constVariablePointer
|
||||
AstNode* const dtp = nodep->dtypep()->skipRefp();
|
||||
if (VN_IS(dtp, UnpackArrayDType)
|
||||
&& VN_IS(VN_AS(dtp, UnpackArrayDType)->subDTypep()->skipRefp(), IfaceRefDType)) {
|
||||
@@ -236,6 +237,7 @@ private:
|
||||
m_cellRangep = nodep->rangep();
|
||||
|
||||
AstVar* const ifaceVarp = VN_CAST(nodep->nextp(), Var);
|
||||
// cppcheck-suppress constVariablePointer
|
||||
AstNodeDType* const ifaceVarDtp
|
||||
= ifaceVarp ? ifaceVarp->dtypep()->skipRefp() : nullptr;
|
||||
const bool isIface
|
||||
@@ -579,7 +581,7 @@ public:
|
||||
class InstStatic final {
|
||||
InstStatic() = default; // Static class
|
||||
|
||||
static AstNodeExpr* extendOrSel(FileLine* fl, AstNodeExpr* rhsp, AstNode* cmpWidthp) {
|
||||
static AstNodeExpr* extendOrSel(FileLine* fl, AstNodeExpr* rhsp, const AstNode* cmpWidthp) {
|
||||
if (cmpWidthp->width() > rhsp->width()) {
|
||||
rhsp = (rhsp->isSigned() ? static_cast<AstNodeExpr*>(new AstExtendS{fl, rhsp})
|
||||
: static_cast<AstNodeExpr*>(new AstExtend{fl, rhsp}));
|
||||
|
||||
Reference in New Issue
Block a user