diff --git a/rmw_fastrtps_shared_cpp/src/qos.cpp b/rmw_fastrtps_shared_cpp/src/qos.cpp index c790a987b..74464b778 100644 --- a/rmw_fastrtps_shared_cpp/src/qos.cpp +++ b/rmw_fastrtps_shared_cpp/src/qos.cpp @@ -105,11 +105,13 @@ bool fill_entity_qos_from_profile( } if (!is_rmw_duration_unspecified(qos_policies.lifespan)) { - entity_qos.lifespan().duration = rmw_time_to_fastrtps(qos_policies.lifespan); + entity_qos.lifespan().duration = + rmw_fastrtps_shared_cpp::rmw_time_to_fastrtps(qos_policies.lifespan); } if (!is_rmw_duration_unspecified(qos_policies.deadline)) { - entity_qos.deadline().period = rmw_time_to_fastrtps(qos_policies.deadline); + entity_qos.deadline().period = + rmw_fastrtps_shared_cpp::rmw_time_to_fastrtps(qos_policies.deadline); } switch (qos_policies.liveliness) { @@ -127,7 +129,7 @@ bool fill_entity_qos_from_profile( } if (!is_rmw_duration_unspecified(qos_policies.liveliness_lease_duration)) { entity_qos.liveliness().lease_duration = - rmw_time_to_fastrtps(qos_policies.liveliness_lease_duration); + rmw_fastrtps_shared_cpp::rmw_time_to_fastrtps(qos_policies.liveliness_lease_duration); // Docs suggest setting no higher than 0.7 * lease_duration, choosing 2/3 to give safe buffer. // See doc at https://github.com/eProsima/Fast-RTPS/blob/ diff --git a/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp b/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp index 53764b628..1fae29e57 100644 --- a/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp +++ b/rmw_fastrtps_shared_cpp/src/rmw_publisher.cpp @@ -139,11 +139,11 @@ __rmw_publisher_wait_for_all_acked( eprosima::fastrtps::Duration_t timeout = rmw_time_to_fastrtps(wait_timeout); ReturnCode_t ret = info->data_writer_->wait_for_acknowledgments(timeout); - if (ret == ReturnCode_t::RETCODE_OK) { + if (ReturnCode_t::RETCODE_OK == ret) { return RMW_RET_OK; - } else { - return RMW_RET_TIMEOUT; } + + return RMW_RET_TIMEOUT; } rmw_ret_t diff --git a/rmw_fastrtps_shared_cpp/src/time_utils.cpp b/rmw_fastrtps_shared_cpp/src/time_utils.cpp index 25f8e1ac9..2c534e72e 100644 --- a/rmw_fastrtps_shared_cpp/src/time_utils.cpp +++ b/rmw_fastrtps_shared_cpp/src/time_utils.cpp @@ -16,6 +16,9 @@ #include "time_utils.hpp" +namespace rmw_fastrtps_shared_cpp +{ + eprosima::fastrtps::Duration_t rmw_time_to_fastrtps(const rmw_time_t & time) { @@ -28,3 +31,5 @@ rmw_time_to_fastrtps(const rmw_time_t & time) static_cast(clamped_time.sec), static_cast(clamped_time.nsec)); } + +} // namespace rmw_fastrtps_shared_cpp diff --git a/rmw_fastrtps_shared_cpp/src/time_utils.hpp b/rmw_fastrtps_shared_cpp/src/time_utils.hpp index 674679f32..f22a37c84 100644 --- a/rmw_fastrtps_shared_cpp/src/time_utils.hpp +++ b/rmw_fastrtps_shared_cpp/src/time_utils.hpp @@ -17,6 +17,11 @@ #include "fastdds/rtps/common/Time_t.h" +namespace rmw_fastrtps_shared_cpp +{ + eprosima::fastrtps::Duration_t rmw_time_to_fastrtps(const rmw_time_t & time); +} // namespace rmw_fastrtps_shared_cpp + #endif // TIME_UTILS_HPP_