Skip to content

Commit e33b1fa

Browse files
committed
Use uint64_t in for condition too
Signed-off-by: Ryszard Rozak <rrozak@antmicro.com>
1 parent 3ed975b commit e33b1fa

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/V3EmitMk.cpp

+6-5
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,21 @@ class EmitMk final {
9494
= static_cast<double>(topScore + 1) / static_cast<int>(intervalsNum);
9595

9696
struct Interval final {
97-
int64_t m_lowerBound = 0;
97+
uint64_t m_lowerBound = 0;
9898
int m_size = 0;
9999
};
100100

101101
std::vector<Interval> intervals;
102102
intervals.resize(intervalsNum);
103103

104-
for (int64_t score = topScore; score >= 0; --score) {
105-
const int ivIdx = int(int64_t(score) / intervalWidth);
106-
intervals[ivIdx].m_lowerBound = int64_t(score);
104+
for (uint64_t score = topScore; score >= 1; --score) {
105+
const unsigned int ivIdx = (unsigned int)(score / intervalWidth);
106+
intervals[ivIdx].m_lowerBound = score;
107107
}
108+
intervals[0].m_lowerBound = 0;
108109

109110
for (const auto score : sortedScores) {
110-
const int ivIdx = int((score) / intervalWidth);
111+
const unsigned int ivIdx = (unsigned int)(score / intervalWidth);
111112
++intervals[ivIdx].m_size;
112113
}
113114

0 commit comments

Comments
 (0)