[icinga-checkins] icinga.org: icinga2/master: Added missing const qualifiers.

git at icinga.org git at icinga.org
Sat Feb 2 14:28:29 CET 2013


Module: icinga2
Branch: master
Commit: 18f935cfa274d67a3f7054f3a93d60d2b71da1ab
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=18f935cfa274d67a3f7054f3a93d60d2b71da1ab

Author: Gunnar Beutner <gunnar.beutner at netways.de>
Date:   Sat Feb  2 09:19:49 2013 +0100

Added missing const qualifiers.

---

 lib/base/utility.cpp |    6 +++---
 lib/base/utility.h   |    6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/base/utility.cpp b/lib/base/utility.cpp
index 2595a1d..195ac9e 100644
--- a/lib/base/utility.cpp
+++ b/lib/base/utility.cpp
@@ -170,7 +170,7 @@ void Utility::InitializeOpenSSL(void)
  * @param cakey CA certificate chain file.
  * @returns An SSL context.
  */
-shared_ptr<SSL_CTX> Utility::MakeSSLContext(String pubkey, String privkey, String cakey)
+shared_ptr<SSL_CTX> Utility::MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey)
 {
 	InitializeOpenSSL();
 
@@ -224,7 +224,7 @@ String Utility::GetCertificateCN(const shared_ptr<X509>& certificate)
  * @param pemfile The filename.
  * @returns An X509 certificate.
  */
-shared_ptr<X509> Utility::GetX509Certificate(String pemfile)
+shared_ptr<X509> Utility::GetX509Certificate(const String& pemfile)
 {
 	X509 *cert;
 	BIO *fpcert = BIO_new(BIO_s_file());
@@ -254,7 +254,7 @@ shared_ptr<X509> Utility::GetX509Certificate(String pemfile)
  * @param text The String that should be checked.
  * @returns true if the wildcard pattern matches, false otherwise.
  */
-bool Utility::Match(String pattern, String text)
+bool Utility::Match(const String& pattern, const String& text)
 {
 	return (match(pattern.CStr(), text.CStr()) == 0);
 }
diff --git a/lib/base/utility.h b/lib/base/utility.h
index 347fd18..bbccaa4 100644
--- a/lib/base/utility.h
+++ b/lib/base/utility.h
@@ -37,11 +37,11 @@ public:
 
 	static void Daemonize(void);
 
-	static shared_ptr<SSL_CTX> MakeSSLContext(String pubkey, String privkey, String cakey);
+	static shared_ptr<SSL_CTX> MakeSSLContext(const String& pubkey, const String& privkey, const String& cakey);
 	static String GetCertificateCN(const shared_ptr<X509>& certificate);
-	static shared_ptr<X509> GetX509Certificate(String pemfile);
+	static shared_ptr<X509> GetX509Certificate(const String& pemfile);
 
-	static bool Match(String pattern, String text);
+	static bool Match(const String& pattern, const String& text);
 
 	static String DirName(const String& path);
 	static String BaseName(const String& path);





More information about the icinga-checkins mailing list