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:
@@ -14,22 +14,19 @@
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
void pump()
|
||||
{
|
||||
MSG msg;
|
||||
while (PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE))
|
||||
{
|
||||
while (PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE)) {
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessageW(&msg);
|
||||
}
|
||||
@@ -39,8 +36,7 @@ void pump()
|
||||
int main()
|
||||
{
|
||||
SharedMemory shm;
|
||||
if (!shm.create(shared_memory_name(GetCurrentProcessId()), sizeof(SharedBlock)))
|
||||
{
|
||||
if (!shm.create(shared_memory_name(GetCurrentProcessId()), sizeof(SharedBlock))) {
|
||||
std::printf("FAIL: create shared memory\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -66,17 +62,14 @@ int main()
|
||||
|
||||
// Install, retrying a few times in case the window isn't enumerable yet.
|
||||
bool installed = false;
|
||||
for (int i = 0; i < 20 && !installed; ++i)
|
||||
{
|
||||
for (int i = 0; i < 20 && !installed; ++i) {
|
||||
installed = hook::install_focus_spoof(ipc);
|
||||
if (!installed)
|
||||
{
|
||||
if (!installed) {
|
||||
pump();
|
||||
Sleep(20);
|
||||
}
|
||||
}
|
||||
if (!installed)
|
||||
{
|
||||
if (!installed) {
|
||||
std::printf("SKIP: focus spoof could not find the test window\n");
|
||||
DestroyWindow(win);
|
||||
UnregisterClassW(wc.lpszClassName, wc.hInstance);
|
||||
|
||||
Reference in New Issue
Block a user