From 98e4ddfb21d285c8b675788c155bb204822fbd4a Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Thu, 6 Feb 2020 11:25:42 +0000 Subject: Use C++11 inline initialisation for class members. --- src/modules/extra/m_ldap.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/modules/extra/m_ldap.cpp') diff --git a/src/modules/extra/m_ldap.cpp b/src/modules/extra/m_ldap.cpp index 6dfd575e9..46b76ab5f 100644 --- a/src/modules/extra/m_ldap.cpp +++ b/src/modules/extra/m_ldap.cpp @@ -54,16 +54,14 @@ class LDAPRequest public: LDAPService* service; LDAPInterface* inter; - LDAPMessage* message; /* message returned by ldap_ */ - LDAPResult* result; /* final result */ + LDAPMessage* message = nullptr; /* message returned by ldap_ */ + LDAPResult* result = nullptr; /* final result */ struct timeval tv; QueryType type; LDAPRequest(LDAPService* s, LDAPInterface* i) : service(s) , inter(i) - , message(NULL) - , result(NULL) { type = QUERY_UNKNOWN; tv.tv_sec = 0; @@ -183,9 +181,9 @@ class LDAPCompare : public LDAPRequest class LDAPService : public LDAPProvider, public SocketThread { - LDAP* con; + LDAP* con = nullptr; reference config; - time_t last_connect; + time_t last_connect = 0; int searchscope; time_t timeout; @@ -275,7 +273,7 @@ class LDAPService : public LDAPProvider, public SocketThread LDAPService(Module* c, ConfigTag* tag) : LDAPProvider(c, "LDAP/" + tag->getString("id")) - , con(NULL), config(tag), last_connect(0) + , config(tag) { std::string scope = config->getString("searchscope"); if (stdalgo::string::equalsci(scope, "base")) -- cgit v1.3.1-10-gc9f91