Updated rmw_* return codes (#246)

* Updated rmw_*_*_allocation return codes

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Fixed return codes in rmw_*

Signed-off-by: ahcorde <ahcorde@gmail.com>

* Improved return error in rmw_wait

Signed-off-by: ahcorde <ahcorde@gmail.com>
This commit is contained in:
Alejandro Hernández Cordero 2020-09-25 17:32:29 +02:00 committed by Alejandro Hernández Cordero
parent 6bc75b4a49
commit a197914d31

View file

@ -1907,14 +1907,14 @@ extern "C" rmw_ret_t rmw_init_publisher_allocation(
static_cast<void>(message_bounds);
static_cast<void>(allocation);
RMW_SET_ERROR_MSG("rmw_init_publisher_allocation: unimplemented");
return RMW_RET_ERROR;
return RMW_RET_UNSUPPORTED;
}
extern "C" rmw_ret_t rmw_fini_publisher_allocation(rmw_publisher_allocation_t * allocation)
{
static_cast<void>(allocation);
RMW_SET_ERROR_MSG("rmw_fini_publisher_allocation: unimplemented");
return RMW_RET_ERROR;
return RMW_RET_UNSUPPORTED;
}
static rmw_publisher_t * create_publisher(
@ -2280,14 +2280,14 @@ extern "C" rmw_ret_t rmw_init_subscription_allocation(
static_cast<void>(message_bounds);
static_cast<void>(allocation);
RMW_SET_ERROR_MSG("rmw_init_subscription_allocation: unimplemented");
return RMW_RET_ERROR;
return RMW_RET_UNSUPPORTED;
}
extern "C" rmw_ret_t rmw_fini_subscription_allocation(rmw_subscription_allocation_t * allocation)
{
static_cast<void>(allocation);
RMW_SET_ERROR_MSG("rmw_fini_subscription_allocation: unimplemented");
return RMW_RET_ERROR;
return RMW_RET_UNSUPPORTED;
}
static rmw_subscription_t * create_subscription(
@ -3051,7 +3051,7 @@ extern "C" rmw_ret_t rmw_trigger_guard_condition(
extern "C" rmw_wait_set_t * rmw_create_wait_set(rmw_context_t * context, size_t max_conditions)
{
(void)context;
RMW_CHECK_ARGUMENT_FOR_NULL(context, nullptr);
(void)max_conditions;
rmw_wait_set_t * wait_set = rmw_wait_set_allocate();
CddsWaitset * ws = nullptr;
@ -3262,7 +3262,8 @@ extern "C" rmw_ret_t rmw_wait(
rmw_services_t * srvs, rmw_clients_t * cls, rmw_events_t * evs,
rmw_wait_set_t * wait_set, const rmw_time_t * wait_timeout)
{
RET_NULL(wait_set);
RET_NULL_X(wait_set, return RMW_RET_INVALID_ARGUMENT);
RET_WRONG_IMPLID(wait_set);
CddsWaitset * ws = static_cast<CddsWaitset *>(wait_set->data);
RET_NULL(ws);