At 1252075632 time_t, Brian Gianforcaro wrote: > When compiling with -Wfloat-equal you will notice a few warnings about > unsafe comparison of floating points with == or != operators. > > To get around this two functions a_compare_float & a_compare_double > were created. They safely compare the two floating point numbers > within a given precision.
While the implementation seems good, I don't think it's right way to fix that: let me explain. We store the opacity as a double between 0 and 1, but actually, this is useless. The real property is a uint32_t (CARD32) between 0 and 2^32. Storing and comparing this value in the object struct and returning as a double (value / 2^32) would be a better fix. Cheers, -- Julien Danjou // ᐰ <[email protected]> http://julien.danjou.info // 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD // Don't give up.
signature.asc
Description: Digital signature
