summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-05-09 09:25:04 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-09 09:25:04 +0100
commite0e1dc5f6f55b12f34935ed383a9ca97e6cd6cd8 (patch)
tree7d21879c88334f4d9ea56f6c55b9a5d4bf1bf230
parent19da175f946dc398caf38e013474b1817fc8c23b (diff)
eina: resolve float comparison warnings
Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11786
-rw-r--r--src/lib/eina/eina_convert.c5
-rw-r--r--src/lib/eina/eina_debug_bt.c3
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c
index f210d14d8a..4683215df5 100644
--- a/src/lib/eina/eina_convert.c
+++ b/src/lib/eina/eina_convert.c
@@ -39,6 +39,7 @@
39#include "eina_safety_checks.h" 39#include "eina_safety_checks.h"
40#include "eina_convert.h" 40#include "eina_convert.h"
41#include "eina_fp.h" 41#include "eina_fp.h"
42#include "eina_util.h"
42 43
43/*============================================================================* 44/*============================================================================*
44* Local * 45* Local *
@@ -613,7 +614,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr)
613 else if (*iter == 0) 614 else if (*iter == 0)
614 goto on_success; 615 goto on_success;
615 616
616 if ((val == 2.2250738585072011) && ((minus_e * (int)expo_part) == -308)) 617 if ((eina_dbl_exact(val, 2.2250738585072011)) && ((minus_e * (int)expo_part) == -308))
617 { 618 {
618 val *= 1.0e-308; 619 val *= 1.0e-308;
619 a = iter; 620 a = iter;
@@ -621,7 +622,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr)
621 goto on_success; 622 goto on_success;
622 } 623 }
623 624
624 if ((val == 2.2250738585072012) && ((minus_e * (int)expo_part) <= -308)) 625 if ((eina_dbl_exact(val, 2.2250738585072012)) && ((minus_e * (int)expo_part) <= -308))
625 { 626 {
626 val *= 1.0e-308; 627 val *= 1.0e-308;
627 a = iter; 628 a = iter;
diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c
index a2510e9123..b915f23230 100644
--- a/src/lib/eina/eina_debug_bt.c
+++ b/src/lib/eina/eina_debug_bt.c
@@ -34,6 +34,7 @@
34 34
35#include "eina_debug.h" 35#include "eina_debug.h"
36#include "eina_debug_private.h" 36#include "eina_debug_private.h"
37#include "eina_util.h"
37 38
38#ifndef _WIN32 39#ifndef _WIN32
39# include <signal.h> 40# include <signal.h>
@@ -307,7 +308,7 @@ _trace_cb(void *data EINA_UNUSED)
307 static int bts = 0; 308 static int bts = 0;
308 int i; 309 int i;
309 310
310 if (!_trace_t0) _trace_t0 = get_time(); 311 if (!EINA_DBL_NONZERO(_trace_t0)) _trace_t0 = get_time();
311 312
312 // take a lock on grabbing thread debug info like backtraces 313 // take a lock on grabbing thread debug info like backtraces
313 eina_spinlock_take(&_eina_debug_thread_lock); 314 eina_spinlock_take(&_eina_debug_thread_lock);