Skip to content

[foxy] Fix conversion of negative durations to messages (#1188)#1371

Merged
jacobperron merged 1 commit intofoxyfrom
jacob/backport_foxy_1188
Oct 6, 2020
Merged

[foxy] Fix conversion of negative durations to messages (#1188)#1371
jacobperron merged 1 commit intofoxyfrom
jacob/backport_foxy_1188

Conversation

@jacobperron
Copy link
Copy Markdown
Member

Backport #1188 to Foxy.

* Fix conversion from negative Duration or Time to the respective message type and throw in Duration::to_rmw_time() if the duration is negative.
rmw_time_t cannot represent negative durations.

Constructors and assignment operators can be just defaulted.

Other changes are mainly cosmetical, to make conversions between signed
and unsigned types and between 32-bit and 64-bit types more explicit.

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>

* Add -Wconversion compiler option and fix implicit conversions that might alter the value

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>

* Fix usage of fixture class in some unit tests by using gtest macro TEST_F() instead of TEST().

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>

* Add compiler option -Wno-sign-conversion to fix build with Clang on macOS

Signed-off-by: Johannes Meyer <johannes@intermodalics.eu>
Copy link
Copy Markdown
Member

@ivanpauno ivanpauno left a comment

Choose a reason for hiding this comment

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

lgtm

@jacobperron jacobperron merged commit 9c1cbdf into foxy Oct 6, 2020
@delete-merged-branch delete-merged-branch bot deleted the jacob/backport_foxy_1188 branch October 6, 2020 18:30
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