Chore: run clang-format

```bash
find . -type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) ! -path "src/3rdparty/*" -print0 | xargs -0 clang-format -i
```
This commit is contained in:
李通洲
2026-03-29 09:28:49 +08:00
parent cdd4cee968
commit e0eba8ce21
690 changed files with 28093 additions and 30062 deletions
+21 -22
View File
@@ -4,36 +4,35 @@
#include <assert.h>
#if FF_HAVE_MALLOC_USABLE_SIZE || FF_HAVE_MSVC_MSIZE
#if __has_include(<malloc.h>)
#include <malloc.h>
#else
#include <malloc_np.h> // For DragonFly BSD
#endif
# if __has_include(<malloc.h>)
# include <malloc.h>
# else
# include <malloc_np.h> // For DragonFly BSD
# endif
#elif FF_HAVE_MALLOC_SIZE
#include <malloc/malloc.h>
# include <malloc/malloc.h>
#endif
static inline void ffWrapFree(const void* pPtr)
{
static inline void ffWrapFree(const void* pPtr) {
assert(pPtr);
if(*(void**)pPtr)
free(*(void**)pPtr);
if (*(void**) pPtr) {
free(*(void**) pPtr);
}
}
#define FF_AUTO_FREE __attribute__((__cleanup__(ffWrapFree)))
// ptr MUST be a malloc'ed pointer
static inline size_t ffMallocUsableSize(const void* ptr)
{
static inline size_t ffMallocUsableSize(const void* ptr) {
assert(ptr);
#if FF_HAVE_MALLOC_USABLE_SIZE
return malloc_usable_size((void*) ptr);
#elif FF_HAVE_MALLOC_SIZE
return malloc_size((void*) ptr);
#elif FF_HAVE_MSVC_MSIZE
return _msize((void*) ptr);
#else
(void) ptr;
return 0; // Not supported
#endif
#if FF_HAVE_MALLOC_USABLE_SIZE
return malloc_usable_size((void*) ptr);
#elif FF_HAVE_MALLOC_SIZE
return malloc_size((void*) ptr);
#elif FF_HAVE_MSVC_MSIZE
return _msize((void*) ptr);
#else
(void) ptr;
return 0; // Not supported
#endif
}