Replaced Magic Numbers

This commit is contained in:
Steffen Gaisser 2021-04-20 20:45:15 +02:00
parent 6d0bc26624
commit 03ef63302b
Signed by: gaisser
GPG Key ID: 83D8D0FE95C319A6
2 changed files with 6 additions and 7 deletions

View File

@ -5,8 +5,7 @@
SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent, SubsystemBase::SubsystemBase(object_id_t setObjectId, object_id_t parent,
Mode_t initialMode, uint16_t commandQueueDepth) : Mode_t initialMode, uint16_t commandQueueDepth) :
SystemObject(setObjectId), mode(initialMode), submode(SUBMODE_NONE), SystemObject(setObjectId), mode(initialMode),
childrenChangedMode(false),
commandQueue(QueueFactory::instance()->createMessageQueue( commandQueue(QueueFactory::instance()->createMessageQueue(
commandQueueDepth, CommandMessage::MAX_MESSAGE_SIZE)), commandQueueDepth, CommandMessage::MAX_MESSAGE_SIZE)),
healthHelper(this, setObjectId), modeHelper(this), parentId(parent) { healthHelper(this, setObjectId), modeHelper(this), parentId(parent) {
@ -167,16 +166,16 @@ MessageQueueId_t SubsystemBase::getCommandQueue() const {
} }
ReturnValue_t SubsystemBase::initialize() { ReturnValue_t SubsystemBase::initialize() {
MessageQueueId_t parentQueue = 0; MessageQueueId_t parentQueue = MessageQueueIF::NO_QUEUE;
ReturnValue_t result = SystemObject::initialize(); ReturnValue_t result = SystemObject::initialize();
if (result != RETURN_OK) { if (result != RETURN_OK) {
return result; return result;
} }
if (parentId != 0) { if (parentId != objects::NO_OBJECT) {
SubsystemBase *parent = objectManager->get<SubsystemBase>(parentId); SubsystemBase *parent = objectManager->get<SubsystemBase>(parentId);
if (parent == NULL) { if (parent == nullptr) {
return RETURN_FAILED; return RETURN_FAILED;
} }
parentQueue = parent->getCommandQueue(); parentQueue = parent->getCommandQueue();

View File

@ -56,9 +56,9 @@ protected:
Mode_t mode; Mode_t mode;
Submode_t submode; Submode_t submode = SUBMODE_NONE;
bool childrenChangedMode; bool childrenChangedMode = false;
/** /**
* Always check this against <=0, so you are robust against too many replies * Always check this against <=0, so you are robust against too many replies