]> granicus.if.org Git - icinga2/commitdiff
Build fixes for *NIX.
authorGunnar Beutner <gunnar@beutner.name>
Mon, 16 Jul 2012 22:01:23 +0000 (00:01 +0200)
committerGunnar Beutner <gunnar@beutner.name>
Mon, 16 Jul 2012 22:01:23 +0000 (00:01 +0200)
base/objectmap.h
base/process.cpp
cib/host.cpp
cib/service.cpp
components/compat/compatcomponent.cpp
components/discovery/discoverycomponent.cpp

index b275fc2ce1bae5839717e3a2822775d02236f135..ec7b9cfdf2ba1d08dfecff98756b4e41f3c5dfc8 100644 (file)
@@ -138,13 +138,15 @@ namespace boost
 template<typename TKey, typename TValue>
 struct range_mutable_iterator<shared_ptr<icinga::ObjectMap<TKey, TValue> > >
 {
-       typedef typename shared_ptr<icinga::ObjectMap<TKey, TValue> >::Iterator type;
+       typedef shared_ptr<icinga::ObjectMap<TKey, TValue> > objtype;
+       typedef typename objtype::Iterator type;
 };
 
 template<typename TKey, typename TValue>
 struct range_const_iterator<shared_ptr<icinga::ObjectMap<TKey, TValue> > >
 {
-       typedef typename shared_ptr<icinga::ObjectMap<TKey, TValue> > type;
+       typedef shared_ptr<icinga::ObjectMap<TKey, TValue> > objtype;
+       typedef typename objtype::Iterator type;
 };
 
 }
index 4b24e3881ae2bee7f027ea3c4c4e0238013a454d..38990a89fd849b5f8f4dd26538e5d7ea445ea74d 100644 (file)
@@ -67,7 +67,7 @@ void Process::WorkerThreadProc(void)
                        FD_ZERO(&readfds);
 
                        int fd;
-                       BOOST_FOREACH(tie(fd, tuples::ignore), tasks);
+                       BOOST_FOREACH(tie(fd, tuples::ignore), tasks) {
                                if (fd > nfds)
                                        nfds = fd;
 
index 9b697c0822145fa8e8a419cecc09ff2498105dc5..90cfdcb39f7c6382c211666e68b611214f8b0bff 100644 (file)
@@ -69,7 +69,7 @@ set<string> Host::GetParents(void) const
        if (GetProperty("dependencies", &dependencies)) {
                dependencies = Service::ResolveDependencies(*this, dependencies);
 
-               string dependency;
+               Variant dependency;
                BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
                        Service service = Service::GetByName(dependency);
 
@@ -99,7 +99,7 @@ bool Host::IsReachable(void) const
        if (GetProperty("dependencies", &dependencies)) {
                dependencies = Service::ResolveDependencies(*this, dependencies);
 
-               string dependency;
+               Variant dependency;
                BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
                        Service service = Service::GetByName(dependency);
 
@@ -119,7 +119,7 @@ bool Host::IsUp(void) const
        if (GetProperty("hostchecks", &hostchecks)) {
                hostchecks = Service::ResolveDependencies(*this, hostchecks);
 
-               string hostcheck;
+               Variant hostcheck;
                BOOST_FOREACH(tie(tuples::ignore, hostcheck), hostchecks) {
                        Service service = Service::GetByName(hostcheck);
 
index 33773203e0b18d9108fe00cf63f7e7524a17d5f9..6e1ec9bd63998e9ba0bfadc4b9c5c054736f742e 100644 (file)
@@ -117,7 +117,7 @@ void Service::GetDependenciesRecursive(const Dictionary::Ptr& result) const {
        if (!dependencies)
                return;
 
-       string dependency;
+       Variant dependency;
        BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
                if (result->Contains(dependency))
                        continue;
@@ -148,7 +148,7 @@ bool Service::IsReachable(void) const
        Dictionary::Ptr dependencies = boost::make_shared<Dictionary>();
        GetDependenciesRecursive(dependencies);
 
-       string dependency;
+       Variant dependency;
        BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
                Service service = Service::GetByName(dependency);
 
@@ -379,7 +379,7 @@ bool Service::IsAllowedChecker(const string& checker) const
        if (!checkers)
                return true;
 
-       string pattern;
+       Variant pattern;
        BOOST_FOREACH(tie(tuples::ignore, pattern), checkers) {
                if (Utility::Match(pattern, checker))
                        return true;
@@ -395,14 +395,14 @@ Dictionary::Ptr Service::ResolveDependencies(Host host, const Dictionary::Ptr& d
 
        Dictionary::Ptr result = boost::make_shared<Dictionary>();
 
-       string dependency;
+       Variant dependency;
        BOOST_FOREACH(tie(tuples::ignore, dependency), dependencies) {
                string name;
 
                if (services && services->Contains(dependency))
-                       name = host.GetName() + "-" + dependency;
+                       name = host.GetName() + "-" + static_cast<string>(dependency);
                else
-                       name = dependency;
+                       name = static_cast<string>(dependency);
 
                result->Set(name, name);
        }
index 0d759368f27dfae02285ccf4f85f47e78be6f486..8e7403205256fda5da46adf9efedffb5aded6bb0 100644 (file)
@@ -241,7 +241,7 @@ void CompatComponent::StatusTimerHandler(void)
                dict = host.GetGroups();
 
                if (dict) {
-                       string hostgroup;
+                       Variant hostgroup;
                        BOOST_FOREACH(tie(tuples::ignore, hostgroup), dict) {
                                hostgroups[hostgroup].push_back(host.GetName());
                        }
@@ -286,7 +286,7 @@ void CompatComponent::StatusTimerHandler(void)
                dict = service.GetGroups();
 
                if (dict) {
-                       string servicegroup;
+                       Variant servicegroup;
                        BOOST_FOREACH(tie(tuples::ignore, servicegroup), dict) {
                                servicegroups[servicegroup].push_back(service);
                        }
index 29811a2ae9d090fda32442214afadedaa697d31c..3e2adc0f3eeef235ada9a76cd4765d47580e48df 100644 (file)
@@ -333,7 +333,7 @@ bool DiscoveryComponent::HasMessagePermission(const Dictionary::Ptr& roles, cons
                if (!role->GetProperty(messageType, &permissions))
                        continue;
 
-               string permission;
+               Variant permission;
                BOOST_FOREACH(tie(tuples::ignore, permission), permissions) {
                        if (Utility::Match(permission, message))
                                return true;
@@ -378,7 +378,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D
 
        Dictionary::Ptr publications;
        if (message.GetPublications(&publications)) {
-               string publication;
+               Variant publication;
                BOOST_FOREACH(tie(tuples::ignore, publication), publications) {
                        if (trusted || HasMessagePermission(roles, "publications", publication)) {
                                info->Publications.insert(publication);
@@ -390,7 +390,7 @@ void DiscoveryComponent::ProcessDiscoveryMessage(const string& identity, const D
 
        Dictionary::Ptr subscriptions;
        if (message.GetSubscriptions(&subscriptions)) {
-               string subscription;
+               Variant subscription;
                BOOST_FOREACH(tie(tuples::ignore, subscription), subscriptions) {
                        if (trusted || HasMessagePermission(roles, "subscriptions", subscription)) {
                                info->Subscriptions.insert(subscription);