Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Conversation

@pablogs9
Copy link
Member

@pablogs9 pablogs9 commented Jun 5, 2020

This PR fixes the usage of the UNUSED macro because it has interference with systems that has it already defined.

Before merge:

Comment on lines 68 to 77
RCL_CHECK_FOR_NULL_WITH_MSG(
support, "support is a null pointer", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_FOR_NULL_WITH_MSG(
init_options, "init_options is a null pointer", return RCL_RET_INVALID_ARGUMENT);
RCL_CHECK_FOR_NULL_WITH_MSG(
allocator, "allocator is a null pointer", return RCL_RET_INVALID_ARGUMENT);
rcl_ret_t rc = RCL_RET_OK;

memcpy(&support->init_options, init_options, sizeof(rcl_init_options_t));

support->context = rcl_get_zero_initialized_context();
rc = rcl_init(argc, argv, &support->init_options, &support->context);
if (rc != RCL_RET_OK) {
PRINT_RCLC_ERROR(rclc_init, rcl_init);
return rc;
}
support->allocator = allocator;

rc = rcl_clock_init(RCL_STEADY_TIME, &support->clock, support->allocator);
if (rc != RCL_RET_OK) {
PRINT_RCLC_ERROR(rclc_init, rcl_clock_init);
}
return rc;
}
Copy link

Choose a reason for hiding this comment

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

Is it possible to refactor this function taking a common factor from rclc_support_init?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@pablogs9 pablogs9 force-pushed the fix/unused_macro branch from 1288de2 to d5b8153 Compare June 8, 2020 06:10
@pablogs9 pablogs9 requested a review from julionce June 8, 2020 06:11
julionce
julionce previously approved these changes Jun 8, 2020
JanStaschulat
JanStaschulat previously approved these changes Jun 8, 2020
@pablogs9 pablogs9 dismissed stale reviews from JanStaschulat and julionce via a75cdfc June 9, 2020 05:11
@pablogs9 pablogs9 force-pushed the fix/unused_macro branch from d5b8153 to a75cdfc Compare June 9, 2020 05:11
@pablogs9 pablogs9 merged commit 11a1eb1 into master Jun 9, 2020
@pablogs9 pablogs9 deleted the fix/unused_macro branch June 9, 2020 05:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants