Skip to content
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

Include rmw_event_t instead of forward declaring it #933

Merged
merged 2 commits into from
Sep 14, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rcl/include/rcl/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ typedef enum rcl_subscription_event_type_t
} rcl_subscription_event_type_t;

/// rmw struct.
typedef struct rmw_event_t rmw_event_t;
typedef struct rmw_event_s rmw_event_t;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know you didn't add this code, but this line actually feels wrong. We should never be redefining rmw_* structures in this file, just using them.

Elsewhere in this package, we have lines like:

typedef rmw_serialized_message_t rcl_serialized_message_t;

I suspect that was what was originally intended, but it got crossed up somehow.

Regardless, I think we should either remove this line completely (and just use rmw_event_t everywhere), or change this to:

typedef rmw_event_t rcl_event_t;

And change the function signatures to match. Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only guess, but I think it was intentional. rcl/event.h does not include rmw/event.h, so this would be a forward declaration. Of course, we can drop this and simply include the corresponding header.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course, we can drop this and simply include the corresponding header.

Yeah, that seems preferable to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See af75126.


/// Internal rcl implementation struct.
struct rcl_event_impl_t;
Expand Down