aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/base
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-03-05 13:10:30 -0500
committerJack Lloyd <[email protected]>2016-03-05 13:10:30 -0500
commita3ce0bd1e9e018ea69741c4380bf065cccedec93 (patch)
tree71eac335b7bdc3a845b1d6599b78e337ad00433c /src/lib/base
parent2467ccccd48fc502ee3e04d847d514e88d88b144 (diff)
parentc3540ae668a523c0155677c4ee4c9099910110bc (diff)
Make almost all single argument constructors `explicit`
GH #444
Diffstat (limited to 'src/lib/base')
-rw-r--r--src/lib/base/algo_registry.h3
-rw-r--r--src/lib/base/init.h2
-rw-r--r--src/lib/base/key_spec.h2
-rw-r--r--src/lib/base/scan_name.h4
-rw-r--r--src/lib/base/symkey.h2
5 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/base/algo_registry.h b/src/lib/base/algo_registry.h
index eebbaa4e8..162770730 100644
--- a/src/lib/base/algo_registry.h
+++ b/src/lib/base/algo_registry.h
@@ -11,6 +11,7 @@
#include <botan/build.h>
#include <botan/types.h>
#include <botan/exceptn.h>
+#include <botan/scan_name.h>
#include <functional>
#include <mutex>
#include <vector>
@@ -257,7 +258,7 @@ make_new_T_1str_req(const typename Algo_Registry<T>::Spec& spec)
template<typename T, typename X> T*
make_new_T_1X(const typename Algo_Registry<T>::Spec& spec)
{
- std::unique_ptr<X> x(Algo_Registry<X>::global_registry().make(spec.arg(0)));
+ std::unique_ptr<X> x(Algo_Registry<X>::global_registry().make(Botan::SCAN_Name(spec.arg(0))));
if(!x)
throw Exception(spec.arg(0));
return new T(x.release());
diff --git a/src/lib/base/init.h b/src/lib/base/init.h
index 0c61eba6f..7709883af 100644
--- a/src/lib/base/init.h
+++ b/src/lib/base/init.h
@@ -22,7 +22,7 @@ namespace Botan {
class BOTAN_DLL LibraryInitializer
{
public:
- LibraryInitializer(const std::string& s = "") { initialize(s); }
+ explicit LibraryInitializer(const std::string& s = "") { initialize(s); }
~LibraryInitializer() { deinitialize(); }
static void initialize(const std::string& = "");
diff --git a/src/lib/base/key_spec.h b/src/lib/base/key_spec.h
index f9cdcc78d..82e0e7e6f 100644
--- a/src/lib/base/key_spec.h
+++ b/src/lib/base/key_spec.h
@@ -22,7 +22,7 @@ class BOTAN_DLL Key_Length_Specification
* Constructor for fixed length keys
* @param keylen the supported key length
*/
- Key_Length_Specification(size_t keylen) :
+ explicit Key_Length_Specification(size_t keylen) :
m_min_keylen(keylen),
m_max_keylen(keylen),
m_keylen_mod(1)
diff --git a/src/lib/base/scan_name.h b/src/lib/base/scan_name.h
index 43441e19c..d59d5889e 100644
--- a/src/lib/base/scan_name.h
+++ b/src/lib/base/scan_name.h
@@ -26,12 +26,12 @@ class BOTAN_DLL SCAN_Name
/**
* @param algo_spec A SCAN-format name
*/
- SCAN_Name(const char* algo_spec);
+ explicit SCAN_Name(const char* algo_spec);
/**
* @param algo_spec A SCAN-format name
*/
- SCAN_Name(std::string algo_spec);
+ explicit SCAN_Name(std::string algo_spec);
/**
* @param algo_spec A SCAN-format name
diff --git a/src/lib/base/symkey.h b/src/lib/base/symkey.h
index 3b0208e51..c780e5239 100644
--- a/src/lib/base/symkey.h
+++ b/src/lib/base/symkey.h
@@ -61,7 +61,7 @@ class BOTAN_DLL OctetString
* Create a new OctetString
* @param str is a hex encoded string
*/
- OctetString(const std::string& str = "");
+ explicit OctetString(const std::string& str = "");
/**
* Create a new random OctetString