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 double to float downcasting warning #5479

Merged
merged 1 commit into from
Aug 3, 2022
Merged

Conversation

ricrogz
Copy link
Contributor

@ricrogz ricrogz commented Aug 1, 2022

Not a big issue, but the Visual Studio compiler raises a C4305 warning when using this header. If anyone includes this header while building with the /WX flag (treat all compiler warnings as errors), the build will fail.

The cause of the issue is that we are using a literal double value to initialize a float value, which counts as downcasting. Making the value a literal float fixes the issue.

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

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

LGTM

@greglandrum greglandrum added the Cleanup Code cleanup and refactoring label Aug 3, 2022
@greglandrum greglandrum added this to the 2022_03_5 milestone Aug 3, 2022
@greglandrum greglandrum merged commit 028a9a5 into master Aug 3, 2022
@ricrogz ricrogz deleted the fix_downcast_warning branch August 3, 2022 12:42
greglandrum pushed a commit that referenced this pull request Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cleanup Code cleanup and refactoring
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants