eina: resolve float comparison warnings

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11786
This commit is contained in:
Mike Blumenkrantz 2020-05-09 09:25:04 +01:00 committed by Carsten Haitzler (Rasterman)
parent 19da175f94
commit e0e1dc5f6f
2 changed files with 5 additions and 3 deletions

View File

@ -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;

View File

@ -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);