-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce RMW_EVENT_TYPE_MAX in rmw_event_type_t. #518
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Tomoya Fujita <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reference why we change this: ros2/rmw#380 (comment)
Pulls: ros2/rmw#380, ros2/rmw_fastrtps#785, ros2/rmw_connextdds#162, #518 |
Pulls: ros2/rmw#380, ros2/rmw_fastrtps#785, ros2/rmw_connextdds#162, #518 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @fujitatomoya ! It is fine as it is but there is one thing I would do slightly differently: I would either also add it to rmw_take_event
to maintain the pattern, or I would remove RMW_EVENT_INVALID
there because init_rmw_event
can never produce an rmw_event_t
with that event type.
I don't like default
s in switches over enums, precisely because it prevents the compiler from helping me checking all relevant locations. I'm pretty sure if the default: unreachable
wasn't present in rmw_take_event
, you'd have added a case there, too 🙂
So I lean towards the former of my two suggestions, add RMW_EVENT_TYPE_MAX
, and then also drop the unnecessary default
case.
That said, there are more of those default
s ... Process-wise, dropping those unnecessary default
s might be better done in a separate PR. What do you think?
Signed-off-by: Tomoya Fujita <[email protected]>
so true. i would have added a case there...
agree.
agree too. thanks! |
Pulls: ros2/rmw#380, ros2/rmw_fastrtps#785, ros2/rmw_connextdds#162, #518 |
Signed-off-by: Tomoya Fujita <[email protected]>
Pulls: ros2/rmw#380, ros2/rmw_fastrtps#785, ros2/rmw_connextdds#162, #518 |
Pulls: ros2/rmw#380, ros2/rmw_fastrtps#785, ros2/rmw_connextdds#162, #518 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@eboasson thanks for the review, CI is all green so just waiting for ros2/rmw#380 lgtm. |
depends on ros2/rmw#380