aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-09-22 11:38:42 -0400
committerJack Lloyd <[email protected]>2017-09-22 11:38:42 -0400
commit27482d71e00dcf106735ef824ded70cf25c6150f (patch)
tree60ee512ff6eed74051718920eb126c30c854e322 /src/lib/utils
parenta2e70c4eb74d016d8b3c783b4964cfc5ea2b7ddf (diff)
Apply final annotations to the library also
Done by a perl script which converted all classes to final, followed by selective reversion where it caused compilation failures.
Diffstat (limited to 'src/lib/utils')
-rw-r--r--src/lib/utils/barrier.h2
-rw-r--r--src/lib/utils/cpuid/cpuid.h2
-rw-r--r--src/lib/utils/data_src.h4
-rw-r--r--src/lib/utils/database.h2
-rw-r--r--src/lib/utils/donna128.h2
-rw-r--r--src/lib/utils/dyn_load/dyn_load.h2
-rw-r--r--src/lib/utils/exceptn.h32
-rw-r--r--src/lib/utils/http_util/http_util.h2
-rw-r--r--src/lib/utils/locking_allocator/locking_allocator.h2
-rw-r--r--src/lib/utils/os_utils.cpp6
-rw-r--r--src/lib/utils/safeint.h2
-rw-r--r--src/lib/utils/semaphore.h2
-rw-r--r--src/lib/utils/sqlite3/sqlite3.h4
13 files changed, 32 insertions, 32 deletions
diff --git a/src/lib/utils/barrier.h b/src/lib/utils/barrier.h
index 303ac5a98..9b7fdd59d 100644
--- a/src/lib/utils/barrier.h
+++ b/src/lib/utils/barrier.h
@@ -23,7 +23,7 @@ namespace Botan {
// m_syncs counter is incremented. m_syncs is a counter to ensure that wait()
// can be called after a sync() even if the previously sleeping threads have
// not awoken.)
-class Barrier
+class Barrier final
{
public:
explicit Barrier(int value = 0) : m_value(value), m_syncs(0) {}
diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h
index 839b72167..f9186f918 100644
--- a/src/lib/utils/cpuid/cpuid.h
+++ b/src/lib/utils/cpuid/cpuid.h
@@ -33,7 +33,7 @@ namespace Botan {
* thread-unsafe mechanism involving executing probe functions which
* catching SIGILL signal is used.
*/
-class BOTAN_PUBLIC_API(2,1) CPUID
+class BOTAN_PUBLIC_API(2,1) CPUID final
{
public:
/**
diff --git a/src/lib/utils/data_src.h b/src/lib/utils/data_src.h
index 616556e46..346ec20f7 100644
--- a/src/lib/utils/data_src.h
+++ b/src/lib/utils/data_src.h
@@ -95,7 +95,7 @@ class BOTAN_PUBLIC_API(2,0) DataSource
/**
* This class represents a Memory-Based DataSource
*/
-class BOTAN_PUBLIC_API(2,0) DataSource_Memory : public DataSource
+class BOTAN_PUBLIC_API(2,0) DataSource_Memory final : public DataSource
{
public:
size_t read(uint8_t[], size_t) override;
@@ -140,7 +140,7 @@ class BOTAN_PUBLIC_API(2,0) DataSource_Memory : public DataSource
/**
* This class represents a Stream-Based DataSource.
*/
-class BOTAN_PUBLIC_API(2,0) DataSource_Stream : public DataSource
+class BOTAN_PUBLIC_API(2,0) DataSource_Stream final : public DataSource
{
public:
size_t read(uint8_t[], size_t) override;
diff --git a/src/lib/utils/database.h b/src/lib/utils/database.h
index cd30c64ae..eb59cc376 100644
--- a/src/lib/utils/database.h
+++ b/src/lib/utils/database.h
@@ -20,7 +20,7 @@ class BOTAN_PUBLIC_API(2,0) SQL_Database
{
public:
- class BOTAN_PUBLIC_API(2,0) SQL_DB_Error : public Exception
+ class BOTAN_PUBLIC_API(2,0) SQL_DB_Error final : public Exception
{
public:
explicit SQL_DB_Error(const std::string& what) : Exception("SQL database", what) {}
diff --git a/src/lib/utils/donna128.h b/src/lib/utils/donna128.h
index 9efc4e332..5d5b18695 100644
--- a/src/lib/utils/donna128.h
+++ b/src/lib/utils/donna128.h
@@ -12,7 +12,7 @@
namespace Botan {
-class donna128
+class donna128 final
{
public:
donna128(uint64_t ll = 0, uint64_t hh = 0) { l = ll; h = hh; }
diff --git a/src/lib/utils/dyn_load/dyn_load.h b/src/lib/utils/dyn_load/dyn_load.h
index 581eac724..3caf65f27 100644
--- a/src/lib/utils/dyn_load/dyn_load.h
+++ b/src/lib/utils/dyn_load/dyn_load.h
@@ -16,7 +16,7 @@ namespace Botan {
/**
* Represents a DLL or shared object
*/
-class BOTAN_PUBLIC_API(2,0) Dynamically_Loaded_Library
+class BOTAN_PUBLIC_API(2,0) Dynamically_Loaded_Library final
{
public:
/**
diff --git a/src/lib/utils/exceptn.h b/src/lib/utils/exceptn.h
index bb8c245f6..5242e87d9 100644
--- a/src/lib/utils/exceptn.h
+++ b/src/lib/utils/exceptn.h
@@ -49,7 +49,7 @@ class BOTAN_PUBLIC_API(2,0) Invalid_Argument : public Exception
* An argument that is invalid because it is not supported by Botan.
* It might or might not be valid in another context like a standard.
*/
-struct BOTAN_PUBLIC_API(2,0) Unsupported_Argument : public Invalid_Argument
+struct BOTAN_PUBLIC_API(2,0) Unsupported_Argument final : public Invalid_Argument
{
explicit Unsupported_Argument(const std::string& msg) : Invalid_Argument(msg) {}
};
@@ -94,7 +94,7 @@ struct BOTAN_PUBLIC_API(2,0) Internal_Error : public Exception
/**
* Invalid_Key_Length Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Invalid_Key_Length : public Invalid_Argument
+struct BOTAN_PUBLIC_API(2,0) Invalid_Key_Length final : public Invalid_Argument
{
Invalid_Key_Length(const std::string& name, size_t length) :
Invalid_Argument(name + " cannot accept a key of length " +
@@ -105,7 +105,7 @@ struct BOTAN_PUBLIC_API(2,0) Invalid_Key_Length : public Invalid_Argument
/**
* Invalid_IV_Length Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Invalid_IV_Length : public Invalid_Argument
+struct BOTAN_PUBLIC_API(2,0) Invalid_IV_Length final : public Invalid_Argument
{
Invalid_IV_Length(const std::string& mode, size_t bad_len) :
Invalid_Argument("IV length " + std::to_string(bad_len) +
@@ -116,7 +116,7 @@ struct BOTAN_PUBLIC_API(2,0) Invalid_IV_Length : public Invalid_Argument
/**
* PRNG_Unseeded Exception
*/
-struct BOTAN_PUBLIC_API(2,0) PRNG_Unseeded : public Invalid_State
+struct BOTAN_PUBLIC_API(2,0) PRNG_Unseeded final : public Invalid_State
{
explicit PRNG_Unseeded(const std::string& algo) :
Invalid_State("PRNG not seeded: " + algo)
@@ -126,7 +126,7 @@ struct BOTAN_PUBLIC_API(2,0) PRNG_Unseeded : public Invalid_State
/**
* Policy_Violation Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Policy_Violation : public Invalid_State
+struct BOTAN_PUBLIC_API(2,0) Policy_Violation final : public Invalid_State
{
explicit Policy_Violation(const std::string& err) :
Invalid_State("Policy violation: " + err)
@@ -136,7 +136,7 @@ struct BOTAN_PUBLIC_API(2,0) Policy_Violation : public Invalid_State
/**
* Algorithm_Not_Found Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Algorithm_Not_Found : public Lookup_Error
+struct BOTAN_PUBLIC_API(2,0) Algorithm_Not_Found final : public Lookup_Error
{
explicit Algorithm_Not_Found(const std::string& name) :
Lookup_Error("Could not find any algorithm named \"" + name + "\"")
@@ -146,7 +146,7 @@ struct BOTAN_PUBLIC_API(2,0) Algorithm_Not_Found : public Lookup_Error
/**
* No_Provider_Found Exception
*/
-struct BOTAN_PUBLIC_API(2,0) No_Provider_Found : public Exception
+struct BOTAN_PUBLIC_API(2,0) No_Provider_Found final : public Exception
{
explicit No_Provider_Found(const std::string& name) :
Exception("Could not find any provider for algorithm named \"" + name + "\"")
@@ -157,7 +157,7 @@ struct BOTAN_PUBLIC_API(2,0) No_Provider_Found : public Exception
* Provider_Not_Found is thrown when a specific provider was requested
* but that provider is not available.
*/
-struct BOTAN_PUBLIC_API(2,0) Provider_Not_Found : public Lookup_Error
+struct BOTAN_PUBLIC_API(2,0) Provider_Not_Found final : public Lookup_Error
{
Provider_Not_Found(const std::string& algo, const std::string& provider) :
Lookup_Error("Could not find provider '" + provider + "' for " + algo) {}
@@ -166,7 +166,7 @@ struct BOTAN_PUBLIC_API(2,0) Provider_Not_Found : public Lookup_Error
/**
* Invalid_Algorithm_Name Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Invalid_Algorithm_Name : public Invalid_Argument
+struct BOTAN_PUBLIC_API(2,0) Invalid_Algorithm_Name final : public Invalid_Argument
{
explicit Invalid_Algorithm_Name(const std::string& name):
Invalid_Argument("Invalid algorithm name: " + name)
@@ -176,7 +176,7 @@ struct BOTAN_PUBLIC_API(2,0) Invalid_Algorithm_Name : public Invalid_Argument
/**
* Encoding_Error Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Encoding_Error : public Invalid_Argument
+struct BOTAN_PUBLIC_API(2,0) Encoding_Error final : public Invalid_Argument
{
explicit Encoding_Error(const std::string& name) :
Invalid_Argument("Encoding error: " + name) {}
@@ -194,7 +194,7 @@ struct BOTAN_PUBLIC_API(2,0) Decoding_Error : public Invalid_Argument
/**
* Integrity_Failure Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Integrity_Failure : public Exception
+struct BOTAN_PUBLIC_API(2,0) Integrity_Failure final : public Exception
{
explicit Integrity_Failure(const std::string& msg) :
Exception("Integrity failure: " + msg) {}
@@ -203,7 +203,7 @@ struct BOTAN_PUBLIC_API(2,0) Integrity_Failure : public Exception
/**
* Invalid_OID Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Invalid_OID : public Decoding_Error
+struct BOTAN_PUBLIC_API(2,0) Invalid_OID final : public Decoding_Error
{
explicit Invalid_OID(const std::string& oid) :
Decoding_Error("Invalid ASN.1 OID: " + oid) {}
@@ -212,7 +212,7 @@ struct BOTAN_PUBLIC_API(2,0) Invalid_OID : public Decoding_Error
/**
* Stream_IO_Error Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Stream_IO_Error : public Exception
+struct BOTAN_PUBLIC_API(2,0) Stream_IO_Error final : public Exception
{
explicit Stream_IO_Error(const std::string& err) :
Exception("I/O error: " + err)
@@ -222,7 +222,7 @@ struct BOTAN_PUBLIC_API(2,0) Stream_IO_Error : public Exception
/**
* No_Filesystem_Access Exception
*/
-struct BOTAN_PUBLIC_API(2,0) No_Filesystem_Access : public Exception
+struct BOTAN_PUBLIC_API(2,0) No_Filesystem_Access final : public Exception
{
No_Filesystem_Access() : Exception("No filesystem access enabled.") {}
};
@@ -230,7 +230,7 @@ struct BOTAN_PUBLIC_API(2,0) No_Filesystem_Access : public Exception
/**
* Self Test Failure Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Self_Test_Failure : public Internal_Error
+struct BOTAN_PUBLIC_API(2,0) Self_Test_Failure final : public Internal_Error
{
explicit Self_Test_Failure(const std::string& err) :
Internal_Error("Self test failed: " + err)
@@ -240,7 +240,7 @@ struct BOTAN_PUBLIC_API(2,0) Self_Test_Failure : public Internal_Error
/**
* Not Implemented Exception
*/
-struct BOTAN_PUBLIC_API(2,0) Not_Implemented : public Exception
+struct BOTAN_PUBLIC_API(2,0) Not_Implemented final : public Exception
{
explicit Not_Implemented(const std::string& err) :
Exception("Not implemented", err)
diff --git a/src/lib/utils/http_util/http_util.h b/src/lib/utils/http_util/http_util.h
index acaed54d4..aa8e1cbc0 100644
--- a/src/lib/utils/http_util/http_util.h
+++ b/src/lib/utils/http_util/http_util.h
@@ -56,7 +56,7 @@ struct Response
/**
* HTTP_Error Exception
*/
-struct BOTAN_PUBLIC_API(2,0) HTTP_Error : public Exception
+struct BOTAN_PUBLIC_API(2,0) HTTP_Error final : public Exception
{
explicit HTTP_Error(const std::string& msg) :
Exception("HTTP error " + msg)
diff --git a/src/lib/utils/locking_allocator/locking_allocator.h b/src/lib/utils/locking_allocator/locking_allocator.h
index b761221d2..8e38129e2 100644
--- a/src/lib/utils/locking_allocator/locking_allocator.h
+++ b/src/lib/utils/locking_allocator/locking_allocator.h
@@ -14,7 +14,7 @@
namespace Botan {
-class BOTAN_PUBLIC_API(2,0) mlock_allocator
+class BOTAN_PUBLIC_API(2,0) mlock_allocator final
{
public:
static mlock_allocator& instance();
diff --git a/src/lib/utils/os_utils.cpp b/src/lib/utils/os_utils.cpp
index 92b555d1e..afea8bc7d 100644
--- a/src/lib/utils/os_utils.cpp
+++ b/src/lib/utils/os_utils.cpp
@@ -52,7 +52,7 @@ namespace {
#if defined(BOTAN_HAS_BOOST_ASIO)
-class Asio_Socket : public OS::Socket
+class Asio_Socket final : public OS::Socket
{
public:
Asio_Socket(const std::string& hostname, const std::string& service) :
@@ -90,7 +90,7 @@ class Asio_Socket : public OS::Socket
#elif defined(BOTAN_TARGET_OS_TYPE_IS_WINDOWS)
-class Winsock_Socket : public OS::Socket
+class Winsock_Socket final : public OS::Socket
{
public:
Winsock_Socket(const std::string& hostname, const std::string& service)
@@ -188,7 +188,7 @@ class Winsock_Socket : public OS::Socket
};
#elif defined(BOTAN_TARGET_OS_TYPE_IS_UNIX)
-class BSD_Socket : public OS::Socket
+class BSD_Socket final : public OS::Socket
{
public:
BSD_Socket(const std::string& hostname, const std::string& service)
diff --git a/src/lib/utils/safeint.h b/src/lib/utils/safeint.h
index 66632c932..86567db72 100644
--- a/src/lib/utils/safeint.h
+++ b/src/lib/utils/safeint.h
@@ -13,7 +13,7 @@
namespace Botan {
-class Integer_Overflow_Detected : public Exception
+class Integer_Overflow_Detected final : public Exception
{
public:
Integer_Overflow_Detected(const std::string& file, int line) :
diff --git a/src/lib/utils/semaphore.h b/src/lib/utils/semaphore.h
index 61db8d48f..84478a8df 100644
--- a/src/lib/utils/semaphore.h
+++ b/src/lib/utils/semaphore.h
@@ -17,7 +17,7 @@
namespace Botan {
#if defined(BOTAN_TARGET_OS_HAS_THREADS)
-class Semaphore
+class Semaphore final
{
public:
explicit Semaphore(int value = 0) : m_value(value), m_wakeups(0) {}
diff --git a/src/lib/utils/sqlite3/sqlite3.h b/src/lib/utils/sqlite3/sqlite3.h
index dff189791..3f11b60e2 100644
--- a/src/lib/utils/sqlite3/sqlite3.h
+++ b/src/lib/utils/sqlite3/sqlite3.h
@@ -15,7 +15,7 @@ class sqlite3_stmt;
namespace Botan {
-class BOTAN_PUBLIC_API(2,0) Sqlite3_Database : public SQL_Database
+class BOTAN_PUBLIC_API(2,0) Sqlite3_Database final : public SQL_Database
{
public:
Sqlite3_Database(const std::string& file);
@@ -28,7 +28,7 @@ class BOTAN_PUBLIC_API(2,0) Sqlite3_Database : public SQL_Database
std::shared_ptr<Statement> new_statement(const std::string& sql) const override;
private:
- class Sqlite3_Statement : public Statement
+ class Sqlite3_Statement final : public Statement
{
public:
void bind(int column, const std::string& val) override;