summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWander Lairson Costa <wander.lairson@gmail.com>2020-07-03 14:06:03 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-07-03 18:17:29 +0200
commitb767e286252dfbd50c2f63a5e7c5202960e7b153 (patch)
treeea279fd02ace41f682b87b91714cee0fa73ba569
parentd55b7939d6088e987d23ee1b8835cdaeecb55136 (diff)
downloadefl-b767e286252dfbd50c2f63a5e7c5202960e7b153.tar.gz
Protect EINA_(UN)LIKELY with parenthesis around the expr
Without it an expression like !EINA_LIKELY(a && b) expands !a && b Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Reviewed-by: Vincent Torri <vincent.torri@gmail.com> Differential Revision: https://phab.enlightenment.org/D12041
-rw-r--r--src/lib/eina/eina_types.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h
index b93e99f483..25ad33a89a 100644
--- a/src/lib/eina/eina_types.h
+++ b/src/lib/eina/eina_types.h
@@ -264,8 +264,8 @@
# define EINA_FORMAT(fmt)
# define EINA_CONST
# define EINA_NOINSTRUMENT
-# define EINA_UNLIKELY(exp) exp
-# define EINA_LIKELY(exp) exp
+# define EINA_UNLIKELY(exp) (exp)
+# define EINA_LIKELY(exp) (exp)
# define EINA_SENTINEL
# define EINA_FALLTHROUGH
# define EINA_PREFETCH(arg) ((void) (arg))
@@ -290,8 +290,8 @@
# define EINA_FORMAT(fmt)
# define EINA_CONST
# define EINA_NOINSTRUMENT
-# define EINA_UNLIKELY(exp) exp
-# define EINA_LIKELY(exp) exp
+# define EINA_UNLIKELY(exp) (exp)
+# define EINA_LIKELY(exp) (exp)
# define EINA_SENTINEL
# define EINA_FALLTHROUGH
# define EINA_PREFETCH(arg) ((void) (arg))
@@ -320,8 +320,8 @@
# define EINA_CONST
# endif
# define EINA_NOINSTRUMENT
-# define EINA_UNLIKELY(exp) exp
-# define EINA_LIKELY(exp) exp
+# define EINA_UNLIKELY(exp) (exp)
+# define EINA_LIKELY(exp) (exp)
# define EINA_SENTINEL
# define EINA_FALLTHROUGH
# define EINA_PREFETCH(arg) ((void) (arg))
@@ -424,7 +424,7 @@
* processor architectures can then optimize the more likely path.
* @param[in] exp The expression to be used.
*/
-# define EINA_UNLIKELY(exp) exp
+# define EINA_UNLIKELY(exp) (exp)
/**
* @def EINA_LIKELY
@@ -432,7 +432,7 @@
* processor architectures can then optimize the more likely path.
* @param[in] exp The expression to be used.
*/
-# define EINA_LIKELY(exp) exp
+# define EINA_LIKELY(exp) (exp)
/**
* @def EINA_SENTINEL