From a984eb367c032dbe2577f01238c3d1268526be70 Mon Sep 17 00:00:00 2001 From: Kacper Date: Thu, 25 Dec 2025 19:24:38 +0100 Subject: Clang-tidy fixes --- lib/libm/atomic.h | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'lib/libm/atomic.h') diff --git a/lib/libm/atomic.h b/lib/libm/atomic.h index 44d659b7..b0a406ea 100644 --- a/lib/libm/atomic.h +++ b/lib/libm/atomic.h @@ -246,8 +246,7 @@ static inline void a_or_64(volatile uint64_t *p, uint64_t v) #endif #ifndef a_cas_p -typedef char a_cas_p_undefined_but_pointer_not_32bit - [-sizeof(char) == 0xffffffff ? 1 : -1]; +typedef char a_cas_p_undefined_but_pointer_not_32bit[-sizeof(char) == 0xffffffff ? 1 : -1]; #define a_cas_p a_cas_p static inline void *a_cas_p(volatile void *p, void *t, void *s) { @@ -281,10 +280,8 @@ static inline int a_ctz_32(uint32_t x) #ifdef a_clz_32 return 31 - a_clz_32(x & -x); #else - static const char debruijn32[32] = { 0, 1, 23, 2, 29, 24, 19, 3, - 30, 27, 25, 11, 20, 8, 4, 13, - 31, 22, 28, 18, 26, 10, 7, 12, - 21, 17, 9, 6, 16, 5, 15, 14 }; + static const char debruijn32[32] = { 0, 1, 23, 2, 29, 24, 19, 3, 30, 27, 25, 11, 20, 8, 4, 13, + 31, 22, 28, 18, 26, 10, 7, 12, 21, 17, 9, 6, 16, 5, 15, 14 }; return debruijn32[(x & -x) * 0x076be629 >> 27]; #endif } @@ -294,12 +291,10 @@ static inline int a_ctz_32(uint32_t x) #define a_ctz_64 a_ctz_64 static inline int a_ctz_64(uint64_t x) { - static const char debruijn64[64] = { - 0, 1, 2, 53, 3, 7, 54, 27, 4, 38, 41, 8, 34, 55, 48, 28, - 62, 5, 39, 46, 44, 42, 22, 9, 24, 35, 59, 56, 49, 18, 29, 11, - 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10, - 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12 - }; + static const char debruijn64[64] = { 0, 1, 2, 53, 3, 7, 54, 27, 4, 38, 41, 8, 34, 55, 48, 28, + 62, 5, 39, 46, 44, 42, 22, 9, 24, 35, 59, 56, 49, 18, 29, 11, + 63, 52, 6, 26, 37, 40, 33, 47, 61, 45, 43, 21, 23, 58, 17, 10, + 51, 25, 36, 32, 60, 20, 57, 16, 50, 31, 19, 15, 30, 14, 13, 12 }; if (sizeof(long) < 8) { uint32_t y = x; if (!y) { -- cgit v1.2.3