summaryrefslogtreecommitdiff
path: root/src/lib/eina
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 /src/lib/eina
parent19da175f946dc398caf38e013474b1817fc8c23b (diff)
downloadefl-e0e1dc5f6f55b12f34935ed383a9ca97e6cd6cd8.tar.gz
eina: resolve float comparison warnings
Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11786
Diffstat (limited to 'src/lib/eina')
-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 @@
#include "eina_safety_checks.h"
#include "eina_convert.h"
#include "eina_fp.h"
+#include "eina_util.h"
/*============================================================================*
* Local *
@@ -613,7 +614,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr)
else if (*iter == 0)
goto on_success;
- if ((val == 2.2250738585072011) && ((minus_e * (int)expo_part) == -308))
+ if ((eina_dbl_exact(val, 2.2250738585072011)) && ((minus_e * (int)expo_part) == -308))
{
val *= 1.0e-308;
a = iter;
@@ -621,7 +622,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr)
goto on_success;
}
- if ((val == 2.2250738585072012) && ((minus_e * (int)expo_part) <= -308))
+ if ((eina_dbl_exact(val, 2.2250738585072012)) && ((minus_e * (int)expo_part) <= -308))
{
val *= 1.0e-308;
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 @@
#include "eina_debug.h"
#include "eina_debug_private.h"
+#include "eina_util.h"
#ifndef _WIN32
# include <signal.h>
@@ -307,7 +308,7 @@ _trace_cb(void *data EINA_UNUSED)
static int bts = 0;
int i;
- if (!_trace_t0) _trace_t0 = get_time();
+ if (!EINA_DBL_NONZERO(_trace_t0)) _trace_t0 = get_time();
// take a lock on grabbing thread debug info like backtraces
eina_spinlock_take(&_eina_debug_thread_lock);