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
devs/stefan/exactness-new-tests
Wander Lairson Costa 2 years ago committed by Marcel Hollerbach
parent d55b7939d6
commit b767e28625
  1. 16
      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

Loading…
Cancel
Save