From: Gunnar Beutner Date: Sun, 17 Jun 2012 14:37:36 +0000 (+0200) Subject: Code cleanups. X-Git-Tag: v0.0.1~414 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7f4c3f84bebc4228d83f249f4bdd4b7b84c2ac79;p=icinga2 Code cleanups. --- diff --git a/base/application.cpp b/base/application.cpp index 070d0b40a..d057d8ec8 100644 --- a/base/application.cpp +++ b/base/application.cpp @@ -295,7 +295,7 @@ Component::Ptr Application::GetComponent(const string& name) const * @param facility The log facility. * @param message The message. */ -void Application::Log(LogSeverity severity, string facility, string message) +void Application::Log(LogSeverity severity, const string& facility, const string& message) { char timestamp[100]; diff --git a/base/application.h b/base/application.h index 47ff8465a..520cd3573 100644 --- a/base/application.h +++ b/base/application.h @@ -53,7 +53,7 @@ public: static void Shutdown(void); - static void Log(LogSeverity severity, string facility, string message); + static void Log(LogSeverity severity, const string& facility, const string& message); shared_ptr LoadComponent(const string& path, const ConfigObject::Ptr& componentConfig); diff --git a/base/dictionary.cpp b/base/dictionary.cpp index 81da81251..c61fa72b9 100644 --- a/base/dictionary.cpp +++ b/base/dictionary.cpp @@ -51,6 +51,12 @@ long Dictionary::GetLength(void) const return m_Data.size(); } +/** + * Checks whether the dictionary contains the specified key. + * + * @param key The key. + * @returns true if the dictionary contains the key, false otherwise. + */ bool Dictionary::Contains(const string& key) const { return (m_Data.find(key) != m_Data.end()); diff --git a/base/utility.cpp b/base/utility.cpp index fa89e7d75..d280edd29 100644 --- a/base/utility.cpp +++ b/base/utility.cpp @@ -87,9 +87,7 @@ shared_ptr Utility::MakeSSLContext(string pubkey, string privkey, strin { InitializeOpenSSL(); - SSL_METHOD *sslMethod = (SSL_METHOD *)TLSv1_method(); - - shared_ptr sslContext = shared_ptr(SSL_CTX_new(sslMethod), SSL_CTX_free); + shared_ptr sslContext = shared_ptr(SSL_CTX_new(TLSv1_method()), SSL_CTX_free); SSL_CTX_set_mode(sslContext.get(), SSL_MODE_ENABLE_PARTIAL_WRITE | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);