nightduck / rmw_hazcat

Apache License 2.0
0 stars 0 forks source link

rmw_publisher:rmw_publish_loaned_message unused variable #22

Open TobiPristupin opened 2 years ago

TobiPristupin commented 2 years ago
rmw_ret_t
rmw_publish_loaned_message(
  const rmw_publisher_t * publisher,
  void * ros_message,
  rmw_publisher_allocation_t * allocation)
{
  RCUTILS_CHECK_ARGUMENT_FOR_NULL(publisher, RMW_RET_INVALID_ARGUMENT);
  RCUTILS_CHECK_ARGUMENT_FOR_NULL(ros_message, RMW_RET_INVALID_ARGUMENT);

  hma_allocator_t * alloc = ((pub_sub_data_t *)publisher->data)->alloc;

  // TODO(nightduck): Implement per-message size, in case messages are smaller than upper bound
  size_t size = ((pub_sub_data_t *)publisher->data)->msg_size;

  return hazcat_publish(publisher, ros_message, size);
}

The alloc variable is unused, which produces a compiler warning.