sal: don't use reserved identifiers, much less in public API

rename to SAL_DETAIL_BOOLEAN_EXPR

Change-Id: Ifb2b2d09a421313e021062cb37ade8777c30f25a
This commit is contained in:
Michael Stahl
2016-01-06 13:04:15 +01:00
parent 0bc3b393c6
commit cd103a888b

View File

@@ -616,15 +616,15 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
#if defined(__GNUC__) #if defined(__GNUC__)
// Macro to try to catch and warn on assignments inside expr. // Macro to try to catch and warn on assignments inside expr.
# define _SAL_BOOLEAN_EXPR(expr) \ # define SAL_DETAIL_BOOLEAN_EXPR(expr) \
__extension__ ({ \ __extension__ ({ \
int _sal_boolean_var_; \ int sal_boolean_var_; \
if (expr) \ if (expr) \
_sal_boolean_var_ = 1; \ sal_boolean_var_ = 1; \
else \ else \
_sal_boolean_var_ = 0; \ sal_boolean_var_ = 0; \
_sal_boolean_var_; \ sal_boolean_var_; \
}) })
/** An optimization annotation: denotes that expression is likely to be true. /** An optimization annotation: denotes that expression is likely to be true.
@@ -636,7 +636,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
Returns: the boolean value of expr (expressed as either int 1 or 0) Returns: the boolean value of expr (expressed as either int 1 or 0)
*/ */
# define SAL_LIKELY(expr) (__builtin_expect (_SAL_BOOLEAN_EXPR(expr), 1)) # define SAL_LIKELY(expr) (__builtin_expect(SAL_DETAIL_BOOLEAN_EXPR(expr), 1))
/** An optimization annotation: denotes that expression is unlikely to be true. /** An optimization annotation: denotes that expression is unlikely to be true.
@@ -648,7 +648,7 @@ template< typename T1, typename T2 > inline T1 static_int_cast(T2 n) {
Returns: the boolean value of expr (expressed as either int 1 or 0) Returns: the boolean value of expr (expressed as either int 1 or 0)
*/ */
# define SAL_UNLIKELY(expr) (__builtin_expect (_SAL_BOOLEAN_EXPR(expr), 0)) # define SAL_UNLIKELY(expr) (__builtin_expect(SAL_DETAIL_BOOLEAN_EXPR(expr), 0))
/** An optimization annotation: tells the compiler to work harder at this code /** An optimization annotation: tells the compiler to work harder at this code