Skip to content

Commit

Permalink
Fix build warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
MikePopoloski committed Nov 24, 2024
1 parent 72f4451 commit 0e36d87
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/slang/syntax/SyntaxTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SLANG_EXPORT SyntaxTree {
bool isLibraryUnit = false;

SyntaxTree(SyntaxNode* root, SourceManager& sourceManager, BumpAllocator&& alloc,
const SourceLibrary* library, std::shared_ptr<SyntaxTree> parent = nullptr);
const SourceLibrary* library, const std::shared_ptr<SyntaxTree>& parent = nullptr);

SyntaxTree(SyntaxTree&& other) = default;
~SyntaxTree();
Expand Down
4 changes: 2 additions & 2 deletions source/ast/statements/ConditionalStatements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class CaseTrie {
CaseTrie* curr = this;
const auto width = value.getBitWidth();
for (uint32_t i = 0; i < width; i++) {
const auto bit = value[i];
const auto bit = value[(int32_t)i];
const bool isWildcard = wildcardX ? bit.isUnknown() : bit.value == logic_t::Z_VALUE;
const auto valueIndex = isWildcard ? 3 : bit.isUnknown() ? 2 : bit.value;

Expand All @@ -226,7 +226,7 @@ class CaseTrie {
private:
const Expression* find(const SVInt& value, uint32_t bitIndex, const Expression& expr,
bool wildcardX) {
const auto bit = value[bitIndex];
const auto bit = value[(int32_t)bitIndex];
const bool lastBit = bitIndex == value.getBitWidth() - 1;
const bool isWildcard = wildcardX ? bit.isUnknown() : bit.value == logic_t::Z_VALUE;
const auto valueIndex = bit.isUnknown() ? 2 : bit.value;
Expand Down
2 changes: 1 addition & 1 deletion source/syntax/SyntaxTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace slang::syntax {
using namespace parsing;

SyntaxTree::SyntaxTree(SyntaxNode* root, SourceManager& sourceManager, BumpAllocator&& alloc,
const SourceLibrary* library, std::shared_ptr<SyntaxTree> parent) :
const SourceLibrary* library, const std::shared_ptr<SyntaxTree>& parent) :
rootNode(root), library(library), sourceMan(sourceManager), alloc(std::move(alloc)) {
metadata = std::make_unique<ParserMetadata>(ParserMetadata::fromSyntax(*root));
if (parent) { // copy parent's info
Expand Down

0 comments on commit 0e36d87

Please sign in to comment.