From fbdc39de29a0efbcd13ad169c844189168d2110d Mon Sep 17 00:00:00 2001 From: Daniel Neus Date: Mon, 11 Jan 2016 21:52:38 +0100 Subject: cppcheck fixes: Class 'X' has a constructor with 1 argument that is not explicit. --- src/lib/block/block_cipher.cpp | 2 +- src/lib/block/cast/cast128.cpp | 2 +- src/lib/block/gost_28147/gost_28147.h | 4 ++-- src/lib/block/rc5/rc5.h | 2 +- src/lib/block/safer/safer_sk.h | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/lib/block') diff --git a/src/lib/block/block_cipher.cpp b/src/lib/block/block_cipher.cpp index 7b52f8716..c70ba229d 100644 --- a/src/lib/block/block_cipher.cpp +++ b/src/lib/block/block_cipher.cpp @@ -150,7 +150,7 @@ BlockCipher::~BlockCipher() {} std::unique_ptr BlockCipher::create(const std::string& algo_spec, const std::string& provider) { - return std::unique_ptr(make_a(algo_spec, provider)); + return std::unique_ptr(make_a(Botan::BlockCipher::Spec(algo_spec), provider)); } std::vector BlockCipher::providers(const std::string& algo_spec) diff --git a/src/lib/block/cast/cast128.cpp b/src/lib/block/cast/cast128.cpp index ce9e86794..53f7d4611 100644 --- a/src/lib/block/cast/cast128.cpp +++ b/src/lib/block/cast/cast128.cpp @@ -330,7 +330,7 @@ void CAST_128::cast_ks(secure_vector& K, { public: byte operator()(size_t i) { return (m_X[i/4] >> (8*(3 - (i%4)))); } - ByteReader(const u32bit* x) : m_X(x) {} + explicit ByteReader(const u32bit* x) : m_X(x) {} private: const u32bit* m_X; }; diff --git a/src/lib/block/gost_28147/gost_28147.h b/src/lib/block/gost_28147/gost_28147.h index 11f5228a6..4105154e3 100644 --- a/src/lib/block/gost_28147/gost_28147.h +++ b/src/lib/block/gost_28147/gost_28147.h @@ -63,9 +63,9 @@ class BOTAN_DLL GOST_28147_89 final : public Block_Cipher_Fixed_Params<8, 32> /** * @param params the sbox parameters to use */ - GOST_28147_89(const GOST_28147_89_Params& params); + explicit GOST_28147_89(const GOST_28147_89_Params& params); private: - GOST_28147_89(const std::vector& other_SBOX) : + explicit GOST_28147_89(const std::vector& other_SBOX) : m_SBOX(other_SBOX), m_EK(8) {} void key_schedule(const byte[], size_t) override; diff --git a/src/lib/block/rc5/rc5.h b/src/lib/block/rc5/rc5.h index 17469205f..4d9232326 100644 --- a/src/lib/block/rc5/rc5.h +++ b/src/lib/block/rc5/rc5.h @@ -29,7 +29,7 @@ class BOTAN_DLL RC5 final : public Block_Cipher_Fixed_Params<8, 1, 32> * @param rounds the number of RC5 rounds to run. Must be between * 8 and 32 and a multiple of 4. */ - RC5(size_t rounds); + explicit RC5(size_t rounds); private: void key_schedule(const byte[], size_t) override; diff --git a/src/lib/block/safer/safer_sk.h b/src/lib/block/safer/safer_sk.h index babc22eb9..af944b36c 100644 --- a/src/lib/block/safer/safer_sk.h +++ b/src/lib/block/safer/safer_sk.h @@ -29,7 +29,7 @@ class BOTAN_DLL SAFER_SK final : public Block_Cipher_Fixed_Params<8, 16> * @param rounds the number of rounds to use - must be between 1 * and 13 */ - SAFER_SK(size_t rounds); + explicit SAFER_SK(size_t rounds); private: void key_schedule(const byte[], size_t) override; -- cgit v1.2.3