Skip to content

Commit

Permalink
silence some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
aiju committed Jul 25, 2024
1 parent 21d6f96 commit 42426cb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
8 changes: 5 additions & 3 deletions kernel/drivertools.h
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,8 @@ struct DriveBit
case DriveType::MULTIPLE:
inner = multiple_.hash();
break;
default:
log_abort();
}
return mkhash((unsigned int)type_, inner);
}
Expand All @@ -412,7 +414,7 @@ struct DriveBit
case DriveType::MULTIPLE:
return multiple_ == other.multiple_;
}
log_assert(false);
log_abort();
}

bool operator!=(const DriveBit &other) const
Expand Down Expand Up @@ -958,7 +960,7 @@ struct DriveChunk
case DriveType::MULTIPLE:
return multiple_ == other.multiple_;
}
log_assert(false);
log_abort();
}

bool operator!=(const DriveChunk &other) const
Expand All @@ -985,7 +987,7 @@ struct DriveChunk
case DriveType::MULTIPLE:
return multiple_ < other.multiple_;
}
log_assert(false);
log_abort();
}

DriveType type() const { return type_; }
Expand Down
3 changes: 2 additions & 1 deletion kernel/functional.h
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ namespace Functional {
case Fn::memory_read: return v.memory_read(*this, arg(0), arg(1)); break;
case Fn::memory_write: return v.memory_write(*this, arg(0), arg(1), arg(2)); break;
}
log_abort();
}
std::string to_string();
std::string to_string(std::function<std::string(Node)>);
Expand Down Expand Up @@ -384,7 +385,7 @@ namespace Functional {
explicit Factory(IR &ir) : _ir(ir) {}
Node add(IR::NodeData &&fn, Sort &&sort, std::initializer_list<Node> args) {
log_assert(!sort.is_signal() || sort.width() > 0);
log_assert(!sort.is_memory() || sort.addr_width() > 0 && sort.data_width() > 0);
log_assert(!sort.is_memory() || (sort.addr_width() > 0 && sort.data_width() > 0));
IR::Graph::Ref ref = _ir._graph.add(std::move(fn), {std::move(sort)});
for (auto arg : args)
ref.append_arg(IR::Graph::ConstRef(arg));
Expand Down
2 changes: 1 addition & 1 deletion kernel/mem.h
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class MemContents {
// insert multiple words at the given address, overriding any previous assignment.
template<typename Iterator> void insert_range(addr_t addr, Iterator begin, Iterator end) {
auto words = end - begin;
log_assert(addr < 1<<_addr_width); log_assert(words <= (1<<_addr_width) - addr);
log_assert(addr < (addr_t)(1<<_addr_width)); log_assert(words <= (addr_t)(1<<_addr_width) - addr);
auto range = _reserve_range(addr, addr + words);
auto it = _range_data(range, addr);
for(; begin != end; ++begin)
Expand Down

0 comments on commit 42426cb

Please sign in to comment.