From 8ce2d991500300d466ff3572fcd60400083880d4 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Tue, 20 Dec 2016 10:59:55 -0500 Subject: [PATCH] ector: remove float comparison warnings Signed-off-by: Chris Michael --- src/lib/ector/software/ector_renderer_software_gradient_linear.c | 2 +- src/lib/ector/software/ector_renderer_software_gradient_radial.c | 4 ++-- src/lib/ector/software/ector_software_gradient.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/ector/software/ector_renderer_software_gradient_linear.c b/src/lib/ector/software/ector_renderer_software_gradient_linear.c index 69bf9e4..6160402 100644 --- a/src/lib/ector/software/ector_renderer_software_gradient_linear.c +++ b/src/lib/ector/software/ector_renderer_software_gradient_linear.c @@ -34,7 +34,7 @@ _ector_renderer_software_gradient_linear_ector_renderer_prepare(Eo *obj, pd->linear.l = pd->linear.dx * pd->linear.dx + pd->linear.dy * pd->linear.dy; pd->linear.off = 0; - if (pd->linear.l != 0) + if (!EINA_DBL_CMP(pd->linear.l, 0.0)) { pd->linear.dx /= pd->linear.l; pd->linear.dy /= pd->linear.l; diff --git a/src/lib/ector/software/ector_renderer_software_gradient_radial.c b/src/lib/ector/software/ector_renderer_software_gradient_radial.c index 439f193..a66df4f 100644 --- a/src/lib/ector/software/ector_renderer_software_gradient_radial.c +++ b/src/lib/ector/software/ector_renderer_software_gradient_radial.c @@ -26,12 +26,12 @@ _ector_renderer_software_gradient_radial_ector_renderer_prepare(Eo *obj, Ector_R pd->radial.cy = pd->grd->radial.y; pd->radial.cradius = pd->grd->radius; - if (!pd->grd->focal.x) + if (EINA_DBL_CMP(pd->grd->focal.x, 0.0)) pd->radial.fx = pd->grd->radial.x; else pd->radial.fx = pd->grd->focal.x; - if (!pd->grd->focal.y) + if (EINA_DBL_CMP(pd->grd->focal.y, 0.0)) pd->radial.fy = pd->grd->radial.y; else pd->radial.fy = pd->grd->focal.y; diff --git a/src/lib/ector/software/ector_software_gradient.c b/src/lib/ector/software/ector_software_gradient.c index ea1b4a2..5f63fca 100644 --- a/src/lib/ector/software/ector_software_gradient.c +++ b/src/lib/ector/software/ector_software_gradient.c @@ -386,7 +386,7 @@ fetch_linear_gradient(uint32_t *buffer, Span_Data *data, int y, int x, int lengt uint32_t *end; int t_fixed, inc_fixed; - if (g_data->linear.l == 0) + if (EINA_DBL_CMP(g_data->linear.l, 0.0)) { t = inc = 0; } -- 2.7.4