aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Sadie Powell2023-01-23 01:09:51 +0000
committerGravatar Sadie Powell2023-01-23 01:09:51 +0000
commit9bb0cfa4f886023d9c4c1c87e02d0f2e953495ae (patch)
tree3472b44ede9b3ef9502b391440f413e32d0e9d26
parentMove duration functions to their own header. (diff)
Default more stuff inline in the InspIRCd class.
-rw-r--r--include/inspircd.h8
-rw-r--r--src/inspircd.cpp4
2 files changed, 4 insertions, 8 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 6f1950502..a7515aabe 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -273,7 +273,7 @@ public:
/** Protocol interface, overridden by server protocol modules
*/
- ProtocolInterface* PI;
+ ProtocolInterface* PI = &DefaultProtocolInterface;
/** Default implementation of the ProtocolInterface, does nothing
*/
@@ -302,7 +302,7 @@ public:
unsigned long GenRandomInt(unsigned long max) const;
/** Fill a buffer with random bits */
- std::function<void(char*, size_t)> GenRandom;
+ std::function<void(char*, size_t)> GenRandom = &DefaultGenRandom;
/** Fills the output buffer with the specified number of random characters.
* This is the default function for InspIRCd::GenRandom.
@@ -378,7 +378,7 @@ public:
static std::string Format(va_list& vaList, const char* formatString) ATTR_PRINTF(2, 0);
/** Determines whether a nickname is valid. */
- std::function<bool(const std::string_view&)> IsNick;
+ std::function<bool(const std::string_view&)> IsNick = &DefaultIsNick;
/** Determines whether a nickname is valid according to the RFC 1459 rules.
* This is the default function for InspIRCd::IsNick.
@@ -388,7 +388,7 @@ public:
static bool DefaultIsNick(const std::string_view& nick);
/** Determines whether an ident is valid. */
- std::function<bool(const std::string_view&)> IsIdent;
+ std::function<bool(const std::string_view&)> IsIdent = &DefaultIsIdent;
/** Determines whether a ident is valid according to the RFC 1459 rules.
* This is the default function for InspIRCd::IsIdent.
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index 919e0e8ed..5a15bd6da 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -461,10 +461,6 @@ void InspIRCd::WritePID()
}
InspIRCd::InspIRCd(int argc, char** argv)
- : PI(&DefaultProtocolInterface)
- , GenRandom(&DefaultGenRandom)
- , IsNick(&DefaultIsNick)
- , IsIdent(&DefaultIsIdent)
{
ServerInstance = this;