From 0c2904d725dade83cc0b1ffde931b46f9d28269f Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Tue, 8 Oct 2024 13:03:29 -0700 Subject: [PATCH] use RMW_GID_STORAGE_SIZE to client_service_id_t. (#515) Signed-off-by: Tomoya Fujita --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index af641101..6973963c 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -361,9 +361,7 @@ struct CddsSubscription : CddsEntity struct client_service_id_t { - // strangely, the writer_guid in an rmw_request_id_t is smaller than the identifier in - // an rmw_gid_t - uint8_t data[sizeof((reinterpret_cast(0))->writer_guid)]; // NOLINT + uint8_t data[RMW_GID_STORAGE_SIZE]; }; struct CddsCS @@ -4889,11 +4887,8 @@ static void get_unique_csid(const rmw_node_t * node, client_service_id_t & id) { auto impl = node->context->impl; static_assert( - sizeof(dds_guid_t) <= sizeof(id.data), + sizeof(dds_guid_t) <= RMW_GID_STORAGE_SIZE, "client/service id assumed it can hold a DDSI GUID"); - static_assert( - sizeof(dds_guid_t) <= sizeof((reinterpret_cast(0))->data), - "client/service id assumes rmw_gid_t can hold a DDSI GUID"); uint32_t x; {