Skip to content

Commit

Permalink
static_cast<int> for QByteArray::size with std::max
Browse files Browse the repository at this point in the history
QByteArray::size returns qsizetype in Qt6, which needs to be
converted to an int to pass to std::max.
  • Loading branch information
Be-ing committed Oct 13, 2021
1 parent 8bdaae6 commit 326ed3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/util/cache.cpp
Original file line number Diff line number Diff line change
@@ -16,9 +16,9 @@ cache_key_t cacheKeyFromMessageDigest(const QByteArray& messageDigest) {
// 5 Hash function Usage
// 5.1 Truncated Message Digest
const auto significantByteCount = math_min(
messageDigest.size(),
static_cast<int>(sizeof(cache_key_t)));
for (auto i = 0; i < significantByteCount; ++i) {
static_cast<size_t>(messageDigest.size()),
sizeof(cache_key_t));
for (unsigned int i = 0; i < significantByteCount; ++i) {
// Only 8 bits are relevant and we don't want the sign
// extension of a (signed) char during the conversion.
const cache_key_t nextByte =

0 comments on commit 326ed3c

Please sign in to comment.