diff --git a/rmw_fastrtps_cpp/src/type_support_common.cpp b/rmw_fastrtps_cpp/src/type_support_common.cpp index 06aa1f3df5..dc34ea7812 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 d4fc2160c8..8f35e8487c 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 144d92481d..3d21032f48 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 0ea43f57c1..2c700c8f69 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 =