From 1199639ff8f020c728202110cd4a8fe9b529ce55 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Fri, 22 Jan 2021 14:05:33 +0100 Subject: [PATCH] Keep linters happy. Signed-off-by: Miguel Company --- rmw_fastrtps_cpp/src/type_support_common.cpp | 13 ++++++------- .../rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp | 5 ++--- rmw_fastrtps_shared_cpp/src/rmw_request.cpp | 2 +- rmw_fastrtps_shared_cpp/src/rmw_response.cpp | 3 ++- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/rmw_fastrtps_cpp/src/type_support_common.cpp b/rmw_fastrtps_cpp/src/type_support_common.cpp index 06aa1f3df..dc34ea781 100644 --- a/rmw_fastrtps_cpp/src/type_support_common.cpp +++ b/rmw_fastrtps_cpp/src/type_support_common.cpp @@ -12,10 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - #include +#include + #include "rmw/error_handling.h" #include "type_support_common.hpp" @@ -93,19 +93,18 @@ bool TypeSupport::deserializeROSmessage( try { // Deserialize encapsulation. deser.read_encapsulation(); - + // If type is not empty, deserialize message if (has_data_) { auto callbacks = static_cast(impl); - return callbacks->cdr_deserialize(deser, ros_message); + return callbacks->cdr_deserialize(deser, ros_message); } - + // Otherwise, consume dummy byte uint8_t dump = 0; deser >> dump; (void)dump; - } - catch(const eprosima::fastcdr::exception::Exception&) { + } catch(const eprosima::fastcdr::exception::Exception&) { return false; } diff --git a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp index d4fc2160c..8f35e8487 100644 --- a/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp +++ b/rmw_fastrtps_dynamic_cpp/include/rmw_fastrtps_dynamic_cpp/TypeSupport_impl.hpp @@ -945,7 +945,7 @@ bool TypeSupport::deserializeROSmessage( try { // Deserialize encapsulation. deser.read_encapsulation(); - + (void)impl; if (members_->member_count_ != 0) { return TypeSupport::deserializeROSmessage(deser, members_, ros_message); @@ -954,8 +954,7 @@ bool TypeSupport::deserializeROSmessage( uint8_t dump = 0; deser >> dump; (void)dump; - } - catch(const eprosima::fastcdr::exception::Exception&) { + } catch(const eprosima::fastcdr::exception::Exception&) { return false; } diff --git a/rmw_fastrtps_shared_cpp/src/rmw_request.cpp b/rmw_fastrtps_shared_cpp/src/rmw_request.cpp index 144d92481..3d21032f4 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_request.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_request.cpp @@ -97,7 +97,7 @@ __rmw_take_request( eprosima::fastcdr::Cdr deser(*request.buffer_, eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); if (info->request_type_support_->deserializeROSmessage( - deser, ros_request, info->request_type_support_impl_)) + deser, ros_request, info->request_type_support_impl_)) { // Get header rmw_fastrtps_shared_cpp::copy_from_fastrtps_guid_to_byte_array( diff --git a/rmw_fastrtps_shared_cpp/src/rmw_response.cpp b/rmw_fastrtps_shared_cpp/src/rmw_response.cpp index 0ea43f57c..2c700c8f6 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_response.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_response.cpp @@ -60,7 +60,8 @@ __rmw_take_response( eprosima::fastcdr::Cdr::DEFAULT_ENDIAN, eprosima::fastcdr::Cdr::DDS_CDR); if (info->response_type_support_->deserializeROSmessage( - deser, ros_response, info->response_type_support_impl_)) { + deser, ros_response, info->response_type_support_impl_)) + { request_header->source_timestamp = response.sample_info_.sourceTimestamp.to_ns(); request_header->received_timestamp = response.sample_info_.receptionTimestamp.to_ns(); request_header->request_id.sequence_number =