Skip to content

Commit

Permalink
use RMW_GID_STORAGE_SIZE to client_service_id_t. (#515)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomoya Fujita <[email protected]>
  • Loading branch information
fujitatomoya authored Oct 8, 2024
1 parent 2d99e22 commit 0c2904d
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions rmw_cyclonedds_cpp/src/rmw_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<rmw_request_id_t *>(0))->writer_guid)]; // NOLINT
uint8_t data[RMW_GID_STORAGE_SIZE];
};

struct CddsCS
Expand Down Expand Up @@ -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<rmw_gid_t *>(0))->data),
"client/service id assumes rmw_gid_t can hold a DDSI GUID");
uint32_t x;

{
Expand Down

0 comments on commit 0c2904d

Please sign in to comment.