diff --git a/lib/icinga/checkresult.cpp b/lib/icinga/checkresult.cpp index 8140db4bc..a577c4998 100644 --- a/lib/icinga/checkresult.cpp +++ b/lib/icinga/checkresult.cpp @@ -24,10 +24,8 @@ using namespace icinga; REGISTER_TYPE(CheckResult); -INITIALIZE_ONCE(&CheckResult::StaticInitialize); -void CheckResult::StaticInitialize(void) -{ +INITIALIZE_ONCE([]() { ScriptGlobal::Set("ServiceOK", ServiceOK); ScriptGlobal::Set("ServiceWarning", ServiceWarning); ScriptGlobal::Set("ServiceCritical", ServiceCritical); @@ -35,7 +33,7 @@ void CheckResult::StaticInitialize(void) ScriptGlobal::Set("HostUp", HostUp); ScriptGlobal::Set("HostDown", HostDown); -} +}) double CheckResult::CalculateExecutionTime(void) const { diff --git a/lib/icinga/checkresult.hpp b/lib/icinga/checkresult.hpp index 508d0ff7e..eeade11c8 100644 --- a/lib/icinga/checkresult.hpp +++ b/lib/icinga/checkresult.hpp @@ -38,8 +38,6 @@ public: double CalculateExecutionTime(void) const; double CalculateLatency(void) const; - - static void StaticInitialize(void); }; }