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

๐Ÿ‘ฉโ€๐ŸŒพ Don't use std::pow with integers in Vectors #207

Merged
merged 3 commits into from
Apr 23, 2021

Conversation

chapulina
Copy link
Contributor

๐ŸฆŸ Bug fix

Summary

ign-gazebo has the following Windows warning tracing back to ign-math:

[283.328s] C:\Jenkins\workspace\ign_gazebo-pr-win\ws\install\ignition-math6\include\ignition\math6\ignition/math/Vector2.hh(98,14): warning C4244: 'return': conversion from 'double' to 'T', possible loss of data [C:\Jenkins\workspace\ign_gazebo-pr-win\ws\build\ignition-gazebo5\src\gui\plugins\scene3d\GzScene3D.vcxproj]

We don't have lots of tests using integers as templates, so we didn't catch that here. It would be interesting to add tests for that.

I noticed other uses of std::pow in the codebase in classes like Inertial, MassMatrix3, Sphere, etc. Some of them don't have integer typedefs (i.e. there's no Inertiali), but some of them do (Spherei). I'm not sure we have valid use cases for integer shapes, so I didn't add tests for them or updated the std::pow usage for now.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ๐Ÿ”ธ

https://github.com/osrf/buildfarmer/issues/181

@chapulina chapulina added the Windows Windows support label Apr 22, 2021
@chapulina chapulina requested a review from scpeters as a code owner April 22, 2021 16:45
@github-actions github-actions bot added ๐Ÿข edifice Ignition Edifice ๐Ÿฏ fortress Ignition Fortress ๐Ÿฐ citadel Ignition Citadel ๐Ÿ”ฎ dome Ignition Dome labels Apr 22, 2021
@scpeters
Copy link
Member

the Length functions have errors on Windows now

@chapulina
Copy link
Contributor Author

the Length functions have errors on Windows now

Yes! I love it when tests do their job! Looking into it.

Signed-off-by: Louise Poubel <[email protected]>
Signed-off-by: Louise Poubel <[email protected]>
@chapulina chapulina merged commit 46928d2 into ign-math6 Apr 23, 2021
@chapulina chapulina deleted the chapulina/6/pow branch April 23, 2021 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
๐Ÿฐ citadel Ignition Citadel ๐Ÿ”ฎ dome Ignition Dome ๐Ÿข edifice Ignition Edifice ๐Ÿฏ fortress Ignition Fortress Windows Windows support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants