Skip to content

Commit

Permalink
Refs #20342: Uncrustify
Browse files Browse the repository at this point in the history
Signed-off-by: cferreiragonz <[email protected]>
  • Loading branch information
cferreiragonz committed Mar 11, 2024
1 parent 5de9ef4 commit 02e2919
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 19 deletions.
4 changes: 2 additions & 2 deletions include/fastdds/rtps/messages/RTPSMessageGroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ class RTPSMessageGroup
bool is_big_submessage);

bool check_space(
CDRMessage_t* msg,
const uint32_t length);
CDRMessage_t* msg,
const uint32_t length);


/**
Expand Down
36 changes: 30 additions & 6 deletions include/fastdds/rtps/network/NetworkBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,40 @@ struct NetworkBuffer final
//! Number of bytes to use starting at @c buffer.
size_t size;

NetworkBuffer(const void* ptr, size_t s) : buffer(ptr), size(s) {}
NetworkBuffer(
const void* ptr,
size_t s)
: buffer(ptr)
, size(s)
{
}

NetworkBuffer() : buffer(nullptr), size(0) {}
NetworkBuffer()
: buffer(nullptr)
, size(0)
{
}

NetworkBuffer(const fastrtps::rtps::octet* ptr, size_t s) : buffer(ptr), size(s) {}
NetworkBuffer(
const fastrtps::rtps::octet* ptr,
size_t s)
: buffer(ptr)
, size(s)
{
}

NetworkBuffer(const NetworkBuffer& copy) : buffer(copy.buffer), size(copy.size) {}
NetworkBuffer(
const NetworkBuffer& copy)
: buffer(copy.buffer)
, size(copy.size)
{
}

NetworkBuffer& operator=(const NetworkBuffer& copy) {
if (this != &copy) {
NetworkBuffer& operator =(
const NetworkBuffer& copy)
{
if (this != &copy)
{
buffer = copy.buffer;
size = copy.size;
}
Expand Down
4 changes: 2 additions & 2 deletions include/fastdds/rtps/transport/SenderResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ class SenderResource
LocatorsIterator* destination_locators_end,
const std::chrono::steady_clock::time_point& max_blocking_time_point)
{
return send_buffers_lambda_(buffers, total_bytes, destination_locators_begin, destination_locators_end,
max_blocking_time_point);
return send_buffers_lambda_(buffers, total_bytes, destination_locators_begin, destination_locators_end,
max_blocking_time_point);
}

/**
Expand Down
6 changes: 4 additions & 2 deletions src/cpp/rtps/messages/RTPSMessageGroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ bool RTPSMessageGroup::add_data(

// Check limitation
uint32_t data_size = change.serializedPayload.length;
if (data_exceeds_limitation(data_size, sent_bytes_limitation_, current_sent_bytes_, header_msg_->length + buffers_bytes_))
if (data_exceeds_limitation(data_size, sent_bytes_limitation_, current_sent_bytes_,
header_msg_->length + buffers_bytes_))
{
flush_and_reset();
throw limit_exceeded();
Expand Down Expand Up @@ -644,7 +645,8 @@ bool RTPSMessageGroup::add_data_frag(
uint32_t fragment_size = fragment_number < change.getFragmentCount() ? change.getFragmentSize() :
change.serializedPayload.length - fragment_start;
// Check limitation
if (data_exceeds_limitation(fragment_size, sent_bytes_limitation_, current_sent_bytes_, header_msg_->length + buffers_bytes_))
if (data_exceeds_limitation(fragment_size, sent_bytes_limitation_, current_sent_bytes_,
header_msg_->length + buffers_bytes_))
{
flush_and_reset();
throw limit_exceeded();
Expand Down
2 changes: 1 addition & 1 deletion src/cpp/rtps/messages/submessages/DataMsg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ bool RTPSMessageCreator::addSubmessageDataFrag(
// TODO(Ricardo) This should be on cachechange.
// Align submessage to rtps alignment (4).
submessage_size = uint16_t(msg->pos - position_size_count_size);
for (; 0 != (submessage_size& 3); ++submessage_size)
for (; 0 != (submessage_size & 3); ++submessage_size)
{
if (copy_data)
{
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/rtps/reader/StatefulReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1644,5 +1644,6 @@ bool StatefulReader::send_sync_nts(
const Locators& locators_end,
std::chrono::steady_clock::time_point& max_blocking_time_point)
{
return mp_RTPSParticipant->sendSync(buffers, total_bytes, m_guid, locators_begin, locators_end, max_blocking_time_point);
return mp_RTPSParticipant->sendSync(buffers, total_bytes, m_guid, locators_begin, locators_end,
max_blocking_time_point);
}
6 changes: 3 additions & 3 deletions src/cpp/rtps/transport/shared_mem/SharedMemTransport.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ class SharedMemTransport : public TransportInterface
* @param max_blocking_time_point Maximum time this function will block.
*/
std::shared_ptr<SharedMemManager::Buffer> copy_to_shared_buffer(
const std::list<NetworkBuffer>& buffers,
const uint32_t total_bytes,
const std::chrono::steady_clock::time_point& max_blocking_time_point);
const std::list<NetworkBuffer>& buffers,
const uint32_t total_bytes,
const std::chrono::steady_clock::time_point& max_blocking_time_point);

bool send(
const std::shared_ptr<SharedMemManager::Buffer>& buffer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ TransportInterface* test_SharedMemTransportDescriptor::create_transport() const

bool test_SharedMemTransport::send(
const std::list<NetworkBuffer>& buffers,
uint32_t total_bytes,
uint32_t total_bytes,
fastrtps::rtps::LocatorsIterator* destination_locators_begin,
fastrtps::rtps::LocatorsIterator* destination_locators_end,
const std::chrono::steady_clock::time_point& max_blocking_time_point)
Expand Down
3 changes: 2 additions & 1 deletion src/cpp/statistics/rtps/messages/RTPSStatisticsMessages.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ inline bool is_statistics_buffer(
const NetworkBuffer& stat_buffer)
{
return statistics_submessage_length == stat_buffer.size &&
FASTDDS_STATISTICS_NETWORK_SUBMESSAGE == static_cast<const eprosima::fastrtps::rtps::octet*>(stat_buffer.buffer)[0];
FASTDDS_STATISTICS_NETWORK_SUBMESSAGE ==
static_cast<const eprosima::fastrtps::rtps::octet*>(stat_buffer.buffer)[0];
}

#endif // FASTDDS_STATISTICS
Expand Down

0 comments on commit 02e2919

Please sign in to comment.