From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027. --- core/crypto/crypto.cpp | 8 -------- core/crypto/crypto_core.h | 5 ----- core/crypto/hashing_context.cpp | 1 - 3 files changed, 14 deletions(-) (limited to 'core/crypto') diff --git a/core/crypto/crypto.cpp b/core/crypto/crypto.cpp index 585731ac9f..60db329e64 100644 --- a/core/crypto/crypto.cpp +++ b/core/crypto/crypto.cpp @@ -71,7 +71,6 @@ Crypto *Crypto::create() { } void Crypto::load_default_certificates(String p_path) { - if (_load_default_certificates) _load_default_certificates(p_path); } @@ -97,7 +96,6 @@ Ref Crypto::generate_self_signed_certificate(Ref p_k /// Resource loader/saver RES ResourceFormatLoaderCrypto::load(const String &p_path, const String &p_original_path, Error *r_error, bool p_use_sub_threads, float *r_progress, bool p_no_cache) { - String el = p_path.get_extension().to_lower(); if (el == "crt") { X509Certificate *cert = X509Certificate::create(); @@ -114,18 +112,15 @@ RES ResourceFormatLoaderCrypto::load(const String &p_path, const String &p_origi } void ResourceFormatLoaderCrypto::get_recognized_extensions(List *p_extensions) const { - p_extensions->push_back("crt"); p_extensions->push_back("key"); } bool ResourceFormatLoaderCrypto::handles_type(const String &p_type) const { - return p_type == "X509Certificate" || p_type == "CryptoKey"; } String ResourceFormatLoaderCrypto::get_resource_type(const String &p_path) const { - String el = p_path.get_extension().to_lower(); if (el == "crt") return "X509Certificate"; @@ -135,7 +130,6 @@ String ResourceFormatLoaderCrypto::get_resource_type(const String &p_path) const } Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { - Error err; Ref cert = p_resource; Ref key = p_resource; @@ -151,7 +145,6 @@ Error ResourceFormatSaverCrypto::save(const String &p_path, const RES &p_resourc } void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource, List *p_extensions) const { - const X509Certificate *cert = Object::cast_to(*p_resource); const CryptoKey *key = Object::cast_to(*p_resource); if (cert) { @@ -162,6 +155,5 @@ void ResourceFormatSaverCrypto::get_recognized_extensions(const RES &p_resource, } } bool ResourceFormatSaverCrypto::recognize(const RES &p_resource) const { - return Object::cast_to(*p_resource) || Object::cast_to(*p_resource); } diff --git a/core/crypto/crypto_core.h b/core/crypto/crypto_core.h index b3be58e8ee..36d8ace723 100644 --- a/core/crypto/crypto_core.h +++ b/core/crypto/crypto_core.h @@ -34,10 +34,8 @@ #include "core/reference.h" class CryptoCore { - public: class MD5Context { - private: void *ctx; // To include, or not to include... @@ -51,7 +49,6 @@ public: }; class SHA1Context { - private: void *ctx; // To include, or not to include... @@ -65,7 +62,6 @@ public: }; class SHA256Context { - private: void *ctx; // To include, or not to include... @@ -79,7 +75,6 @@ public: }; class AESContext { - private: void *ctx; // To include, or not to include... diff --git a/core/crypto/hashing_context.cpp b/core/crypto/hashing_context.cpp index 0b21dead74..726dc615df 100644 --- a/core/crypto/hashing_context.cpp +++ b/core/crypto/hashing_context.cpp @@ -104,7 +104,6 @@ void HashingContext::_create_ctx(HashType p_type) { } void HashingContext::_delete_ctx() { - switch (type) { case HASH_MD5: memdelete((CryptoCore::MD5Context *)ctx); -- cgit v1.2.3