From 6af180afcd0e384ade5f5f8465ed85b03c3c6632 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Wed, 16 Oct 2024 14:39:12 -0700 Subject: [PATCH 1/3] introduce RMW_EVENT_TYPE_MAX in rmw_event_type_t. Signed-off-by: Tomoya Fujita --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index 6973963c..25952906 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -747,6 +747,7 @@ extern "C" rmw_ret_t rmw_event_set_callback( } case RMW_EVENT_INVALID: + case RMW_EVENT_TYPE_MAX: { return RMW_RET_INVALID_ARGUMENT; } From 984924efa92de6856e89d8fb5bd1e6b2cf9e5cb4 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Thu, 17 Oct 2024 14:02:32 -0700 Subject: [PATCH 2/3] add a case for RMW_EVENT_TYPE_MAX to rmw_take_event(). Signed-off-by: Tomoya Fujita --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index 25952906..6a92d1b5 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -751,6 +751,7 @@ extern "C" rmw_ret_t rmw_event_set_callback( { return RMW_RET_INVALID_ARGUMENT; } + } return RMW_RET_OK; } @@ -4062,12 +4063,11 @@ extern "C" rmw_ret_t rmw_take_event( return RMW_RET_OK; } - case RMW_EVENT_INVALID: { + case RMW_EVENT_INVALID: + case RMW_EVENT_TYPE_MAX: { break; } - default: - rmw_cyclonedds_cpp::unreachable(); } *taken = false; return RMW_RET_ERROR; From 59b391fd7110a0277e72febc7df9a58792cc0530 Mon Sep 17 00:00:00 2001 From: Tomoya Fujita Date: Fri, 18 Oct 2024 10:22:31 -0700 Subject: [PATCH 3/3] remove redundant blank lines, make cpplint happy. Signed-off-by: Tomoya Fujita --- rmw_cyclonedds_cpp/src/rmw_node.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/rmw_cyclonedds_cpp/src/rmw_node.cpp b/rmw_cyclonedds_cpp/src/rmw_node.cpp index 6a92d1b5..21839235 100644 --- a/rmw_cyclonedds_cpp/src/rmw_node.cpp +++ b/rmw_cyclonedds_cpp/src/rmw_node.cpp @@ -751,7 +751,6 @@ extern "C" rmw_ret_t rmw_event_set_callback( { return RMW_RET_INVALID_ARGUMENT; } - } return RMW_RET_OK; } @@ -4067,7 +4066,6 @@ extern "C" rmw_ret_t rmw_take_event( case RMW_EVENT_TYPE_MAX: { break; } - } *taken = false; return RMW_RET_ERROR;