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

View File

@ -56,9 +56,9 @@ protected:
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