[Mesa-dev] [PATCH] util/atomic: Fix p_atomic_add for unlocked and msvc paths
Brian Paul
brianp at vmware.com
Mon Dec 9 18:18:13 UTC 2019
Reviewed-by: Brian Paul <brianp at vmware.com>
On 12/09/2019 10:49 AM, sroland at vmware.com wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> Braces mismatch (flagged by CI, untested).
>
> Fixes: 385d13f26d2 "util/atomic: Add a _return variant of p_atomic_add"
> ---
> src/util/u_atomic.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h
> index 9cbc6dd1eaa..1ad87c8feb1 100644
> --- a/src/util/u_atomic.h
> +++ b/src/util/u_atomic.h
> @@ -89,7 +89,7 @@
> #define p_atomic_dec_zero(_v) (p_atomic_dec_return(_v) == 0)
> #define p_atomic_inc(_v) ((void) p_atomic_inc_return(_v))
> #define p_atomic_dec(_v) ((void) p_atomic_dec_return(_v))
> -#define p_atomic_add(_v, _i) ((void) p_atomic_add_return((_v), (_i))
> +#define p_atomic_add(_v, _i) ((void) p_atomic_add_return((_v), (_i)))
> #define p_atomic_inc_return(_v) (++(*(_v)))
> #define p_atomic_dec_return(_v) (--(*(_v)))
> #define p_atomic_add_return(_v, _i) (*(_v) = *(_v) + (_i))
> @@ -146,7 +146,7 @@
> (assert(!"should not get here"), 0))
>
> #define p_atomic_add(_v, _i) \
> - ((void) p_atomic_add_return((_v), (_i))
> + ((void) p_atomic_add_return((_v), (_i)))
>
> #define p_atomic_add_return(_v, _i) (\
> sizeof *(_v) == sizeof(char) ? _InterlockedExchangeAdd8 ((char *) (_v), (_i)) : \
>
More information about the mesa-dev
mailing list