From b767e286252dfbd50c2f63a5e7c5202960e7b153 Mon Sep 17 00:00:00 2001 From: Wander Lairson Costa Date: Fri, 3 Jul 2020 14:06:03 +0000 Subject: [PATCH] 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 Reviewed-by: Vincent Torri Differential Revision: https://phab.enlightenment.org/D12041 --- src/lib/eina/eina_types.h | 16 ++++++++-------- 1 file 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