From: Peter Powell Date: Sun, 8 Dec 2019 18:44:27 +0000 (+0000) Subject: Move various static functions into an anonymous namespace. X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=eaa47be7135cf4e70482593bae4ca99f93a6d8d9;p=user%2Fhenk%2Fcode%2Finspircd.git Move various static functions into an anonymous namespace. --- diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 4f4c0be86..3ce5e553f 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -76,11 +76,22 @@ const char* ExitCodes[] = "Received SIGTERM" // 10 }; -template static void DeleteZero(T*&n) +namespace { - T* t = n; - n = NULL; - delete t; + // Deletes a pointer and then zeroes it. + template + void DeleteZero(T*& pr) + { + T* p = pr; + pr = NULL; + delete p; + } + + // Required for returning the proper value of EXIT_SUCCESS for the parent process. + void VoidSignalHandler(int) + { + exit(EXIT_STATUS_NOERROR); + } } void InspIRCd::Cleanup() @@ -133,12 +144,6 @@ void InspIRCd::SetSignals() signal(SIGTERM, InspIRCd::SetSignal); } -// Required for returning the proper value of EXIT_SUCCESS for the parent process -static void VoidSignalHandler(int signalreceived) -{ - exit(EXIT_STATUS_NOERROR); -} - bool InspIRCd::DaemonSeed() { #ifdef _WIN32