Skip to content

Commit 51f9b1b

Browse files
committed
More explicit casts
1 parent f33f1ef commit 51f9b1b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/entropy/EntropyUtils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ struct FreqDataComparator {
4747
{
4848
// Decreasing frequency then decreasing symbol
4949
int r;
50-
return ((r = *fd1._freq - *fd2._freq) == 0) ? fd1._symbol > fd2._symbol: r > 0;
50+
return ((r = int(*fd1._freq - *fd2._freq)) == 0) ? fd1._symbol > fd2._symbol: r > 0;
5151
}
5252
};
5353

@@ -233,7 +233,7 @@ int EntropyUtils::normalizeFrequencies(uint freqs[], uint alphabet[], int length
233233
if (freqs[alphabet[i]] <= 2) // Do not distort small frequencies
234234
continue;
235235

236-
queue.push_back(FreqSortData(&freqs[alphabet[i]], alphabet[i]));
236+
queue.push_back(FreqSortData(&freqs[alphabet[i]], uint8(alphabet[i])));
237237
}
238238

239239
const int inc = (delta > 0) ? -1 : 1;

src/transform/SBRT.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ bool SBRT::forward(SliceArray<byte>& input, SliceArray<byte>& output, int count)
7878
// Move up symbol to correct rank
7979
while ((r > 0) && (q[r2s[r - 1]] <= qc)) {
8080
r2s[r] = r2s[r - 1];
81-
s2r[r2s[r]] = r;
81+
s2r[r2s[r]] = uint8(r);
8282
r--;
8383
}
8484

8585
r2s[r] = c;
86-
s2r[c] = r;
86+
s2r[c] = uint8(r);
8787
}
8888

8989
input._index += count;

0 commit comments

Comments
 (0)