Skip to content

Avoid implicit conversion to double#283

Open
hpjansson wants to merge 1 commit into
ebassi:masterfrom
hpjansson:issue-249
Open

Avoid implicit conversion to double#283
hpjansson wants to merge 1 commit into
ebassi:masterfrom
hpjansson:issue-249

Conversation

@hpjansson

Copy link
Copy Markdown

No description provided.


/* up and z_axis are parallel */
if (fabs (graphene_simd4f_get_z (up) - 1.0) < FLT_EPSILON)
if (fabsf (graphene_simd4f_get_z (up) - 1.f) < FLT_EPSILON)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks all good and it's still readable. (I'm not a maintainer, but I'm doing a review to help getting this merged).

Everything is float after the change:

  • graphene_simd4f_get_z() returns a float.
  • 1.f is float.
  • fabsf() takes a float argument and returns a float.
  • FLT_EPSILON is afloat.

Tested the patch, it fixes all the warnings that I had (using clang).

I think it would be nice to add an automated/regression test (just for the public #include <graphene.h>, not for all the *.c files).

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