From 68c93c8c6d8b036442e403b056e4c8b69db0c15c Mon Sep 17 00:00:00 2001 From: Karsten Knese Date: Mon, 21 Oct 2019 20:47:12 -0700 Subject: [PATCH] use return_loaned_message_from (#523) Signed-off-by: Karsten Knese --- rcl/include/rcl/publisher.h | 6 +++--- rcl/include/rcl/subscription.h | 6 +++--- rcl/src/rcl/publisher.c | 4 ++-- rcl/src/rcl/subscription.c | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/rcl/include/rcl/publisher.h b/rcl/include/rcl/publisher.h index fb7aacc0cc..ba5a1692d4 100644 --- a/rcl/include/rcl/publisher.h +++ b/rcl/include/rcl/publisher.h @@ -199,7 +199,7 @@ rcl_publisher_get_default_options(void); /// Borrow a loaned message. /** * The memory allocated for the ros message belongs to the middleware and must not be deallocated - * other than by a call to \sa rcl_return_loaned_message. + * other than by a call to \sa rcl_return_loaned_message_from_publisher. * *
* Attribute | Adherence @@ -228,7 +228,7 @@ rcl_borrow_loaned_message( const rosidl_message_type_support_t * type_support, void ** ros_message); -/// Return a loaned message +/// Return a loaned message previously borrowed from a publisher. /** * The ownership of the passed in ros message will be transferred back to the middleware. * The middleware might deallocate and destroy the message so that the pointer is no longer @@ -252,7 +252,7 @@ rcl_borrow_loaned_message( RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_return_loaned_message( +rcl_return_loaned_message_from_publisher( const rcl_publisher_t * publisher, void * loaned_message); diff --git a/rcl/include/rcl/subscription.h b/rcl/include/rcl/subscription.h index 430eea4f70..b6e85c969e 100644 --- a/rcl/include/rcl/subscription.h +++ b/rcl/include/rcl/subscription.h @@ -349,10 +349,10 @@ rcl_take_loaned_message( rmw_message_info_t * message_info, rmw_subscription_allocation_t * allocation); -/// Release a loaned message from a topic using a rcl subscription. +/// Return a loaned message from a topic using a rcl subscription. /** * If a loaned message was previously obtained from the middleware with a call to - * \sa rcl_take_loaned_message, this message has to be released to indicate to the middleware + * \sa rcl_take_loaned_message, this message has to be returned to indicate to the middleware * that the user no longer needs that memory. * The user must not delete the message. * @@ -375,7 +375,7 @@ rcl_take_loaned_message( RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t -rcl_release_loaned_message( +rcl_return_loaned_message_from_subscription( const rcl_subscription_t * subscription, void * loaned_message); diff --git a/rcl/src/rcl/publisher.c b/rcl/src/rcl/publisher.c index 930db93a1f..cdd11ca36b 100644 --- a/rcl/src/rcl/publisher.c +++ b/rcl/src/rcl/publisher.c @@ -265,7 +265,7 @@ rcl_borrow_loaned_message( } rcl_ret_t -rcl_return_loaned_message( +rcl_return_loaned_message_from_publisher( const rcl_publisher_t * publisher, void * loaned_message) { @@ -273,7 +273,7 @@ rcl_return_loaned_message( return RCL_RET_PUBLISHER_INVALID; // error already set } RCL_CHECK_ARGUMENT_FOR_NULL(loaned_message, RCL_RET_INVALID_ARGUMENT); - return rmw_return_loaned_message(publisher->impl->rmw_handle, loaned_message); + return rmw_return_loaned_message_from_publisher(publisher->impl->rmw_handle, loaned_message); } rcl_ret_t diff --git a/rcl/src/rcl/subscription.c b/rcl/src/rcl/subscription.c index 5b352ee6f9..8747f54279 100644 --- a/rcl/src/rcl/subscription.c +++ b/rcl/src/rcl/subscription.c @@ -356,7 +356,7 @@ rcl_take_loaned_message( } rcl_ret_t -rcl_release_loaned_message( +rcl_return_loaned_message_from_subscription( const rcl_subscription_t * subscription, void * loaned_message) { @@ -365,7 +365,8 @@ rcl_release_loaned_message( return RCL_RET_SUBSCRIPTION_INVALID; // error already set } RCL_CHECK_ARGUMENT_FOR_NULL(loaned_message, RCL_RET_INVALID_ARGUMENT); - return rmw_release_loaned_message(subscription->impl->rmw_handle, loaned_message); + return rmw_return_loaned_message_from_subscription( + subscription->impl->rmw_handle, loaned_message); } const char *