Skip to content

Commit

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

Expand Down
10 changes: 5 additions & 5 deletions kernel/mem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1729,8 +1729,8 @@ void MemContents::check() {
log_assert(!it->second.empty());
log_assert(it->second.size() % _data_width == 0);
auto end1 = _range_end(it);
log_assert(_range_begin(it) < (1<<_addr_width));
log_assert(end1 <= (1<<_addr_width));
log_assert(_range_begin(it) < (addr_t)(1<<_addr_width));
log_assert(end1 <= (addr_t)(1<<_addr_width));
if(++it == _values.end())
break;
// check that ranges neither overlap nor touch
Expand Down Expand Up @@ -1760,7 +1760,7 @@ bool MemContents::_range_overlaps(std::map<addr_t, RTLIL::Const>::iterator it, a

std::map<addr_t, RTLIL::Const>::iterator MemContents::_range_at(addr_t addr) const {
// allow addr == 1<<_addr_width (which will just return end())
log_assert(addr <= 1<<_addr_width);
log_assert(addr <= (addr_t)(1<<_addr_width));
// get the first range with base > addr
// (we use const_cast since map::iterators are only passed around internally and not exposed to the user
// and using map::iterator in both the const and non-const case simplifies the code a little,
Expand Down Expand Up @@ -1879,8 +1879,8 @@ std::map<addr_t, RTLIL::Const>::iterator MemContents::_reserve_range(addr_t begi

void MemContents::insert_concatenated(addr_t addr, RTLIL::Const const &values) {
addr_t words = (values.size() + _data_width - 1) / _data_width;
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 it = _reserve_range(addr, addr + words);
auto to_begin = _range_data(it, addr);
std::copy(values.bits.begin(), values.bits.end(), to_begin);
Expand Down

0 comments on commit faa5757

Please sign in to comment.