From 5930d640e41df657d4051736610de2c8fc09b774 Mon Sep 17 00:00:00 2001 From: Michael Insel Date: Mon, 10 Feb 2020 18:08:20 +0100 Subject: [PATCH] IcingaDB: Fix enumeral mismatch compiler warnings This fixes 3 enumeral mismatch compiler warnings when building the IcingaDB target. --- lib/icingadb/icingadb-objects.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/icingadb/icingadb-objects.cpp b/lib/icingadb/icingadb-objects.cpp index 3b3421d80..e8940d3a5 100644 --- a/lib/icingadb/icingadb-objects.cpp +++ b/lib/icingadb/icingadb-objects.cpp @@ -1237,7 +1237,7 @@ void IcingaDB::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckResu if (!cr) { hard_state = 99; } else { - hard_state = service ? service->GetLastHardState() : host->GetLastHardState(); + hard_state = service ? Convert::ToLong(service->GetLastHardState()) : Convert::ToLong(host->GetLastHardState()); } std::vector xAdd ({ @@ -1246,7 +1246,7 @@ void IcingaDB::SendStatusUpdate(const ConfigObject::Ptr& object, const CheckResu "environment_id", SHA1(GetEnvironment()), "host_id", GetObjectIdentifier(host), "state_type", Convert::ToString(type), - "soft_state", Convert::ToString(cr ? service ? cr->GetState() : Host::CalculateState(cr->GetState()) : 99), + "soft_state", Convert::ToString(cr ? service ? Convert::ToLong(cr->GetState()) : Convert::ToLong(Host::CalculateState(cr->GetState())) : 99), "hard_state", Convert::ToString(hard_state), "attempt", Convert::ToString(checkable->GetCheckAttempt()), "previous_soft_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeSoft)), @@ -1322,7 +1322,7 @@ void IcingaDB::SendSentNotification( "notification_id", GetObjectIdentifier(notification), "host_id", GetObjectIdentifier(host), "type", Convert::ToString(type), - "state", Convert::ToString(service ? cr->GetState() : Host::CalculateState(cr->GetState())), + "state", Convert::ToString(service ? Convert::ToLong(cr->GetState()) : Convert::ToLong(Host::CalculateState(cr->GetState()))), "previous_hard_state", Convert::ToString(GetPreviousState(checkable, service, StateTypeHard)), "author", Utility::ValidateUTF8(author), "text", Utility::ValidateUTF8(finalText),