From 2d7a27b918ff576dbd8ec8b3aecaa45f8c78fa5e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 11 Jan 2023 08:58:01 -0800 Subject: [PATCH] QCryptographicHashPrivate: standardize on quint8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So we don't have to do these reinterpret_cast everywhere, as most of the APIs we're calling take unsigned chars themselves. The reinterpret_casts will be removed in the next commit, which needs to modify those lines anyway. Pick-to: 6.5 6.4 6.2 5.15 Change-Id: Ide4dbd0777a44ed0870efffd17394f9f25062122 Reviewed-by: Giuseppe D'Angelo Reviewed-by: MÃ¥rten Nordheim --- src/corelib/tools/qcryptographichash.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 99a1149a52..88fdb6281f 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -266,12 +266,11 @@ public: #endif #endif class SmallByteArray { - std::array m_data; + std::array m_data; static_assert(MaxHashLength <= std::numeric_limits::max()); - std::uint8_t m_size; + quint8 m_size; public: - char *data() noexcept { return m_data.data(); } - const char *data() const noexcept { return m_data.data(); } + quint8 *data() noexcept { return m_data.data(); } qsizetype size() const noexcept { return qsizetype{m_size}; } bool isEmpty() const noexcept { return size() == 0; } void clear() noexcept { m_size = 0; } @@ -281,7 +280,7 @@ public: m_size = std::uint8_t(s); } QByteArrayView toByteArrayView() const noexcept - { return QByteArrayView{data(), size()}; } + { return QByteArrayView{m_data.data(), size()}; } }; SmallByteArray result; };