Skip to content

Commit

Permalink
Use create instead of init
Browse files Browse the repository at this point in the history
Signed-off-by: methylDragon <[email protected]>
  • Loading branch information
methylDragon committed Apr 7, 2023
1 parent 89326e8 commit 2ab3722
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions rmw/include/rmw/dynamic_message_type_support.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ extern "C"
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_dynamic_message_type_support_handle_init(
rmw_dynamic_message_type_support_handle_create(
rosidl_dynamic_typesupport_serialization_support_t * serialization_support,
bool middleware_supports_type_discovery,
const rosidl_type_hash_t * type_hash,
Expand All @@ -69,7 +69,7 @@ rmw_dynamic_message_type_support_handle_init(
rosidl_message_type_support_t ** ts); // OUT

/// Destroy a rosidl_message_type_support_t obtained with
/// rmw_dynamic_message_type_support_handle_init, which has dynamically allocated members
/// `rmw_dynamic_message_type_support_handle_create()`, which has dynamically allocated members
///
/// NOTE: Using this on a statically allocated typesupport will cause undefined behavior!
/// (Static memory will get freed in that case.)
Expand All @@ -92,15 +92,15 @@ rmw_get_dynamic_typesupport_identifier(void);
RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_init_dynamic_message_type_from_description(
rmw_create_dynamic_message_type_from_description(
rosidl_dynamic_typesupport_serialization_support_t * serialization_support,
const rosidl_runtime_c__type_description__TypeDescription * type_description,
rosidl_dynamic_typesupport_dynamic_type_t ** ts); // OUT

RMW_PUBLIC
RMW_WARN_UNUSED
rmw_ret_t
rmw_init_dynamic_message_from_dynamic_message_type(
rmw_create_dynamic_message_from_dynamic_message_type(
rosidl_dynamic_typesupport_dynamic_type_t * dynamic_message_type,
rosidl_dynamic_typesupport_dynamic_data_t ** cloned_dynamic_message_type); // OUT

Expand Down
12 changes: 6 additions & 6 deletions rmw/src/dynamic_message_type_support.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extern "C"

/// Create a rosidl_message_type_support_t from a TypeDescription message
rmw_ret_t
rmw_dynamic_message_type_support_handle_init(
rmw_dynamic_message_type_support_handle_create(
rosidl_dynamic_typesupport_serialization_support_t * serialization_support,
bool middleware_supports_type_discovery,
const rosidl_type_hash_t * type_hash,
Expand Down Expand Up @@ -66,7 +66,7 @@ rmw_dynamic_message_type_support_handle_init(
// RMW_CHECK_ARGUMENT_FOR_NULL(type_description_sources, RMW_RET_INVALID_ARGUMENT);

return rmw_convert_rcutils_ret_to_rmw_ret(
rosidl_dynamic_message_type_support_handle_init(
rosidl_dynamic_message_type_support_handle_create(
serialization_support, type_hash, type_description, type_description_sources, ts));
}

Expand All @@ -84,23 +84,23 @@ rmw_get_dynamic_typesupport_identifier(void)
}

rmw_ret_t
rmw_init_dynamic_message_type_from_description(
rmw_create_dynamic_message_type_from_description(
rosidl_dynamic_typesupport_serialization_support_t * serialization_support,
const rosidl_runtime_c__type_description__TypeDescription * type_description,
rosidl_dynamic_typesupport_dynamic_type_t ** ts)
{
return rmw_convert_rcutils_ret_to_rmw_ret(
rosidl_dynamic_typesupport_dynamic_type_init_from_description(
rosidl_dynamic_typesupport_dynamic_type_create_from_description(
serialization_support, type_description, ts));
}

rmw_ret_t
rmw_init_dynamic_message_from_dynamic_message_type(
rmw_create_dynamic_message_from_dynamic_message_type(
rosidl_dynamic_typesupport_dynamic_type_t * dynamic_message_type,
rosidl_dynamic_typesupport_dynamic_data_t ** cloned_dynamic_message_type)
{
return rmw_convert_rcutils_ret_to_rmw_ret(
rosidl_dynamic_typesupport_dynamic_data_init_from_dynamic_type(
rosidl_dynamic_typesupport_dynamic_data_create_from_dynamic_type(
dynamic_message_type, cloned_dynamic_message_type));
}

Expand Down

0 comments on commit 2ab3722

Please sign in to comment.