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
+10 -8
View File
@@ -6,22 +6,24 @@
#include <sys/sysctl.h>
#include <unistd.h>
const char* ffDetectMemory(FFMemoryResult* ram)
{
const char* ffDetectMemory(FFMemoryResult* ram) {
size_t length = sizeof(ram->bytesTotal);
#if FF_APPLE_MEMSIZE_USABLE
if (sysctlbyname("hw.memsize_usable", &ram->bytesTotal, &length, NULL, 0) != 0)
#if FF_APPLE_MEMSIZE_USABLE
if (sysctlbyname("hw.memsize_usable", &ram->bytesTotal, &length, NULL, 0) != 0) {
return "Failed to read hw.memsize_usable";
#else
if (sysctl((int[]){ CTL_HW, HW_MEMSIZE }, 2, &ram->bytesTotal, &length, NULL, 0) != 0)
}
#else
if (sysctl((int[]) {CTL_HW, HW_MEMSIZE}, 2, &ram->bytesTotal, &length, NULL, 0) != 0) {
return "Failed to read hw.memsize";
#endif
}
#endif
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
vm_statistics64_data_t vmstat;
if(host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t) (&vmstat), &count) != KERN_SUCCESS)
if (host_statistics64(mach_host_self(), HOST_VM_INFO64, (host_info64_t) (&vmstat), &count) != KERN_SUCCESS) {
return "Failed to read host_statistics64";
}
// https://github.com/st3fan/osx-10.9/blob/34e34a6a539b5a822cda4074e56a7ced9b57da71/system_cmds-597.1.1/vm_stat.tproj/vm_stat.c#L139