From 326ed3ccfff774b8f05129281d6833bcfb21b8c8 Mon Sep 17 00:00:00 2001 From: Be Date: Wed, 13 Oct 2021 02:20:52 -0500 Subject: [PATCH] static_cast for QByteArray::size with std::max QByteArray::size returns qsizetype in Qt6, which needs to be converted to an int to pass to std::max. --- src/util/cache.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/cache.cpp b/src/util/cache.cpp index 021efc19b5e3..d22ce8ebe2dd 100644 --- a/src/util/cache.cpp +++ b/src/util/cache.cpp @@ -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(sizeof(cache_key_t))); - for (auto i = 0; i < significantByteCount; ++i) { + static_cast(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 =