summaryrefslogtreecommitdiff
path: root/src/lib/eina
diff options
context:
space:
mode:
authorStefan Schmidt <s.schmidt@samsung.com>2019-02-28 10:08:23 +0100
committerStefan Schmidt <s.schmidt@samsung.com>2019-02-28 10:22:16 +0100
commita405a116c141b5f48ad76dda795ff21edafcf67b (patch)
tree1f739a8e06597db9588dd5a1171e848042871022 /src/lib/eina
parent53a80761db24abf9b7501011f5e0bb80d8dbf996 (diff)
eina: safe guard against macro expension error in EINA_*_EQ
Make sure we are use doubel also also in things like EINA_DBL_EQ(a-b, x+y). Thanks to Vicent for reporting and Xavi for giving me context. Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Differential Revision: https://phab.enlightenment.org/D8049
Diffstat (limited to 'src/lib/eina')
-rw-r--r--src/lib/eina/eina_util.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/eina/eina_util.h b/src/lib/eina/eina_util.h
index 6afd424921..08b15233ab 100644
--- a/src/lib/eina/eina_util.h
+++ b/src/lib/eina/eina_util.h
@@ -78,7 +78,7 @@ static inline Eina_Bool eina_flt_exact(float a, float b);
78 * 78 *
79 * @return @c true if two floats match 79 * @return @c true if two floats match
80 */ 80 */
81#define EINA_FLT_EQ(a, b) (!!(fabsf((float)a - (float)b) <= FLT_EPSILON)) 81#define EINA_FLT_EQ(a, b) (!!(fabsf((float)(a) - (float)(b)) <= FLT_EPSILON))
82 82
83/** 83/**
84 * @brief Determines if a float is not zero 84 * @brief Determines if a float is not zero
@@ -97,7 +97,7 @@ static inline Eina_Bool eina_flt_exact(float a, float b);
97 * 97 *
98 * @return @c true if two double match 98 * @return @c true if two double match
99 */ 99 */
100#define EINA_DBL_EQ(a, b) (!!(fabs((double)a - (double)b) <= DBL_EPSILON)) 100#define EINA_DBL_EQ(a, b) (!!(fabs((double)(a) - (double)(b)) <= DBL_EPSILON))
101 101
102/** 102/**
103 * @brief Determines if a double is not zero 103 * @brief Determines if a double is not zero