From 900e65d0091aabf24ac249ffefab627510862c01 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 12 Jun 2012 11:24:02 +0200 Subject: [PATCH] More bugfixes. --- base/configobject.cpp | 8 ++++---- base/observable.h | 4 ++-- icinga/icingaapplication.cpp | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/base/configobject.cpp b/base/configobject.cpp index 6a6dd3242..163b1e210 100644 --- a/base/configobject.cpp +++ b/base/configobject.cpp @@ -68,9 +68,9 @@ void ConfigObject::SetLocal(bool value) bool ConfigObject::IsLocal(void) const { - bool value; + bool value = false; GetProperties()->GetProperty("__local", &value); - return (value != 0); + return value; } void ConfigObject::SetAbstract(bool value) @@ -80,9 +80,9 @@ void ConfigObject::SetAbstract(bool value) bool ConfigObject::IsAbstract(void) const { - long value; + bool value = false; GetProperties()->GetProperty("__abstract", &value); - return (value != 0); + return value; } void ConfigObject::Commit(void) diff --git a/base/observable.h b/base/observable.h index 6fafa0b47..8dc13f332 100644 --- a/base/observable.h +++ b/base/observable.h @@ -74,8 +74,8 @@ public: */ void operator()(const TArgs& args) { - vector::size_type i = 0; - for (i = 0; i < m_Observers.size(); i++) { + typename vector::size_type i = 0; + for (i = 0; i < m_Observers.size(); ) { int result = m_Observers[i](args); if (result == -1) diff --git a/icinga/icingaapplication.cpp b/icinga/icingaapplication.cpp index 642c4df4a..cede383c4 100644 --- a/icinga/icingaapplication.cpp +++ b/icinga/icingaapplication.cpp @@ -62,6 +62,7 @@ int IcingaApplication::Main(const vector& args) /* load config file */ ConfigObject::Ptr fileComponentConfig = make_shared("component", "configfile"); + fileComponentConfig->SetLocal(true); fileComponentConfig->SetProperty("configFilename", args[1]); fileComponentConfig->Commit();