From 61594270f47c28d1ef4bcb8aeb533bb5637eb753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Sun, 17 Apr 2022 02:09:43 +0200 Subject: [PATCH] spa: utils: defs: parenthesize macro bodies Parenthesize the body of the `SPA_CONTAINER_OF()` and `SPA_PTR_ALIGN()` macros. --- spa/include/spa/utils/defs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/include/spa/utils/defs.h b/spa/include/spa/utils/defs.h index 369dd22a9..874fab410 100644 --- a/spa/include/spa/utils/defs.h +++ b/spa/include/spa/utils/defs.h @@ -174,7 +174,7 @@ struct spa_fraction { #define SPA_MEMBER(b,o,t) SPA_PTROFF(b,o,t) #define SPA_MEMBER_ALIGN(b,o,a,t) SPA_PTROFF_ALIGN(b,o,a,t) -#define SPA_CONTAINER_OF(p,t,m) (t*)((uintptr_t)p - offsetof (t,m)) +#define SPA_CONTAINER_OF(p,t,m) ((t*)((uintptr_t)p - offsetof(t,m))) #define SPA_PTRDIFF(p1,p2) ((intptr_t)(p1) - (intptr_t)(p2)) @@ -236,7 +236,7 @@ struct spa_fraction { #define SPA_PTR_ALIGNMENT(p,align) ((intptr_t)(p) & ((align)-1)) #define SPA_IS_ALIGNED(p,align) (SPA_PTR_ALIGNMENT(p,align) == 0) -#define SPA_PTR_ALIGN(p,align,type) (type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align)) +#define SPA_PTR_ALIGN(p,align,type) ((type*)SPA_ROUND_UP_N((intptr_t)(p), (intptr_t)(align))) #ifndef SPA_LIKELY #ifdef __GNUC__