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

@@ -22,45 +22,37 @@ int wmain(int argc, wchar_t** argv)
const double freq = (argc > 2) ? _wtof(argv[2]) : 440.0;
coop::tone::ToneFormat tf;
if (argc > 3)
{
if (argc > 3) {
tf.rate = static_cast<unsigned>(_wtoi(argv[3]));
}
if (argc > 4)
{
if (argc > 4) {
tf.channels = static_cast<unsigned>(_wtoi(argv[4]));
}
if (argc > 5)
{
if (argc > 5) {
tf.bits = static_cast<unsigned>(_wtoi(argv[5]));
}
tf.is_float = (argc > 6) ? (_wcsicmp(argv[6], L"float") == 0) : (tf.bits == 32); // 32-bit -> float default
if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED)))
{
if (FAILED(CoInitializeEx(nullptr, COINIT_MULTITHREADED))) {
std::fprintf(stderr, "CoInitializeEx failed\n");
return 1;
}
int rc = 1;
coop::tone::ToneSource tone;
if (tone.open(tf, freq))
{
if (tone.open(tf, freq)) {
const coop::tone::ToneFormat& f = tone.format();
std::printf("TONE_RENDERING pid=%lu %.0fHz %uHz %uch %ubit %s\n", GetCurrentProcessId(), freq, f.rate,
f.channels, f.bits, f.is_float ? "float" : "pcm");
std::fflush(stdout);
const DWORD end_tick = GetTickCount() + static_cast<DWORD>(seconds * 1000.0);
while (GetTickCount() < end_tick)
{
while (GetTickCount() < end_tick) {
tone.render_step(200);
}
tone.close();
rc = 0;
}
else
{
} else {
std::fprintf(stderr, "TONE_OPEN_FAILED (endpoint or format unavailable)\n");
}