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

fix default value for non-primitive fixed-size arrays #74

Merged

Conversation

dirk-thomas
Copy link
Member

Fix regression of #64 as reported in #64 (comment)

@ros/ros_team Please review.

return '[' + def_val + '] * ' + str(array_len)
if base_type in [
'byte', 'int8', 'int16', 'int32', 'int64', 'uint16', 'uint32',
'uint64', 'float32', 'float64', 'string', 'bool'
Copy link
Member

Choose a reason for hiding this comment

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

looking at http://wiki.ros.org/msg, looks like byte should be called uint8 here.
Or to match how it's defined above in the same file we should add both char and uint8 to this list for completeness

Copy link
Member Author

Choose a reason for hiding this comment

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

This code needs to handle all possible types. Therefore I think it needs to also check for byte.

It does not need to consider char and uint8 though since those are already handled in the if block above.

Copy link
Member

Choose a reason for hiding this comment

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

oh sorry I missed that it was the same conditional block. All good then

@mikaelarguedas
Copy link
Member

Except nitpick comment looks good to me

@dirk-thomas dirk-thomas merged commit 45ecd54 into kinetic-devel Feb 27, 2017
@dirk-thomas dirk-thomas deleted the fix_default_value_non_primitive_fixed_size_arrays branch February 27, 2017 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants