diff --git a/include/fastdds/rtps/messages/RTPSMessageGroup.h b/include/fastdds/rtps/messages/RTPSMessageGroup.h index 13dcb758218..ad3df94b152 100644 --- a/include/fastdds/rtps/messages/RTPSMessageGroup.h +++ b/include/fastdds/rtps/messages/RTPSMessageGroup.h @@ -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); /** diff --git a/include/fastdds/rtps/network/NetworkBuffer.hpp b/include/fastdds/rtps/network/NetworkBuffer.hpp index 84ad2ca142e..f9f49db3e65 100644 --- a/include/fastdds/rtps/network/NetworkBuffer.hpp +++ b/include/fastdds/rtps/network/NetworkBuffer.hpp @@ -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 != ©) { + NetworkBuffer& operator =( + const NetworkBuffer& copy) + { + if (this != ©) + { buffer = copy.buffer; size = copy.size; } diff --git a/include/fastdds/rtps/transport/SenderResource.h b/include/fastdds/rtps/transport/SenderResource.h index 68047a7b04d..53f157698b7 100644 --- a/include/fastdds/rtps/transport/SenderResource.h +++ b/include/fastdds/rtps/transport/SenderResource.h @@ -63,8 +63,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); } /** diff --git a/src/cpp/rtps/messages/RTPSMessageGroup.cpp b/src/cpp/rtps/messages/RTPSMessageGroup.cpp index e40e1d8cc27..e2bc04fb36e 100644 --- a/src/cpp/rtps/messages/RTPSMessageGroup.cpp +++ b/src/cpp/rtps/messages/RTPSMessageGroup.cpp @@ -539,7 +539,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(); @@ -647,7 +648,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(); diff --git a/src/cpp/rtps/messages/submessages/DataMsg.hpp b/src/cpp/rtps/messages/submessages/DataMsg.hpp index 8e02b203543..4bb42585232 100644 --- a/src/cpp/rtps/messages/submessages/DataMsg.hpp +++ b/src/cpp/rtps/messages/submessages/DataMsg.hpp @@ -471,7 +471,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) { diff --git a/src/cpp/rtps/reader/StatefulReader.cpp b/src/cpp/rtps/reader/StatefulReader.cpp index a04dac4b6d7..7820100a1ee 100644 --- a/src/cpp/rtps/reader/StatefulReader.cpp +++ b/src/cpp/rtps/reader/StatefulReader.cpp @@ -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); } diff --git a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h index 7d34d64aedf..fcf8839ae53 100644 --- a/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h +++ b/src/cpp/rtps/transport/shared_mem/SharedMemTransport.h @@ -253,9 +253,9 @@ class SharedMemTransport : public TransportInterface * @param max_blocking_time_point Maximum time this function will block. */ std::shared_ptr copy_to_shared_buffer( - const std::list& buffers, - const uint32_t total_bytes, - const std::chrono::steady_clock::time_point& max_blocking_time_point); + const std::list& buffers, + const uint32_t total_bytes, + const std::chrono::steady_clock::time_point& max_blocking_time_point); bool send( const std::shared_ptr& buffer, diff --git a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp index a182b84d8c8..189a2130642 100644 --- a/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp +++ b/src/cpp/rtps/transport/shared_mem/test_SharedMemTransport.cpp @@ -50,7 +50,7 @@ TransportInterface* test_SharedMemTransportDescriptor::create_transport() const bool test_SharedMemTransport::send( const std::list& 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) diff --git a/src/cpp/statistics/rtps/messages/RTPSStatisticsMessages.hpp b/src/cpp/statistics/rtps/messages/RTPSStatisticsMessages.hpp index 278ed8d13aa..a7a60b98a7c 100644 --- a/src/cpp/statistics/rtps/messages/RTPSStatisticsMessages.hpp +++ b/src/cpp/statistics/rtps/messages/RTPSStatisticsMessages.hpp @@ -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(stat_buffer.buffer)[0]; + FASTDDS_STATISTICS_NETWORK_SUBMESSAGE == + static_cast(stat_buffer.buffer)[0]; } #endif // FASTDDS_STATISTICS