Skip to content

Commit 35a0faf

Browse files
Apply suggestions from code review
Co-Authored-By: Jacob Perron <[email protected]>
1 parent 7829d3d commit 35a0faf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

rcl/src/rcl/subscription.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -292,10 +292,10 @@ rcl_take_sequence(
292292
)
293293
{
294294
// Set the sizes to zero to indicate that there are no valid messages
295-
message_sequence->size = 0;
296-
message_info_sequence->size = 0;
295+
message_sequence->size = 0u;
296+
message_info_sequence->size = 0u;
297297

298-
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Subscription taking n messags");
298+
RCUTILS_LOG_DEBUG_NAMED(ROS_PACKAGE_NAME, "Subscription taking %zu messages", count);
299299
if (!rcl_subscription_is_valid(subscription)) {
300300
return RCL_RET_SUBSCRIPTION_INVALID; // error message already set
301301
}
@@ -312,7 +312,7 @@ rcl_take_sequence(
312312
return RCL_RET_INVALID_ARGUMENT;
313313
}
314314

315-
size_t taken = 0;
315+
size_t taken = 0u;
316316
rmw_ret_t ret = rmw_take_sequence(
317317
subscription->impl->rmw_handle, count, message_sequence, message_info_sequence, &taken,
318318
allocation);
@@ -325,7 +325,7 @@ rcl_take_sequence(
325325
return RCL_RET_ERROR;
326326
}
327327
RCUTILS_LOG_DEBUG_NAMED(
328-
ROS_PACKAGE_NAME, "Subscription take_n succeeded: %s", taken > 0 ? "true" : "false");
328+
ROS_PACKAGE_NAME, "Subscription took %zu messages", taken);
329329
if (taken == 0) {
330330
return RCL_RET_SUBSCRIPTION_TAKE_FAILED;
331331
}

0 commit comments

Comments
 (0)