From 92284a5c02e3ab3078d581b1730f25c9bd53d56f Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 24 Aug 2024 14:33:40 +0200 Subject: [PATCH] QCryptographicHash: enable -Wswitch in methodToName() Let the compiler alert us to adjust this switch in case we add more Algorithm enumerators. Amends 633c1365966eda89fc883c039683a727d0a0813e. Pick-to: 6.7 6.5 Change-Id: I2ce16ac3045d3eebfe74c4080c3b326dd865cf37 Reviewed-by: Thiago Macieira (cherry picked from commit 0abf0d26a938e9cf7c67d8bf6f6bfdf4e49f1cab) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/tools/qcryptographichash.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index d0ed17eba23..3788361ea85 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -270,9 +270,21 @@ static constexpr const char * methodToName(QCryptographicHash::Algorithm method) CASE(RealSha3_512, "SHA3-512"); CASE(Blake2b_512, "BLAKE2B512"); CASE(Blake2s_256, "BLAKE2S256"); + // not supported by OpenSSL: + CASE(Keccak_224, nullptr); + CASE(Keccak_256, nullptr); + CASE(Keccak_384, nullptr); + CASE(Keccak_512, nullptr); + CASE(Blake2b_160, nullptr); + CASE(Blake2b_256, nullptr); + CASE(Blake2b_384, nullptr); + CASE(Blake2s_128, nullptr); + CASE(Blake2s_160, nullptr); + CASE(Blake2s_224, nullptr); + CASE(NumAlgorithms, nullptr); #undef CASE - default: return nullptr; } + return nullptr; } /*