summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2019-12-08 18:44:27 +0000
committerPeter Powell <petpow@saberuk.com>2019-12-08 18:51:52 +0000
commiteaa47be7135cf4e70482593bae4ca99f93a6d8d9 (patch)
tree27add607ba7dae0bdbf94cae91b697faba124e40 /src
parentb8cb1e5f0153746c2070b513be704fc19088baa4 (diff)
Move various static functions into an anonymous namespace.
Diffstat (limited to 'src')
-rw-r--r--src/inspircd.cpp25
1 files changed, 15 insertions, 10 deletions
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<typename T> static void DeleteZero(T*&n)
+namespace
{
- T* t = n;
- n = NULL;
- delete t;
+ // Deletes a pointer and then zeroes it.
+ template<typename T>
+ 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