diff --git a/inc/Helpers/TimeHelper.hpp b/inc/Helpers/TimeHelper.hpp index 7c5ac2b5976f688794181208930b3f9ca0028a19..f2b8bf524cf77357179a09c0a225331709b93820 100644 --- a/inc/Helpers/TimeHelper.hpp +++ b/inc/Helpers/TimeHelper.hpp @@ -91,7 +91,7 @@ public: * @param seconds elapsed seconds since Unix epoch * @return the UTC date based on the /p */ - static struct TimeAndDate parseCDSTimeFormat(uint8_t *data, uint8_t length); + static struct TimeAndDate parseCDSTimeFormat(const uint8_t *data, uint8_t length); /** * Dummy function created only to access mkUTCtime for testing diff --git a/src/Helpers/TimeHelper.cpp b/src/Helpers/TimeHelper.cpp index 290b401b4e835911319ab13e83d8028815347562..e1db8e0af6bebf9ceb4dc077964f6e0ae2c78ddb 100644 --- a/src/Helpers/TimeHelper.cpp +++ b/src/Helpers/TimeHelper.cpp @@ -96,13 +96,13 @@ uint64_t TimeHelper::implementCDSTimeFormat(struct TimeAndDate &TimeInfo) { * Agency-defined epoch,that it will be 1 January 1970(1/1/1970) 00:00:00(hours:minutes:seconds) * This epoch is configured from the current implementation, using mktime() function */ - uint16_t elapsedDays = static_cast<uint16_t>(seconds / 86400); + auto elapsedDays = static_cast<uint16_t>(seconds / 86400); /** * The `ms of day` segment, 32 bits as defined in standard. The `ms of the day` and DAY` * should give the time passed from the defined epoch (1/1/1970) */ - uint32_t msOfDay = static_cast<uint32_t >((seconds % 86400) * 1000); + auto msOfDay = static_cast<uint32_t >((seconds % 86400) * 1000); /** * Define CDS time format @@ -118,7 +118,7 @@ uint64_t TimeHelper::implementCDSTimeFormat(struct TimeAndDate &TimeInfo) { return timeFormat; } -struct TimeAndDate TimeHelper::parseCDSTimeFormat(uint8_t *data, uint8_t length) { +struct TimeAndDate TimeHelper::parseCDSTimeFormat(const uint8_t *data, uint8_t length) { // check if we have the correct length of the packet data assertI(length != 48, ErrorHandler::InternalErrorType::UnknownInternalError);