From 7a4e0c41dbff768388e8a04569b8f61404907143 Mon Sep 17 00:00:00 2001 From: Valient Gough Date: Thu, 3 Aug 2017 22:27:18 -0700 Subject: [PATCH] modernize: use override, using aliases --- encfs/Cipher.cpp | 2 +- encfs/Cipher.h | 6 +++--- encfs/CipherKey.h | 2 +- encfs/Context.h | 4 ++-- encfs/FSConfig.h | 2 +- encfs/FileUtils.h | 2 +- encfs/NameIO.cpp | 2 +- encfs/NameIO.h | 4 ++-- encfs/NullCipher.cpp | 2 +- encfs/SSL_Cipher.cpp | 2 +- encfs/SSL_Cipher.h | 2 +- encfs/XmlReader.cpp | 4 ++-- encfs/XmlReader.h | 2 +- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/encfs/Cipher.cpp b/encfs/Cipher.cpp index 50422d9..cb4a2c2 100644 --- a/encfs/Cipher.cpp +++ b/encfs/Cipher.cpp @@ -56,7 +56,7 @@ struct CipherAlg { Range blockSize; }; -typedef multimap CipherMap_t; +using CipherMap_t = multimap; static CipherMap_t *gCipherMap = nullptr; std::list Cipher::GetAlgorithmList( diff --git a/encfs/Cipher.h b/encfs/Cipher.h index 89ed4ec..5c5d709 100644 --- a/encfs/Cipher.h +++ b/encfs/Cipher.h @@ -44,8 +44,8 @@ class Cipher { public: // if no key length was indicated when cipher was registered, then keyLen // <= 0 will be used. - typedef std::shared_ptr (*CipherConstructor)(const Interface &iface, - int keyLenBits); + using CipherConstructor = std::shared_ptr (*)(const Interface &iface, + int keyLenBits); struct CipherAlgorithm { std::string name; @@ -55,7 +55,7 @@ class Cipher { Range blockSize; }; - typedef std::list AlgorithmList; + using AlgorithmList = std::list; static AlgorithmList GetAlgorithmList(bool includeHidden = false); static std::shared_ptr New(const Interface &iface, int keyLen = -1); diff --git a/encfs/CipherKey.h b/encfs/CipherKey.h index 42ddb8a..505b899 100644 --- a/encfs/CipherKey.h +++ b/encfs/CipherKey.h @@ -31,7 +31,7 @@ class AbstractCipherKey { virtual ~AbstractCipherKey(); }; -typedef std::shared_ptr CipherKey; +using CipherKey = std::shared_ptr; } // namespace encfs diff --git a/encfs/Context.h b/encfs/Context.h index 8d62fcf..56b0fc4 100644 --- a/encfs/Context.h +++ b/encfs/Context.h @@ -85,8 +85,8 @@ class EncFS_Context { * us. */ - typedef std::unordered_map>> - FileMap; + using FileMap = + std::unordered_map>>; mutable pthread_mutex_t contextMutex; FileMap openFiles; diff --git a/encfs/FSConfig.h b/encfs/FSConfig.h index 39e2859..26fb0d0 100644 --- a/encfs/FSConfig.h +++ b/encfs/FSConfig.h @@ -130,7 +130,7 @@ struct FSConfig { : forceDecode(false), reverseEncryption(false), idleTracking(false) {} }; -typedef std::shared_ptr FSConfigPtr; +using FSConfigPtr = std::shared_ptr; } // namespace encfs diff --git a/encfs/FileUtils.h b/encfs/FileUtils.h index 7efbbf0..3e42092 100644 --- a/encfs/FileUtils.h +++ b/encfs/FileUtils.h @@ -60,7 +60,7 @@ struct EncFS_Root { ~EncFS_Root(); }; -typedef std::shared_ptr RootPtr; +using RootPtr = std::shared_ptr; enum ConfigMode { Config_Prompt, Config_Standard, Config_Paranoia }; diff --git a/encfs/NameIO.cpp b/encfs/NameIO.cpp index 7a3ea52..9cdb1c5 100644 --- a/encfs/NameIO.cpp +++ b/encfs/NameIO.cpp @@ -55,7 +55,7 @@ struct NameIOAlg { Interface iface; }; -typedef multimap NameIOMap_t; +using NameIOMap_t = multimap; static NameIOMap_t *gNameIOMap = nullptr; list NameIO::GetAlgorithmList(bool includeHidden) { diff --git a/encfs/NameIO.h b/encfs/NameIO.h index 7085970..3129dc5 100644 --- a/encfs/NameIO.h +++ b/encfs/NameIO.h @@ -37,7 +37,7 @@ class Cipher; class NameIO { public: - typedef std::shared_ptr (*Constructor)( + using Constructor = std::shared_ptr (*)( const Interface &iface, const std::shared_ptr &cipher, const CipherKey &key); @@ -47,7 +47,7 @@ class NameIO { Interface iface; }; - typedef std::list AlgorithmList; + using AlgorithmList = std::list; static AlgorithmList GetAlgorithmList(bool includeHidden = false); static std::shared_ptr New(const Interface &iface, diff --git a/encfs/NullCipher.cpp b/encfs/NullCipher.cpp index 4a6e05b..4e916ca 100644 --- a/encfs/NullCipher.cpp +++ b/encfs/NullCipher.cpp @@ -50,7 +50,7 @@ static bool NullCipher_registered = Cipher::Register( class NullKey : public AbstractCipherKey { public: NullKey() = default; - virtual ~NullKey() = default; + ~NullKey() override = default; }; class NullDestructor { diff --git a/encfs/SSL_Cipher.cpp b/encfs/SSL_Cipher.cpp index d0fb9e4..7c6c749 100644 --- a/encfs/SSL_Cipher.cpp +++ b/encfs/SSL_Cipher.cpp @@ -238,7 +238,7 @@ class SSLKey : public AbstractCipherKey { HMAC_CTX *mac_ctx; SSLKey(int keySize, int ivLength); - ~SSLKey(); + ~SSLKey() override; }; SSLKey::SSLKey(int keySize_, int ivLength_) { diff --git a/encfs/SSL_Cipher.h b/encfs/SSL_Cipher.h index f9613ff..007ed2e 100644 --- a/encfs/SSL_Cipher.h +++ b/encfs/SSL_Cipher.h @@ -31,7 +31,7 @@ #ifndef EVP_CIPHER struct evp_cipher_st; -typedef struct evp_cipher_st EVP_CIPHER; +using EVP_CIPHER = struct evp_cipher_st; #endif namespace encfs { diff --git a/encfs/XmlReader.cpp b/encfs/XmlReader.cpp index 33a343a..a3cd9a6 100644 --- a/encfs/XmlReader.cpp +++ b/encfs/XmlReader.cpp @@ -139,9 +139,9 @@ class XmlNode : virtual public XmlValue { XmlNode(const tinyxml2::XMLElement *element_) : XmlValue(safeValueForNode(element_)), element(element_) {} - virtual ~XmlNode() = default; + ~XmlNode() override = default; - virtual XmlValuePtr find(const char *name) const { + XmlValuePtr find(const char *name) const override { if (name[0] == '@') { const char *value = element->Attribute(name + 1); if (value) diff --git a/encfs/XmlReader.h b/encfs/XmlReader.h index 4a56b16..cf1d3e4 100644 --- a/encfs/XmlReader.h +++ b/encfs/XmlReader.h @@ -29,7 +29,7 @@ namespace encfs { class XmlValue; -typedef std::shared_ptr XmlValuePtr; +using XmlValuePtr = std::shared_ptr; class XmlValue { std::string value;