From d6d61354eda9bee8e2fca1b1fad8f81c468c6a32 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Thu, 11 Jul 2013 10:57:21 +0200 Subject: [PATCH] livestatus: time values must be integer seconds fixes #4406 --- components/livestatus/commentstable.cpp | 4 ++-- components/livestatus/downtimestable.cpp | 6 +++--- components/livestatus/hoststable.cpp | 8 ++++---- components/livestatus/servicestable.cpp | 8 ++++---- components/livestatus/statustable.cpp | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/components/livestatus/commentstable.cpp b/components/livestatus/commentstable.cpp index f551d180e..088f92633 100644 --- a/components/livestatus/commentstable.cpp +++ b/components/livestatus/commentstable.cpp @@ -117,7 +117,7 @@ Value CommentsTable::EntryTimeAccessor(const Value& row) if (!comment) return Value(); - return comment->Get("entry_time"); + return static_cast(comment->Get("entry_time")); } Value CommentsTable::TypeAccessor(const Value& row) @@ -175,5 +175,5 @@ Value CommentsTable::ExpireTimeAccessor(const Value& row) if (!comment) return Value(); - return comment->Get("expire_time"); + return static_cast(comment->Get("expire_time")); } diff --git a/components/livestatus/downtimestable.cpp b/components/livestatus/downtimestable.cpp index 2222f647b..880798de9 100644 --- a/components/livestatus/downtimestable.cpp +++ b/components/livestatus/downtimestable.cpp @@ -105,7 +105,7 @@ Value DowntimesTable::EntryTimeAccessor(const Value& row) { Dictionary::Ptr downtime = Service::GetDowntimeByID(row); - return downtime->Get("entry_time"); + return static_cast(downtime->Get("entry_time")); } Value DowntimesTable::TypeAccessor(const Value& row) @@ -126,14 +126,14 @@ Value DowntimesTable::StartTimeAccessor(const Value& row) { Dictionary::Ptr downtime = Service::GetDowntimeByID(row); - return downtime->Get("start_time"); + return static_cast(downtime->Get("start_time")); } Value DowntimesTable::EndTimeAccessor(const Value& row) { Dictionary::Ptr downtime = Service::GetDowntimeByID(row); - return downtime->Get("end_time"); + return static_cast(downtime->Get("end_time")); } Value DowntimesTable::FixedAccessor(const Value& row) diff --git a/components/livestatus/hoststable.cpp b/components/livestatus/hoststable.cpp index 0333362c5..a701924ee 100644 --- a/components/livestatus/hoststable.cpp +++ b/components/livestatus/hoststable.cpp @@ -509,7 +509,7 @@ Value HostsTable::NextCheckAccessor(const Value& row) if (!hc) return Value(); - return hc->GetNextCheck(); + return static_cast(hc->GetNextCheck()); } Value HostsTable::LastHardStateChangeAccessor(const Value& row) @@ -520,7 +520,7 @@ Value HostsTable::LastHardStateChangeAccessor(const Value& row) if (!hc) return Value(); - return hc->GetLastHardStateChange(); + return static_cast(hc->GetLastHardStateChange()); } Value HostsTable::HasBeenCheckedAccessor(const Value& row) @@ -617,12 +617,12 @@ Value HostsTable::LastCheckAccessor(const Value& row) if (!hc) return Value(); - return hc->GetLastCheck(); + return static_cast(hc->GetLastCheck()); } Value HostsTable::LastStateChangeAccessor(const Value& row) { - return static_cast(row)->GetLastStateChange(); + return static_cast(static_cast(row)->GetLastStateChange()); } Value HostsTable::LastTimeUpAccessor(const Value& row) diff --git a/components/livestatus/servicestable.cpp b/components/livestatus/servicestable.cpp index afafcfcec..c47788e84 100644 --- a/components/livestatus/servicestable.cpp +++ b/components/livestatus/servicestable.cpp @@ -389,12 +389,12 @@ Value ServicesTable::LastTimeUnknownAccessor(const Value& row) Value ServicesTable::LastCheckAccessor(const Value& row) { - return static_cast(row)->GetLastCheck(); + return static_cast(static_cast(row)->GetLastCheck()); } Value ServicesTable::NextCheckAccessor(const Value& row) { - return static_cast(row)->GetNextCheck(); + return static_cast(static_cast(row)->GetNextCheck()); } Value ServicesTable::LastNotificationAccessor(const Value& row) @@ -417,12 +417,12 @@ Value ServicesTable::CurrentNotificationNumberAccessor(const Value& row) Value ServicesTable::LastStateChangeAccessor(const Value& row) { - return static_cast(row)->GetLastStateChange(); + return static_cast(static_cast(row)->GetLastStateChange()); } Value ServicesTable::LastHardStateChangeAccessor(const Value& row) { - return static_cast(row)->GetLastHardStateChange(); + return static_cast(static_cast(row)->GetLastHardStateChange()); } Value ServicesTable::ScheduledDowntimeDepthAccessor(const Value& row) diff --git a/components/livestatus/statustable.cpp b/components/livestatus/statustable.cpp index ff4dc4543..65e6dd1e6 100644 --- a/components/livestatus/statustable.cpp +++ b/components/livestatus/statustable.cpp @@ -312,7 +312,7 @@ Value StatusTable::CheckExternalCommandsAccessor(const Value& row) Value StatusTable::ProgramStartAccessor(const Value& row) { - return IcingaApplication::GetInstance()->GetStartTime(); + return static_cast(IcingaApplication::GetInstance()->GetStartTime()); } Value StatusTable::LastCommandCheckAccessor(const Value& row) -- 2.40.0