From 961ed4e5ce11af6ceb4bdc39944133173619055c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 31 Jul 2025 21:55:10 -0400 Subject: Remove static constant for clang nonblocking inference Unfortunately the function effect checking added in clang 20 won't infer a function is nonblocking if it has a static constant variable (because the compiler might insert a lock to initialize it, or it might have an advanced constructor in C++). This isn't a big loss here, so just inline the value. --- include/lv2/atom/util.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'include/lv2') diff --git a/include/lv2/atom/util.h b/include/lv2/atom/util.h index 9a3d8a3..32e8b6a 100644 --- a/include/lv2/atom/util.h +++ b/include/lv2/atom/util.h @@ -38,9 +38,7 @@ extern "C" { static inline uint32_t lv2_atom_pad_size(uint32_t size) { - static const uint32_t mask = 7U; - - return (size + mask) & ~mask; + return (size + 7U) & ~(7U); } /** Return the total size of `atom`, including the header. */ -- cgit v1.2.1