diff --git a/container/DynamicFIFO.h b/container/DynamicFIFO.h index 9af98f96..abb53330 100644 --- a/container/DynamicFIFO.h +++ b/container/DynamicFIFO.h @@ -1,7 +1,7 @@ -#ifndef FRAMEWORK_CONTAINER_DYNAMICFIFO_H_ -#define FRAMEWORK_CONTAINER_DYNAMICFIFO_H_ +#ifndef FSFW_CONTAINER_DYNAMICFIFO_H_ +#define FSFW_CONTAINER_DYNAMICFIFO_H_ -#include "../container/FIFOBase.h" +#include "FIFOBase.h" #include /** @@ -22,7 +22,7 @@ public: // trying to pass the pointer of the uninitialized vector // to the FIFOBase constructor directly lead to a super evil bug. // So we do it like this now. - this->setData(fifoVector.data()); + this->setContainer(fifoVector.data()); }; /** @@ -31,7 +31,7 @@ public: */ DynamicFIFO(const DynamicFIFO& other): FIFOBase(other), fifoVector(other.maxCapacity) { - this->setData(fifoVector.data()); + this->setContainer(fifoVector.data()); } @@ -39,4 +39,4 @@ private: std::vector fifoVector; }; -#endif /* FRAMEWORK_CONTAINER_DYNAMICFIFO_H_ */ +#endif /* FSFW_CONTAINER_DYNAMICFIFO_H_ */ diff --git a/container/FIFO.h b/container/FIFO.h index 4688a7b0..19f763fc 100644 --- a/container/FIFO.h +++ b/container/FIFO.h @@ -1,8 +1,7 @@ -#ifndef FRAMEWORK_CONTAINER_FIFO_H_ -#define FRAMEWORK_CONTAINER_FIFO_H_ +#ifndef FSFW_CONTAINER_FIFO_H_ +#define FSFW_CONTAINER_FIFO_H_ -#include "../returnvalues/HasReturnvaluesIF.h" -#include "../container/FIFOBase.h" +#include "FIFOBase.h" #include /** @@ -17,18 +16,20 @@ template class FIFO: public FIFOBase { public: - FIFO(): FIFOBase(fifoArray.data(), capacity) {}; + FIFO(): FIFOBase(nullptr, capacity) { + this->setContainer(fifoArray.data()); + }; /** * @brief Custom copy constructor to set pointer correctly. * @param other */ FIFO(const FIFO& other): FIFOBase(other) { - this->setData(fifoArray.data()); + this->setContainer(fifoArray.data()); } private: std::array fifoArray; }; -#endif /* FRAMEWORK_CONTAINERS_STATICFIFO_H_ */ +#endif /* FSFW_CONTAINER_FIFO_H_ */ diff --git a/container/FIFOBase.h b/container/FIFOBase.h index 410e52a5..b744706d 100644 --- a/container/FIFOBase.h +++ b/container/FIFOBase.h @@ -1,5 +1,5 @@ -#ifndef FRAMEWORK_CONTAINER_FIFOBASE_H_ -#define FRAMEWORK_CONTAINER_FIFOBASE_H_ +#ifndef FSFW_CONTAINER_FIFOBASE_H_ +#define FSFW_CONTAINER_FIFOBASE_H_ #include "../returnvalues/HasReturnvaluesIF.h" #include @@ -48,7 +48,7 @@ public: size_t getMaxCapacity() const; protected: - void setData(T* data); + void setContainer(T* data); size_t maxCapacity = 0; T* values; @@ -60,6 +60,6 @@ protected: size_t next(size_t current); }; -#include "../container/FIFOBase.tpp" +#include "FIFOBase.tpp" -#endif /* FRAMEWORK_CONTAINER_FIFOBASE_H_ */ +#endif /* FSFW_CONTAINER_FIFOBASE_H_ */ diff --git a/container/FIFOBase.tpp b/container/FIFOBase.tpp index c73e9d59..d54b3f8f 100644 --- a/container/FIFOBase.tpp +++ b/container/FIFOBase.tpp @@ -1,7 +1,7 @@ -#ifndef FRAMEWORK_CONTAINER_FIFOBASE_TPP_ -#define FRAMEWORK_CONTAINER_FIFOBASE_TPP_ +#ifndef FSFW_CONTAINER_FIFOBASE_TPP_ +#define FSFW_CONTAINER_FIFOBASE_TPP_ -#ifndef FRAMEWORK_CONTAINER_FIFOBASE_H_ +#ifndef FSFW_CONTAINER_FIFOBASE_H_ #error Include FIFOBase.h before FIFOBase.tpp! #endif @@ -80,7 +80,7 @@ inline size_t FIFOBase::getMaxCapacity() const { template -inline void FIFOBase::setData(T *data) { +inline void FIFOBase::setContainer(T *data) { this->values = data; } diff --git a/parameters/ParameterWrapper.cpp b/parameters/ParameterWrapper.cpp index d020da33..6adc6857 100644 --- a/parameters/ParameterWrapper.cpp +++ b/parameters/ParameterWrapper.cpp @@ -270,7 +270,8 @@ ReturnValue_t ParameterWrapper::copyFrom(const ParameterWrapper *from, //need a type to do arithmetic uint8_t* typedData = static_cast(data); for (uint8_t fromRow = 0; fromRow < from->rows; fromRow++) { - uint8_t offset = (((startingRow + fromRow) * columns) + startingColumn) * typeSize; + size_t offset = (((startingRow + fromRow) * columns) + + startingColumn) * typeSize; std::memcpy(typedData + offset, from->readonlyData, typeSize * from->columns); } diff --git a/tmtcservices/CommandingServiceBase.h b/tmtcservices/CommandingServiceBase.h index 4a180445..29ab967a 100644 --- a/tmtcservices/CommandingServiceBase.h +++ b/tmtcservices/CommandingServiceBase.h @@ -1,5 +1,5 @@ -#ifndef FRAMEWORK_TMTCSERVICES_COMMANDINGSERVICEBASE_H_ -#define FRAMEWORK_TMTCSERVICES_COMMANDINGSERVICEBASE_H_ +#ifndef FSFW_TMTCSERVICES_COMMANDINGSERVICEBASE_H_ +#define FSFW_TMTCSERVICES_COMMANDINGSERVICEBASE_H_ #include "../objectmanager/SystemObject.h" #include "../storagemanager/StorageManagerIF.h" @@ -345,4 +345,4 @@ private: void checkTimeout(); }; -#endif /* COMMANDINGSERVICEBASE_H_ */ +#endif /* FSFW_TMTCSERVICES_COMMANDINGSERVICEBASE_H_ */