]> granicus.if.org Git - icinga2/commitdiff
Fix compiler warning in *::NotifyActive
authorGunnar Beutner <gunnar.beutner@netways.de>
Wed, 13 Apr 2016 06:58:16 +0000 (08:58 +0200)
committerGunnar Beutner <gunnar.beutner@netways.de>
Wed, 20 Apr 2016 08:09:35 +0000 (10:09 +0200)
fixes #11577

tools/mkclass/classcompiler.cpp

index d0aab97a9717128b5649642350aeffa553664539..60ae196c717e41d71bae029b2e63e2f6aee92261 100644 (file)
@@ -935,11 +935,11 @@ void ClassCompiler::HandleClass(const Klass& klass, const ClassDebugInfo&)
                                 << "\t" << "virtual void Notify" << it->GetFriendlyName() << "(const Value& cookie = Empty);" << std::endl;
 
                        m_Impl << "void ObjectImpl<" << klass.Name << ">::Notify" << it->GetFriendlyName() << "(const Value& cookie)" << std::endl
-                              << "{" << std::endl
-                              << "\t" << "ConfigObject *dobj = dynamic_cast<ConfigObject *>(this);" << std::endl;
+                              << "{" << std::endl;
 
                        if (it->Name != "active") {
-                               m_Impl << "\t" << "if (!dobj || dobj->IsActive())" << std::endl
+                               m_Impl << "\t" << "ConfigObject *dobj = dynamic_cast<ConfigObject *>(this);" << std::endl
+                                      << "\t" << "if (!dobj || dobj->IsActive())" << std::endl
                                       << "\t";
                        }