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>
Co-Authored-By: William Woodall <william+github@osrfoundation.org>
Signed-off-by: Michael Carroll <michael@openrobotics.org>
  • Loading branch information
3 people committed Apr 20, 2020
1 parent 257ed01 commit be5a2b4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions rmw/include/rmw/message_sequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct RMW_PUBLIC_TYPE rmw_message_info_sequence_t
rcutils_allocator_t * allocator;
} rmw_message_info_sequence_t;

/// Return an rmw_message_sequence_t struct with members initialized to `NULL`;
/// Return an rmw_message_sequence_t struct with members initialized to `NULL`
RMW_PUBLIC
rmw_message_sequence_t
rmw_get_zero_initialized_message_sequence(void);
Expand All @@ -74,7 +74,7 @@ rmw_message_sequence_init(
/**
* The rmw_message_sequence_t struct has members which require memory to be allocated to them
* before setting values.
* This function reclaims any allocated resources within the obect and zeroes out all other
* This function reclaims any allocated resources within the object and zeroes out all other
* members.
*
* Note: This will not call `fini` or deallocate the underlying message structures.
Expand Down
6 changes: 3 additions & 3 deletions rmw/include/rmw/rmw.h
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ rmw_take_with_info(
*
* While `count` messages may be requested, fewer messages may be available on the subscription.
* In this case, only the currently available messages will be returned.
* The `taken` flag indicate the number of messages actually taken.
* The `taken` flag indicates the number of messages actually taken.
* The method will return `RMW_RET_OK` even in the case that fewer (or zero) messages retrieved
* from the subscription, and will `RMW_RET_ERROR` in the case of unexpected errors.
* In the case that `count` is zero, the function will return `RMW_RET_INVALID_ARGUMENT`.
Expand All @@ -728,14 +728,14 @@ rmw_take_with_info(
*
* \param[in] subscription The subscription object to take from.
* \param[in] count Number of messages to attempt to take.
* \param[out] message_sequence The sequence ROS message data on success.
* \param[out] message_sequence The sequence of ROS message data on success.
* \param[out] message_info_sequence The sequence of additional message metadata on success.
* \param[out] taken Number of messages actually taken from subscription.
* \param[in] allocation Preallocated buffer to use (may be NULL).
* \return `RMW_RET_OK` if successful, or
* \return `RMW_RET_INVALID_ARGUMENT` if an argument is invalid, or
* \return `RMW_RET_BAD_ALLOC` if memory allocation failed, or
* \return `RMW_RET_INCORRECT_RMW_IMPLEMENTATION` if the subscription is invalid, or
* \return `RMW_RET_INCORRECT_RMW_IMPLEMENTATION` if the rmw implementation does not match, or
* \return `RMW_RET_ERROR` if an unexpected error occurs.
*/
RMW_PUBLIC
Expand Down
3 changes: 2 additions & 1 deletion rmw/src/message_sequence.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ rmw_get_zero_initialized_message_sequence(void)
static rmw_message_sequence_t message_sequence = {
.data = NULL,
.size = 0u,
.capacity = 0u
.capacity = 0u,
.allocator = NULL
};

return message_sequence;
Expand Down

0 comments on commit be5a2b4

Please sign in to comment.