From 42426cb0884d9cf8c3dc4509198228a7c3c4a4a8 Mon Sep 17 00:00:00 2001 From: Emily Schmidt Date: Thu, 25 Jul 2024 12:54:58 +0100 Subject: [PATCH] silence some warnings --- kernel/drivertools.h | 8 +++++--- kernel/functional.h | 3 ++- kernel/mem.h | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/kernel/drivertools.h b/kernel/drivertools.h index 48c846b5f79..b0e435f400f 100644 --- a/kernel/drivertools.h +++ b/kernel/drivertools.h @@ -388,6 +388,8 @@ struct DriveBit case DriveType::MULTIPLE: inner = multiple_.hash(); break; + default: + log_abort(); } return mkhash((unsigned int)type_, inner); } @@ -412,7 +414,7 @@ struct DriveBit case DriveType::MULTIPLE: return multiple_ == other.multiple_; } - log_assert(false); + log_abort(); } bool operator!=(const DriveBit &other) const @@ -958,7 +960,7 @@ struct DriveChunk case DriveType::MULTIPLE: return multiple_ == other.multiple_; } - log_assert(false); + log_abort(); } bool operator!=(const DriveChunk &other) const @@ -985,7 +987,7 @@ struct DriveChunk case DriveType::MULTIPLE: return multiple_ < other.multiple_; } - log_assert(false); + log_abort(); } DriveType type() const { return type_; } diff --git a/kernel/functional.h b/kernel/functional.h index e0592259c7f..08b7b99ca2a 100644 --- a/kernel/functional.h +++ b/kernel/functional.h @@ -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); @@ -384,7 +385,7 @@ namespace Functional { explicit Factory(IR &ir) : _ir(ir) {} Node add(IR::NodeData &&fn, Sort &&sort, std::initializer_list 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)); diff --git a/kernel/mem.h b/kernel/mem.h index 8c935adc13b..4a6a9a431f4 100644 --- a/kernel/mem.h +++ b/kernel/mem.h @@ -318,7 +318,7 @@ class MemContents { // insert multiple words at the given address, overriding any previous assignment. template 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)