Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/rolling' into feature/modify_bui…
Browse files Browse the repository at this point in the history
…ld_ci_with_industrial_ci
  • Loading branch information
ahcorde committed Aug 23, 2024
2 parents 1cfa9be + ea41516 commit ccf3cab
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 ccf3cab

Please sign in to comment.