From e5d2c8bba2098cec18ecd3a177e265c19959e7a8 Mon Sep 17 00:00:00 2001 From: athatheocsd <athatheo@csd.auth.gr> Date: Wed, 9 Jan 2019 20:13:28 +0200 Subject: [PATCH] Trying to please cpp check --- src/Services/EventActionService.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/Services/EventActionService.cpp b/src/Services/EventActionService.cpp index 607efaa4..e2a40383 100644 --- a/src/Services/EventActionService.cpp +++ b/src/Services/EventActionService.cpp @@ -11,15 +11,13 @@ void EventActionService::addEventActionDefinitions(Message message) { if (message.messageType == 1 && message.packetType == Message::TC && message.serviceType == 19) { - bool flag = true; uint16_t index; for (index = 0; index < ECSS_EVENT_ACTION_STRUCT_ARRAY_SIZE; index++) { if (eventActionDefinitionArray[index].empty == true) { - flag = false; break; } } - if (flag == false) { + if (index < ECSS_EVENT_ACTION_STRUCT_ARRAY_SIZE) { char data[ECSS_EVENT_SERVICE_STRING_SIZE]; eventActionDefinitionArray[index].empty = false; eventActionDefinitionArray[index].enabled = true; @@ -42,7 +40,7 @@ void EventActionService::deleteEventActionDefinitions(Message message) { for (uint16_t i = 0; i < N; i++) { uint16_t applicationID = message.readEnum16(); uint16_t eventDefinitionID = message.readEnum16(); - for (uint16_t index = 0; index< ECSS_EVENT_ACTION_STRUCT_ARRAY_SIZE; index++) { + for (uint16_t index = 0; index < ECSS_EVENT_ACTION_STRUCT_ARRAY_SIZE; index++) { if (eventActionDefinitionArray[index].applicationId == applicationID && eventActionDefinitionArray[index].eventDefinitionID == eventDefinitionID) { eventActionDefinitionArray[index].empty = true; -- GitLab