Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/graphene-simd4x4f.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ graphene_simd4x4f_init_look_at (graphene_simd4x4f_t *m,
graphene_simd4f_t tweak_z;

/* 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).

tweak_z = graphene_simd4f_init (0.0001f, 0, 0, 0);
else
tweak_z = graphene_simd4f_init (0, 0, 0.0001f, 0);
Expand Down