Skip to content

Commit

Permalink
Updated rmw_* return codes (#246)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
ahcorde committed Oct 15, 2020
1 parent 6bc75b4 commit a197914
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit a197914

Please sign in to comment.