mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-22 21:24:41 +02:00
Fix warnings related to enum integer conversion
This commit is contained in:
parent
6a6c494279
commit
f8d3bacc29
@ -472,7 +472,8 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
|
||||
|
||||
if (type == NotificationProblem && !reminder && !checkable->GetVolatile()) {
|
||||
auto [host, service] = GetHostService(checkable);
|
||||
uint_fast8_t state = service ? service->GetState() : host->GetState();
|
||||
uint_fast8_t state = service ? static_cast<uint_fast8_t>(service->GetState())
|
||||
: static_cast<uint_fast8_t>(host->GetState());
|
||||
|
||||
if (state == (uint_fast8_t)GetLastNotifiedStatePerUser()->Get(userName)) {
|
||||
auto stateStr (service ? NotificationServiceStateToString(service->GetState()) : NotificationHostStateToString(host->GetState()));
|
||||
@ -501,7 +502,8 @@ void Notification::BeginExecuteNotification(NotificationType type, const CheckRe
|
||||
|
||||
if (type == NotificationProblem) {
|
||||
auto [host, service] = GetHostService(checkable);
|
||||
uint_fast8_t state = service ? service->GetState() : host->GetState();
|
||||
uint_fast8_t state = service ? static_cast<uint_fast8_t>(service->GetState())
|
||||
: static_cast<uint_fast8_t>(host->GetState());
|
||||
|
||||
if (state != (uint_fast8_t)GetLastNotifiedStatePerUser()->Get(userName)) {
|
||||
GetLastNotifiedStatePerUser()->Set(userName, state);
|
||||
|
@ -2061,7 +2061,7 @@ void IcingaDB::SendSentNotification(
|
||||
"host_id", GetObjectIdentifier(host),
|
||||
"type", Convert::ToString(type),
|
||||
"state", Convert::ToString(cr ? service ? Convert::ToLong(cr->GetState()) : Convert::ToLong(Host::CalculateState(cr->GetState())) : 99),
|
||||
"previous_hard_state", Convert::ToString(cr ? Convert::ToLong(service ? cr->GetPreviousHardState() : Host::CalculateState(cr->GetPreviousHardState())) : 99),
|
||||
"previous_hard_state", Convert::ToString(cr ? service ? Convert::ToLong(cr->GetPreviousHardState()) : Convert::ToLong(Host::CalculateState(cr->GetPreviousHardState())) : 99),
|
||||
"author", Utility::ValidateUTF8(author),
|
||||
"text", Utility::ValidateUTF8(finalText),
|
||||
"users_notified", Convert::ToString(usersAmount),
|
||||
|
Loading…
x
Reference in New Issue
Block a user