forked from enlightenment/efl
xcf: fix float comparison in xcf generic loader.
This commit is contained in:
parent
3d0c4ac0f6
commit
3751e29a9b
|
@ -20,6 +20,10 @@
|
|||
|
||||
#include "common.h"
|
||||
|
||||
#include <float.h>
|
||||
|
||||
#define EINA_FLT_CMP(a, b) (fabsf((float)a - (float)b) <= FLT_EPSILON)
|
||||
|
||||
#define RS R_VAL(src + s_idx)
|
||||
#define GS G_VAL(src + s_idx)
|
||||
#define BS B_VAL(src + s_idx)
|
||||
|
@ -128,7 +132,7 @@ hls_to_rgb (DATA8 *hue, DATA8 *lightness, DATA8 *saturation)
|
|||
l = *lightness;
|
||||
s = *saturation;
|
||||
|
||||
if (s == 0)
|
||||
if (EINA_FLT_CMP(s, 0))
|
||||
{
|
||||
/* achromatic case */
|
||||
*hue = l;
|
||||
|
@ -184,7 +188,7 @@ rgb_to_hsv (DATA8 *red, DATA8 *green, DATA8 *blue)
|
|||
else
|
||||
s = 0;
|
||||
|
||||
if (s == 0)
|
||||
if (EINA_FLT_CMP(s, 0))
|
||||
h = 0;
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue