From ed01e12ed732fc9e3516ed263ebb73978b6f82f6 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 14:50:01 -0700 Subject: main.cpp: Fixed warnings with g_TERMINATE_EVENT_RAISED and g_SERVER_TERMINATED --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 0ff9361be..d8b14cacc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,8 +12,8 @@ #endif // _MSC_VER // Here, we have some ALL CAPS variables, to give the impression that this is deeeep, gritty programming :P -bool g_TERMINATE_EVENT_RAISED = false; // If something has told the server to stop; checked periodically in cRoot -bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so our CTRL handler can then tell Windows to close the console +bool cRoot::g_TERMINATE_EVENT_RAISED = false; // If something has told the server to stop; checked periodically in cRoot +static bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so our CTRL handler can then tell the OS to close the console @@ -52,7 +52,7 @@ bool g_ShouldLogCommOut; void NonCtrlHandler(int a_Signal) { LOGD("Terminate event raised from std::signal"); - g_TERMINATE_EVENT_RAISED = true; + cRoot::g_TERMINATE_EVENT_RAISED = true; switch (a_Signal) { @@ -155,7 +155,7 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except // Handle CTRL events in windows, including console window close BOOL CtrlHandler(DWORD fdwCtrlType) { - g_TERMINATE_EVENT_RAISED = true; + cRoot::g_TERMINATE_EVENT_RAISED = true; LOGD("Terminate event raised from the Windows CtrlHandler"); if (fdwCtrlType == CTRL_CLOSE_EVENT) // Console window closed via 'x' button, Windows will try to close immediately, therefore... -- cgit v1.2.3 From 14826b660649c87c002b4ba23a255007f141dab4 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 15:44:19 -0700 Subject: main.cpp: field style fixes --- src/main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index d8b14cacc..3e91149af 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -11,9 +11,9 @@ #include #endif // _MSC_VER -// Here, we have some ALL CAPS variables, to give the impression that this is deeeep, gritty programming :P -bool cRoot::g_TERMINATE_EVENT_RAISED = false; // If something has told the server to stop; checked periodically in cRoot -static bool g_SERVER_TERMINATED = false; // Set to true when the server terminates, so our CTRL handler can then tell the OS to close the console + +bool cRoot::m_TerminateEventRaised = false; // If something has told the server to stop; checked periodically in cRoot +static bool g_ServerTerminated = false; // Set to true when the server terminates, so our CTRL handler can then tell the OS to close the console @@ -52,7 +52,7 @@ bool g_ShouldLogCommOut; void NonCtrlHandler(int a_Signal) { LOGD("Terminate event raised from std::signal"); - cRoot::g_TERMINATE_EVENT_RAISED = true; + cRoot::m_TerminateEventRaised = true; switch (a_Signal) { @@ -155,12 +155,12 @@ LONG WINAPI LastChanceExceptionFilter(__in struct _EXCEPTION_POINTERS * a_Except // Handle CTRL events in windows, including console window close BOOL CtrlHandler(DWORD fdwCtrlType) { - cRoot::g_TERMINATE_EVENT_RAISED = true; + cRoot::m_TerminateEventRaised = true; LOGD("Terminate event raised from the Windows CtrlHandler"); if (fdwCtrlType == CTRL_CLOSE_EVENT) // Console window closed via 'x' button, Windows will try to close immediately, therefore... { - while (!g_SERVER_TERMINATED) { cSleep::MilliSleep(100); } // Delay as much as possible to try to get the server to shut down cleanly + while (!g_ServerTerminated) { cSleep::MilliSleep(100); } // Delay as much as possible to try to get the server to shut down cleanly } return TRUE; @@ -296,7 +296,7 @@ int main( int argc, char **argv ) DeinitLeakFinder(); #endif - g_SERVER_TERMINATED = true; + g_ServerTerminated = true; return EXIT_SUCCESS; } -- cgit v1.2.3 From 93d29555e58df172bafba530afbc593c16ec66a3 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:19:48 +0200 Subject: Style: Normalized to no spaces before closing parenthesis. --- src/main.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3e91149af..93fa6af91 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -174,7 +174,7 @@ BOOL CtrlHandler(DWORD fdwCtrlType) //////////////////////////////////////////////////////////////////////////////// // main: -int main( int argc, char **argv ) +int main( int argc, char **argv) { UNUSED(argc); UNUSED(argv); @@ -218,7 +218,7 @@ int main( int argc, char **argv ) #endif #if defined(_DEBUG) && defined(_MSC_VER) - _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); + _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); // _X: The simple built-in CRT leak finder - simply break when allocating the Nth block ({N} is listed in the leak output) // Only useful when the leak is in the same sequence all the time @@ -281,11 +281,11 @@ int main( int argc, char **argv ) Root.Start(); } #if !defined(ANDROID_NDK) - catch( std::exception& e ) + catch( std::exception& e) { - LOGERROR("Standard exception: %s", e.what() ); + LOGERROR("Standard exception: %s", e.what()); } - catch( ... ) + catch( ...) { LOGERROR("Unknown exception!"); } -- cgit v1.2.3 From 9e7b9a4ebe815bd631d8b124e81f017fc7fa35a2 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Mon, 21 Jul 2014 15:21:54 +0200 Subject: Normalized spaces after "catch". --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 93fa6af91..106233342 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -281,11 +281,11 @@ int main( int argc, char **argv) Root.Start(); } #if !defined(ANDROID_NDK) - catch( std::exception& e) + catch (std::exception & e) { LOGERROR("Standard exception: %s", e.what()); } - catch( ...) + catch (...) { LOGERROR("Unknown exception!"); } -- cgit v1.2.3