From 7ae18c50986bdc929d9e1337a86349b2cfb65d45 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 20 Mar 2024 10:06:44 +0100 Subject: [PATCH] spa: a quick fix for compiling with -Werror=shadow spa_exchange() is used in spa_clear_ptr() and spa_clear_fd() which already use the _old_value variable. So make it use a slightly different local variable name to avoid shadow warnings. Fixes #3915 --- spa/include/spa/utils/cleanup.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spa/include/spa/utils/cleanup.h b/spa/include/spa/utils/cleanup.h index faf25a518..266fcf1bd 100644 --- a/spa/include/spa/utils/cleanup.h +++ b/spa/include/spa/utils/cleanup.h @@ -7,10 +7,10 @@ #define spa_exchange(var, new_value) \ __extension__ ({ \ - __typeof__(var) *_ptr = &(var); \ - __typeof__(var) _old_value = *_ptr; \ - *_ptr = (new_value); \ - _old_value; \ + __typeof__(var) *_ptr_ = &(var); \ + __typeof__(var) _old_value_ = *_ptr_; \ + *_ptr_ = (new_value); \ + _old_value_; \ }) /* ========================================================================== */