From 7c1fd71b7bc8a1e18248956e91545a25b4f6178e Mon Sep 17 00:00:00 2001 From: akallabeth Date: Fri, 30 Aug 2024 15:17:10 +0200 Subject: [PATCH] [uwac] elminate pedantic warnings from defines --- uwac/libuwac/uwac-utils.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/uwac/libuwac/uwac-utils.h b/uwac/libuwac/uwac-utils.h index 89852d530..f5b95fec6 100644 --- a/uwac/libuwac/uwac-utils.h +++ b/uwac/libuwac/uwac-utils.h @@ -25,18 +25,9 @@ #include -#define min(a, b) \ - ({ \ - __typeof__(a) _a = (a); \ - __typeof__(b) _b = (b); \ - _a < _b ? _a : _b; \ - }) +#define min(a, b) (a) < (b) ? (a) : (b) -#define container_of(ptr, type, member) \ - ({ \ - __typeof__(((type*)0)->member)* __mptr = (ptr); \ - (type*)((char*)__mptr - offsetof(type, member)); \ - }) +#define container_of(ptr, type, member) (type*)((char*)(ptr)-offsetof(type, member)) #define ARRAY_LENGTH(a) (sizeof(a) / sizeof(a)[0])