Fix cppcheck warnings. No functional change intended.

This commit is contained in:
Wilson Snyder
2020-12-23 15:22:02 -05:00
parent 941e5c659a
commit b7a533109d
19 changed files with 38 additions and 41 deletions
+2
View File
@@ -727,11 +727,13 @@ AstNodeDType* AstNodeDType::dtypeDimensionp(int dimension) {
} else if (AstBasicDType* adtypep = VN_CAST(dtypep, BasicDType)) {
// AstBasicDType - nothing below, return null
if (adtypep->isRanged()) {
// cppcheck-suppress unreadVariable // Cppcheck bug - thinks dim isn't used
if ((dim++) == dimension) return adtypep;
}
return nullptr;
} else if (AstNodeUOrStructDType* adtypep = VN_CAST(dtypep, NodeUOrStructDType)) {
if (adtypep->packed()) {
// cppcheck-suppress unreadVariable // Cppcheck bug - thinks dim isn't used
if ((dim++) == dimension) return adtypep;
}
return nullptr;