Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-Authored-By: Jacob Perron <jacob@openrobotics.org>
  • Loading branch information
mjcarroll and jacobperron authored Apr 21, 2020
1 parent 7829d3d commit 35a0faf
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions rcl/src/rcl/subscription.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ rcl_take_sequence(
)
{
// Set the sizes to zero to indicate that there are no valid messages
message_sequence->size = 0;
message_info_sequence->size = 0;
message_sequence->size = 0u;
message_info_sequence->size = 0u;

RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Subscription taking n messags");
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Subscription taking %zu messages", count);
if (!rcl_subscription_is_valid(subscription)) {
return RCL_RET_SUBSCRIPTION_INVALID; // error message already set
}
Expand All @@ -312,7 +312,7 @@ rcl_take_sequence(
return RCL_RET_INVALID_ARGUMENT;
}

size_t taken = 0;
size_t taken = 0u;
rmw_ret_t ret = rmw_take_sequence(
subscription->impl->rmw_handle, count, message_sequence, message_info_sequence, &taken,
allocation);
Expand All @@ -325,7 +325,7 @@ rcl_take_sequence(
return RCL_RET_ERROR;
}
RCUTILS_LOG_DEBUG_NAMED(
ROS_PACKAGE_NAME, "Subscription take_n succeeded: %s", taken > 0 ? "true" : "false");
ROS_PACKAGE_NAME, "Subscription took %zu messages", taken);
if (taken == 0) {
return RCL_RET_SUBSCRIPTION_TAKE_FAILED;
}
Expand Down

0 comments on commit 35a0faf

Please sign in to comment.