]> granicus.if.org Git - icinga2/commitdiff
Code cleanups.
authorGunnar Beutner <gunnar@beutner.name>
Sun, 17 Jun 2012 14:37:36 +0000 (16:37 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Sun, 17 Jun 2012 14:37:36 +0000 (16:37 +0200)
base/application.cpp
base/application.h
base/dictionary.cpp
base/utility.cpp

index 070d0b40ad4a5bac2062f67235c1f28902d596d1..d057d8ec81dbfec1bdc87c2828d0c6069f2ee812 100644 (file)
@@ -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];
 
index 47ff8465a4a2bb21131185a715cd3b6ce646cb9e..520cd35732cf3686b936730970e97e155cf06437 100644 (file)
@@ -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<Component> LoadComponent(const string& path,
            const ConfigObject::Ptr& componentConfig);
index 81da81251153c6ae7e340ae134454ed389352f4d..c61fa72b9de4554f18a893115ddea8dbfd06b05b 100644 (file)
@@ -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());
index fa89e7d75d6ec4f1284e7ce64e160291380be0f2..d280edd2925c9411c021f827185d8fb3fb20537a 100644 (file)
@@ -87,9 +87,7 @@ shared_ptr<SSL_CTX> Utility::MakeSSLContext(string pubkey, string privkey, strin
 {
        InitializeOpenSSL();
 
-       SSL_METHOD *sslMethod = (SSL_METHOD *)TLSv1_method();
-
-       shared_ptr<SSL_CTX> sslContext = shared_ptr<SSL_CTX>(SSL_CTX_new(sslMethod), SSL_CTX_free);
+       shared_ptr<SSL_CTX> sslContext = shared_ptr<SSL_CTX>(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);