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:
@@ -15,24 +15,20 @@
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
bool all_disabled(const SharedBlock* b)
|
||||
{
|
||||
for (std::uint32_t s = 0; s < HookSubsys_Count; ++s)
|
||||
{
|
||||
if (b->control.subsystem_disabled[s].load(std::memory_order_acquire) != 1u)
|
||||
{
|
||||
for (std::uint32_t s = 0; s < HookSubsys_Count; ++s) {
|
||||
if (b->control.subsystem_disabled[s].load(std::memory_order_acquire) != 1u) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -41,10 +37,8 @@ bool all_disabled(const SharedBlock* b)
|
||||
|
||||
bool none_disabled(const SharedBlock* b)
|
||||
{
|
||||
for (std::uint32_t s = 0; s < HookSubsys_Count; ++s)
|
||||
{
|
||||
if (b->control.subsystem_disabled[s].load(std::memory_order_acquire) != 0u)
|
||||
{
|
||||
for (std::uint32_t s = 0; s < HookSubsys_Count; ++s) {
|
||||
if (b->control.subsystem_disabled[s].load(std::memory_order_acquire) != 0u) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -57,8 +51,7 @@ int main()
|
||||
const unsigned long pid = GetCurrentProcessId(); // section name is per-pid; no real game needed
|
||||
|
||||
IpcServer server;
|
||||
if (!server.start(pid))
|
||||
{
|
||||
if (!server.start(pid)) {
|
||||
std::printf("FAIL: IpcServer::start\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -66,8 +59,7 @@ int main()
|
||||
// A second view of the same section, standing in for the injected hook: it reads the control
|
||||
// flags the host writes and publishes the hook registry the host reads back.
|
||||
SharedMemory hook_view;
|
||||
if (!hook_view.open(shared_memory_name(pid), sizeof(SharedBlock)))
|
||||
{
|
||||
if (!hook_view.open(shared_memory_name(pid), sizeof(SharedBlock))) {
|
||||
std::printf("FAIL: open hook view\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user