Skip to content

Commit

Permalink
remove rmw_localhost_only_t. (ros2#255)
Browse files Browse the repository at this point in the history
* remove rmw_localhost_only_t.

Signed-off-by: Alejandro Hernández Cordero <[email protected]>
Co-authored-by: Alejandro Hernández Cordero <[email protected]>
  • Loading branch information
2 people authored and imstevenpmwork committed Aug 27, 2024
1 parent 001f490 commit 434340a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions rmw_zenoh_cpp/src/rmw_init_options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// limitations under the License.

#include <zenoh.h>
#include <string.h>

#include "detail/identifier.hpp"
#include "detail/rmw_init_options_impl.hpp"
Expand Down Expand Up @@ -40,14 +41,14 @@ rmw_init_options_init(rmw_init_options_t * init_options, rcutils_allocator_t all
return RMW_RET_INVALID_ARGUMENT;
}

memset(init_options, 0, sizeof(rmw_init_options_t));
init_options->instance_id = 0;
init_options->implementation_identifier = rmw_zenoh_cpp::rmw_zenoh_identifier;
init_options->allocator = allocator;
init_options->impl = nullptr;
init_options->enclave = nullptr;
init_options->domain_id = RMW_DEFAULT_DOMAIN_ID;
init_options->security_options = rmw_get_default_security_options();
init_options->localhost_only = RMW_LOCALHOST_ONLY_DEFAULT;
init_options->discovery_options = rmw_get_zero_initialized_discovery_options();
return rmw_discovery_options_init(&(init_options->discovery_options), 0, &allocator);
}
Expand Down Expand Up @@ -76,9 +77,8 @@ rmw_init_options_copy(const rmw_init_options_t * src, rmw_init_options_t * dst)
RCUTILS_CHECK_ALLOCATOR(&allocator, return RMW_RET_INVALID_ARGUMENT);

rmw_init_options_t tmp;
tmp.instance_id = src->instance_id;
memcpy(&tmp, src, sizeof(rmw_init_options_t));
tmp.implementation_identifier = rmw_zenoh_cpp::rmw_zenoh_identifier;
tmp.domain_id = src->domain_id;
tmp.security_options = rmw_get_zero_initialized_security_options();
rmw_ret_t ret =
rmw_security_options_copy(&src->security_options, &allocator, &tmp.security_options);
Expand All @@ -89,7 +89,6 @@ rmw_init_options_copy(const rmw_init_options_t * src, rmw_init_options_t * dst)
[&tmp, allocator]() {
rmw_security_options_fini(&tmp.security_options, &allocator);
});
tmp.localhost_only = src->localhost_only;
tmp.discovery_options = rmw_get_zero_initialized_discovery_options();
ret = rmw_discovery_options_copy(
&src->discovery_options,
Expand Down

0 comments on commit 434340a

Please sign in to comment.