QCryptographicHashPrivate: standardize on quint8
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. Change-Id: Ide4dbd0777a44ed0870efffd17394f9f25062122 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 2d7a27b918ff576dbd8ec8b3aecaa45f8c78fa5e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
47b3f967d6
commit
7ec591d124
@ -191,12 +191,11 @@ public:
|
||||
void sha3Finish(int bitCount, Sha3Variant sha3Variant);
|
||||
#endif
|
||||
class SmallByteArray {
|
||||
std::array<char, MaxHashLength> m_data;
|
||||
std::array<quint8, MaxHashLength> m_data;
|
||||
static_assert(MaxHashLength <= std::numeric_limits<std::uint8_t>::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; }
|
||||
@ -206,7 +205,7 @@ public:
|
||||
m_size = std::uint8_t(s);
|
||||
}
|
||||
QByteArrayView toByteArrayView() const noexcept
|
||||
{ return QByteArrayView{data(), size()}; }
|
||||
{ return QByteArrayView{m_data.data(), size()}; }
|
||||
};
|
||||
SmallByteArray result;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user