From 6489246c4b52d57b0a1fce6368787adea0115128 Mon Sep 17 00:00:00 2001 From: Steffen Gaisser Date: Tue, 17 Nov 2020 19:35:37 +0100 Subject: [PATCH] Updated include guards --- osal/rtems/Clock.cpp | 14 +++++++------- osal/rtems/MessageQueue.cpp | 6 +++--- osal/rtems/MessageQueue.h | 15 +++------------ osal/rtems/MultiObjectTask.cpp | 4 ++-- osal/rtems/MultiObjectTask.h | 2 +- osal/rtems/Mutex.h | 6 +++--- osal/rtems/MutexFactory.cpp | 1 - osal/rtems/PollingTask.cpp | 2 +- osal/rtems/PollingTask.h | 6 +++--- osal/rtems/QueueFactory.cpp | 4 ++-- osal/rtems/RtemsBasic.h | 6 +++--- osal/rtems/TaskBase.h | 6 +++--- 12 files changed, 31 insertions(+), 41 deletions(-) diff --git a/osal/rtems/Clock.cpp b/osal/rtems/Clock.cpp index 9460fd2d..e5f37ec6 100644 --- a/osal/rtems/Clock.cpp +++ b/osal/rtems/Clock.cpp @@ -3,7 +3,7 @@ #include uint16_t Clock::leapSeconds = 0; -MutexIF* Clock::timeMutex = NULL; +MutexIF* Clock::timeMutex = nullptr; uint32_t Clock::getTicksPerSecond(void){ rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second(); @@ -40,7 +40,7 @@ ReturnValue_t Clock::setClock(const timeval* time) { //SHOULDDO: Not sure if we need to protect this call somehow (by thread lock or something). //Uli: rtems docu says you can call this from an ISR, not sure if this means no protetion needed //TODO Second parameter is ISR_lock_Context - _TOD_Set(&newTime,NULL); + _TOD_Set(&newTime,nullptr); return HasReturnvaluesIF::RETURN_OK; } @@ -131,7 +131,7 @@ ReturnValue_t Clock::convertTimevalToJD2000(timeval time, double* JD2000) { ReturnValue_t Clock::convertUTCToTT(timeval utc, timeval* tt) { //SHOULDDO: works not for dates in the past (might have less leap seconds) - if (timeMutex == NULL) { + if (timeMutex == nullptr) { return HasReturnvaluesIF::RETURN_FAILED; } @@ -167,7 +167,7 @@ ReturnValue_t Clock::setLeapSeconds(const uint16_t leapSeconds_) { } ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) { - if(timeMutex==NULL){ + if(timeMutex==nullptr){ return HasReturnvaluesIF::RETURN_FAILED; } MutexHelper helper(timeMutex); @@ -178,13 +178,13 @@ ReturnValue_t Clock::getLeapSeconds(uint16_t* leapSeconds_) { } ReturnValue_t Clock::checkOrCreateClockMutex(){ - if(timeMutex==NULL){ + if(timeMutex==nullptr){ MutexFactory* mutexFactory = MutexFactory::instance(); - if (mutexFactory == NULL) { + if (mutexFactory == nullptr) { return HasReturnvaluesIF::RETURN_FAILED; } timeMutex = mutexFactory->createMutex(); - if (timeMutex == NULL) { + if (timeMutex == nullptr) { return HasReturnvaluesIF::RETURN_FAILED; } } diff --git a/osal/rtems/MessageQueue.cpp b/osal/rtems/MessageQueue.cpp index bc7e864d..839182a6 100644 --- a/osal/rtems/MessageQueue.cpp +++ b/osal/rtems/MessageQueue.cpp @@ -4,7 +4,7 @@ #include "RtemsBasic.h" #include MessageQueue::MessageQueue(size_t message_depth, size_t max_message_size) : - id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(NULL) { + id(0), lastPartner(0), defaultDestination(NO_QUEUE), internalErrorReporter(nullptr) { rtems_name name = ('Q' << 24) + (queueCounter++ << 8); rtems_status_code status = rtems_message_queue_create(name, message_depth, max_message_size, 0, &(this->id)); @@ -91,11 +91,11 @@ ReturnValue_t MessageQueue::sendMessageFrom(MessageQueueId_t sendTo, //TODO: Check if we're in ISR. if (result != RTEMS_SUCCESSFUL && !ignoreFault) { - if (internalErrorReporter == NULL) { + if (internalErrorReporter == nullptr) { internalErrorReporter = objectManager->get( objects::INTERNAL_ERROR_REPORTER); } - if (internalErrorReporter != NULL) { + if (internalErrorReporter != nullptr) { internalErrorReporter->queueMessageNotSent(); } } diff --git a/osal/rtems/MessageQueue.h b/osal/rtems/MessageQueue.h index 78a1e5ca..342f1e30 100644 --- a/osal/rtems/MessageQueue.h +++ b/osal/rtems/MessageQueue.h @@ -1,14 +1,5 @@ -/** - * @file MessageQueue.h - * - * @date 10/02/2012 - * @author Bastian Baetz - * - * @brief This file contains the definition of the MessageQueue class. - */ - -#ifndef MESSAGEQUEUE_H_ -#define MESSAGEQUEUE_H_ +#ifndef FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_ +#define FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_ #include "../../internalError/InternalErrorReporterIF.h" #include "../../ipc/MessageQueueIF.h" @@ -178,4 +169,4 @@ private: static ReturnValue_t convertReturnCode(rtems_status_code inValue); }; -#endif /* MESSAGEQUEUE_H_ */ +#endif /* FSFW_OSAL_RTEMS_MESSAGEQUEUE_H_ */ diff --git a/osal/rtems/MultiObjectTask.cpp b/osal/rtems/MultiObjectTask.cpp index a239d9cb..970d01e1 100644 --- a/osal/rtems/MultiObjectTask.cpp +++ b/osal/rtems/MultiObjectTask.cpp @@ -64,7 +64,7 @@ void MultiObjectTask::taskFunctionality() { char* ptr = rtems_object_get_name(getId(), sizeof(nameSpace), nameSpace); sif::error << "ObjectTask: " << ptr << " Deadline missed." << std::endl; - if (this->deadlineMissedFunc != NULL) { + if (this->deadlineMissedFunc != nullptr) { this->deadlineMissedFunc(); } } @@ -74,7 +74,7 @@ void MultiObjectTask::taskFunctionality() { ReturnValue_t MultiObjectTask::addComponent(object_id_t object) { ExecutableObjectIF* newObject = objectManager->get( object); - if (newObject == NULL) { + if (newObject == nullptr) { return HasReturnvaluesIF::RETURN_FAILED; } objectList.push_back(newObject); diff --git a/osal/rtems/MultiObjectTask.h b/osal/rtems/MultiObjectTask.h index 736e79dd..04d122a3 100644 --- a/osal/rtems/MultiObjectTask.h +++ b/osal/rtems/MultiObjectTask.h @@ -80,7 +80,7 @@ protected: /** * @brief The pointer to the deadline-missed function. * @details This pointer stores the function that is executed if the task's deadline is missed. - * So, each may react individually on a timing failure. The pointer may be NULL, + * So, each may react individually on a timing failure. The pointer may be nullptr, * then nothing happens on missing the deadline. The deadline is equal to the next execution * of the periodic task. */ diff --git a/osal/rtems/Mutex.h b/osal/rtems/Mutex.h index 72368210..4c861318 100644 --- a/osal/rtems/Mutex.h +++ b/osal/rtems/Mutex.h @@ -1,5 +1,5 @@ -#ifndef FRAMEWORK_OSAL_RTEMS_MUTEX_H_ -#define FRAMEWORK_OSAL_RTEMS_MUTEX_H_ +#ifndef FSFW_OSAL_RTEMS_MUTEX_H_ +#define FSFW_OSAL_RTEMS_MUTEX_H_ #include "../../ipc/MutexIF.h" #include "RtemsBasic.h" @@ -15,4 +15,4 @@ private: static uint8_t count; }; -#endif /* OS_RTEMS_MUTEX_H_ */ +#endif /* FSFW_OSAL_RTEMS_MUTEX_H_ */ diff --git a/osal/rtems/MutexFactory.cpp b/osal/rtems/MutexFactory.cpp index ea594789..24af5fa9 100644 --- a/osal/rtems/MutexFactory.cpp +++ b/osal/rtems/MutexFactory.cpp @@ -2,7 +2,6 @@ #include "Mutex.h" #include "RtemsBasic.h" -//TODO: Different variant than the lazy loading in QueueFactory. What's better and why? MutexFactory* MutexFactory::factoryInstance = new MutexFactory(); MutexFactory::MutexFactory() { diff --git a/osal/rtems/PollingTask.cpp b/osal/rtems/PollingTask.cpp index 1329638d..db7864fe 100644 --- a/osal/rtems/PollingTask.cpp +++ b/osal/rtems/PollingTask.cpp @@ -108,7 +108,7 @@ void PollingTask::taskFunctionality() { //If the deadline was missed, the deadlineMissedFunc is called. rtems_status_code status = TaskBase::restartPeriod(interval,periodId); if (status == RTEMS_TIMEOUT) { - if (this->deadlineMissedFunc != NULL) { + if (this->deadlineMissedFunc != nullptr) { this->deadlineMissedFunc(); } } diff --git a/osal/rtems/PollingTask.h b/osal/rtems/PollingTask.h index 5656e354..42deaf09 100644 --- a/osal/rtems/PollingTask.h +++ b/osal/rtems/PollingTask.h @@ -1,5 +1,5 @@ -#ifndef POLLINGTASK_H_ -#define POLLINGTASK_H_ +#ifndef FSFW_OSAL_RTEMS_POLLINGTASK_H_ +#define FSFW_OSAL_RTEMS_POLLINGTASK_H_ #include "../../tasks/FixedSlotSequence.h" #include "../../tasks/FixedTimeslotTaskIF.h" @@ -82,4 +82,4 @@ protected: void taskFunctionality( void ); }; -#endif /* POLLINGTASK_H_ */ +#endif /* FSFW_OSAL_RTEMS_POLLINGTASK_H_ */ diff --git a/osal/rtems/QueueFactory.cpp b/osal/rtems/QueueFactory.cpp index b35e7a39..ff561304 100644 --- a/osal/rtems/QueueFactory.cpp +++ b/osal/rtems/QueueFactory.cpp @@ -3,7 +3,7 @@ #include "MessageQueue.h" #include "RtemsBasic.h" -QueueFactory* QueueFactory::factoryInstance = NULL; +QueueFactory* QueueFactory::factoryInstance = nullptr; ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo, @@ -38,7 +38,7 @@ ReturnValue_t MessageQueueSenderIF::sendMessage(MessageQueueId_t sendTo, } QueueFactory* QueueFactory::instance() { - if (factoryInstance == NULL) { + if (factoryInstance == nullptr) { factoryInstance = new QueueFactory; } return factoryInstance; diff --git a/osal/rtems/RtemsBasic.h b/osal/rtems/RtemsBasic.h index 78e0d46e..d0ca5aba 100644 --- a/osal/rtems/RtemsBasic.h +++ b/osal/rtems/RtemsBasic.h @@ -1,5 +1,5 @@ -#ifndef OS_RTEMS_RTEMSBASIC_H_ -#define OS_RTEMS_RTEMSBASIC_H_ +#ifndef FSFW_OSAL_RTEMS_RTEMSBASIC_H_ +#define FSFW_OSAL_RTEMS_RTEMSBASIC_H_ #include "../../returnvalues/HasReturnvaluesIF.h" #include @@ -22,4 +22,4 @@ public: } }; -#endif /* OS_RTEMS_RTEMSBASIC_H_ */ +#endif /* FSFW_OSAL_RTEMS_RTEMSBASIC_H_ */ diff --git a/osal/rtems/TaskBase.h b/osal/rtems/TaskBase.h index 410d9110..0e186e67 100644 --- a/osal/rtems/TaskBase.h +++ b/osal/rtems/TaskBase.h @@ -1,5 +1,5 @@ -#ifndef TASKBASE_H_ -#define TASKBASE_H_ +#ifndef FSFW_OSAL_RTEMS_TASKBASE_H_ +#define FSFW_OSAL_RTEMS_TASKBASE_H_ #include "RtemsBasic.h" #include "../../tasks/PeriodicTaskIF.h" @@ -44,4 +44,4 @@ private: }; -#endif /* TASKBASE_H_ */ +#endif /* FSFW_OSAL_RTEMS_TASKBASE_H_ */