3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-07-23 12:48:54 +00:00

Reduce comparisons of size_t and int

`Const::size()` returns int, so change iterators that use it to `auto` instead of `size_t`.
For cases where size is being explicitly cast to `int`, use the wrapper that we already have instead: `Yosys::GetSize()`.
This commit is contained in:
Krystine Sherwin 2024-11-29 12:31:34 +13:00
parent 6f3376cbe6
commit 1de5d98ae2
No known key found for this signature in database
9 changed files with 59 additions and 59 deletions

View file

@ -3493,7 +3493,7 @@ skip_dynamic_range_lvalue_expansion:;
delete buf;
uint32_t result = 0;
for (size_t i = 0; i < arg_value.size(); i++)
for (auto i = 0; i < arg_value.size(); i++)
if (arg_value.at(i) == RTLIL::State::S1)
result = i + 1;
@ -4339,7 +4339,7 @@ replace_fcall_later:;
RTLIL::Const a = children[1]->bitsAsConst(width_hint, sign_hint);
RTLIL::Const b = children[2]->bitsAsConst(width_hint, sign_hint);
log_assert(a.size() == b.size());
for (size_t i = 0; i < a.size(); i++)
for (auto i = 0; i < a.size(); i++)
if (a[i] != b[i])
a.bits()[i] = RTLIL::State::Sx;
newNode = mkconst_bits(a.to_bits(), sign_hint);