Skip to content

Commit

Permalink
iox-#1036 Make types more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Sep 1, 2023
1 parent b0c6ef4 commit 3b7f0ce
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class MessageQueue
/// @todo iox-#1036 Remove when all channels are ported to the builder pattern
static expected<MessageQueue, IpcChannelError> create(const IpcChannelName_t& name,
const IpcChannelSide channelSide,
const size_t maxMsgSize = MAX_MESSAGE_SIZE,
const uint64_t maxMsgSize = MAX_MESSAGE_SIZE,
const uint64_t maxMsgNumber = MAX_MESSAGE_NUMBER) noexcept;

/// @todo iox-#1036 Remove when all channels are ported to the builder pattern
Expand Down Expand Up @@ -143,7 +143,7 @@ class MessageQueueBuilder
IOX_BUILDER_PARAMETER(IpcChannelSide, channelSide, IpcChannelSide::CLIENT)

/// @brief Defines the max message size of the message queue
IOX_BUILDER_PARAMETER(size_t, maxMsgSize, MessageQueue::MAX_MESSAGE_SIZE)
IOX_BUILDER_PARAMETER(uint64_t, maxMsgSize, MessageQueue::MAX_MESSAGE_SIZE)

/// @brief Defines the max number of messages for the message queue.
IOX_BUILDER_PARAMETER(uint64_t, maxMsgNumber, MessageQueue::MAX_MESSAGE_NUMBER)
Expand Down
6 changes: 3 additions & 3 deletions iceoryx_dust/source/posix_wrapper/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ expected<MessageQueue, IpcChannelError> MessageQueueBuilder::create() const noex
// fields have a different order in QNX, so we need to initialize by name
mq_attr attributes;
attributes.mq_flags = 0;
attributes.mq_maxmsg = static_cast<long>(m_maxMsgNumber);
attributes.mq_msgsize = static_cast<long>(m_maxMsgSize);
attributes.mq_maxmsg = static_cast<decltype(attributes.mq_maxmsg)>(m_maxMsgNumber);
attributes.mq_msgsize = static_cast<decltype(attributes.mq_msgsize)>(m_maxMsgSize);
attributes.mq_curmsgs = 0L;
#ifdef __QNX__
attributes.mq_recvwait = 0L;
Expand Down Expand Up @@ -93,7 +93,7 @@ MessageQueue::MessageQueue(const IpcChannelName_t&& name,
// NOLINTNEXTLINE(readability-function-size) @todo iox-#832 make a struct out of arguments
expected<MessageQueue, IpcChannelError> MessageQueue::create(const IpcChannelName_t& name,
const IpcChannelSide channelSide,
const size_t maxMsgSize,
const uint64_t maxMsgSize,
const uint64_t maxMsgNumber) noexcept
{
return MessageQueueBuilder()
Expand Down

0 comments on commit 3b7f0ce

Please sign in to comment.