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

Make implicit double promotion/casting explicit (fixes #228) #273

Merged
merged 1 commit into from
Dec 31, 2022

Conversation

JulianSchoenbaechler
Copy link
Contributor

@JulianSchoenbaechler JulianSchoenbaechler commented Dec 29, 2022

This fixes issue #228. Clang, as well as gcc will warn about implicit double conversions if cglm is compiled with -Wdouble-promotion.

Double promotion happens for:

  • Comparisons (< > <= >= ==) with floats and the defined doubles GLM_FLT_EPSILON and CGLM_PRINT_MAX_TO_SHORT. So I explicitly used the f indicating that the values should be treated as floats.
  • The argument list of all the IO printf() functions when floats are displayed. Added an explicit cast for suppressing the warning.

Also use f-suffix on epsilon definitions for float comparisons.
@recp recp merged commit 3877159 into recp:master Dec 31, 2022
@recp
Copy link
Owner

recp commented Dec 31, 2022

Hi @JulianSchoenbaechler,

Many thanks for your contributions, the PR is merged 🚀

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.

2 participants