Fix MSVC warnings. No functional change intended.

This commit is contained in:
Wilson Snyder 2024-06-07 22:52:43 -04:00
parent 0d3cb86a44
commit 708f875b31
3 changed files with 6 additions and 6 deletions

View File

@ -820,9 +820,9 @@ public:
AstNodeDType* skipRefToEnump() const override { return (AstNodeDType*)this; }
int widthAlignBytes() const override { return subDTypep()->widthAlignBytes(); }
int widthTotalBytes() const override { return subDTypep()->widthTotalBytes(); }
int itemCount() const {
size_t itemCount() const {
size_t count = 0;
for (AstNode* itemp = itemsp(); itemp; itemp = itemp->nextp()) count++;
for (AstNode* itemp = itemsp(); itemp; itemp = itemp->nextp()) ++count;
return count;
}
bool isCompound() const override { return false; }

View File

@ -493,7 +493,7 @@ string V3Options::fileExists(const string& filename) {
try {
for (const auto& dirEntry : std::filesystem::directory_iterator(dir.c_str()))
setp->insert(dirEntry.path().filename().string());
} catch (std::filesystem::filesystem_error const& ex) { return ""; }
} catch (std::filesystem::filesystem_error const& ex) { (void)ex; return ""; }
#else
if (DIR* const dirp = opendir(dir.c_str())) {
while (struct dirent* direntp = readdir(dirp)) setp->insert(direntp->d_name);

View File

@ -309,9 +309,9 @@ class RandomizeVisitor final : public VNVisitor {
AstVar* enumValueTabp(AstEnumDType* nodep) {
if (nodep->user2p()) return VN_AS(nodep->user2p(), Var);
UINFO(9, "Construct Venumvaltab " << nodep << endl);
AstNodeArrayDType* const vardtypep
= new AstUnpackArrayDType{nodep->fileline(), nodep->dtypep(),
new AstRange{nodep->fileline(), nodep->itemCount(), 0}};
AstNodeArrayDType* const vardtypep = new AstUnpackArrayDType{
nodep->fileline(), nodep->dtypep(),
new AstRange{nodep->fileline(), static_cast<int>(nodep->itemCount()), 0}};
AstInitArray* const initp = new AstInitArray{nodep->fileline(), vardtypep, nullptr};
v3Global.rootp()->typeTablep()->addTypesp(vardtypep);
AstVar* const varp