Apply clang-format across the whole tree

Run clang-format (the repo's .clang-format: LLVM base, 120 cols, tabs,
Allman functions) over every source file so the tree is formatter-clean.
Whitespace only -- no behavior change; full x64 + x86 suites pass.

Also set SortIncludes: false in .clang-format. Windows include order is
load-bearing (windows.h must precede tlhelp32.h / mmreg.h / xinput.h /
dinput.h; winsock2.h must precede windows.h), and the default
alphabetical sort reorders tlhelp32.h ahead of windows.h -- a build
break. Leaving order alone keeps the manual, correct grouping.
This commit is contained in:
2026-07-12 11:52:53 +02:00
parent c684a15fb9
commit 30eccf749d
155 changed files with 3333 additions and 6171 deletions

View File

@@ -10,14 +10,12 @@
using namespace coop;
namespace
{
namespace {
int g_failures = 0;
void check(bool ok, const char* what)
{
std::printf("%s %s\n", ok ? " ok:" : "FAIL:", what);
if (!ok)
{
if (!ok) {
++g_failures;
}
}
@@ -25,8 +23,7 @@ void check(bool ok, const char* what)
bool touch(const std::wstring& path)
{
HANDLE h = CreateFileW(path.c_str(), GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (h == INVALID_HANDLE_VALUE)
{
if (h == INVALID_HANDLE_VALUE) {
return false;
}
CloseHandle(h);
@@ -35,8 +32,7 @@ bool touch(const std::wstring& path)
std::wstring parent_of(std::wstring dir) // dir has a trailing separator
{
if (!dir.empty())
{
if (!dir.empty()) {
dir.pop_back();
}
const std::size_t slash = dir.find_last_of(L"\\/");
@@ -62,8 +58,7 @@ int main()
check(deployed_artifact_path(near_name.c_str()) == here + near_name, "resolves an artifact next to the exe");
// one directory up (the deployable root) when it isn't next to the exe.
if (have_up)
{
if (have_up) {
check(touch(up_dir + up_name), "created a marker one directory up");
check(deployed_artifact_path(up_name.c_str()) == up_dir + up_name,
"falls back to the artifact one directory up");
@@ -74,8 +69,7 @@ int main()
"missing artifact -> next-to-exe fallback path");
DeleteFileW((here + near_name).c_str());
if (have_up)
{
if (have_up) {
DeleteFileW((up_dir + up_name).c_str());
}