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
+24 -24
View File
@@ -2,8 +2,7 @@
#include "common/processing.h"
#include "common/FFstrbuf.h"
typedef struct FFCommandResultBundle
{
typedef struct FFCommandResultBundle {
FFProcessHandle handle;
const char* error;
} FFCommandResultBundle;
@@ -13,26 +12,25 @@ static FFlist commandQueue = {
.elementSize = sizeof(FFCommandResultBundle),
};
static const char* spawnProcess(FFCommandOptions* options, FFProcessHandle* handle)
{
if (options->text.length == 0)
static const char* spawnProcess(FFCommandOptions* options, FFProcessHandle* handle) {
if (options->text.length == 0) {
return "No command text specified";
}
return ffProcessSpawn(options->param.length ? (char* const[]){
options->shell.chars,
options->param.chars,
options->text.chars,
NULL
} : (char* const[]){
options->shell.chars,
options->text.chars,
NULL
}, options->useStdErr, handle);
return ffProcessSpawn(options->param.length ? (char* const[]) {
options->shell.chars,
options->param.chars,
options->text.chars,
NULL}
: (char* const[]) {options->shell.chars, options->text.chars, NULL},
options->useStdErr,
handle);
}
bool ffPrepareCommand(FFCommandOptions* options)
{
if (!options->parallel) return false;
bool ffPrepareCommand(FFCommandOptions* options) {
if (!options->parallel) {
return false;
}
FFCommandResultBundle* bundle = ffListAdd(&commandQueue);
bundle->error = spawnProcess(options, &bundle->handle);
@@ -40,20 +38,22 @@ bool ffPrepareCommand(FFCommandOptions* options)
return true;
}
const char* ffDetectCommand(FFCommandOptions* options, FFstrbuf* result)
{
const char* ffDetectCommand(FFCommandOptions* options, FFstrbuf* result) {
FFCommandResultBundle bundle = {};
if (!options->parallel)
if (!options->parallel) {
bundle.error = spawnProcess(options, &bundle.handle);
else if (!ffListShift(&commandQueue, &bundle))
} else if (!ffListShift(&commandQueue, &bundle)) {
return "[BUG] command queue is empty";
}
if (bundle.error)
if (bundle.error) {
return bundle.error;
}
bundle.error = ffProcessReadOutput(&bundle.handle, result);
if (bundle.error)
if (bundle.error) {
return bundle.error;
}
ffStrbufTrimRightSpace(result);
return NULL;