From 9bb0cfa4f886023d9c4c1c87e02d0f2e953495ae Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 23 Jan 2023 01:09:51 +0000 Subject: Default more stuff inline in the InspIRCd class. --- include/inspircd.h | 8 ++++---- src/inspircd.cpp | 4 ---- 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 GenRandom; + std::function 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 IsNick; + std::function 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 IsIdent; + std::function 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; -- cgit v1.3.1-10-gc9f91