diff options
Diffstat (limited to 'Source/Core/DolphinNoGUI/MainNoGUI.cpp')
| -rw-r--r-- | Source/Core/DolphinNoGUI/MainNoGUI.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/Source/Core/DolphinNoGUI/MainNoGUI.cpp b/Source/Core/DolphinNoGUI/MainNoGUI.cpp index 2d677aa7ba..81051adb78 100644 --- a/Source/Core/DolphinNoGUI/MainNoGUI.cpp +++ b/Source/Core/DolphinNoGUI/MainNoGUI.cpp @@ -4,10 +4,8 @@ #include "DolphinNoGUI/Platform.h" #include <OptionParser.h> -#include <cstddef> +#include <csignal> #include <cstdio> -#include <cstring> -#include <signal.h> #include <string> #include <vector> @@ -32,15 +30,13 @@ #endif #include "UICommon/UICommon.h" -#include "InputCommon/GCAdapter.h" - #include "VideoCommon/VideoBackendBase.h" static std::unique_ptr<Platform> s_platform; static void signal_handler(int) { - const char message[] = "A signal was received. A second signal will force Dolphin to stop.\n"; + constexpr char message[] = "A signal was received. A second signal will force Dolphin to stop.\n"; #ifdef _WIN32 puts(message); #else @@ -75,7 +71,7 @@ bool Host_UIBlocksControllerState() } static Common::Event s_update_main_frame_event; -void Host_Message(HostMessageID id) +void Host_Message(const HostMessageID id) { if (id == HostMessageID::WMUserStop) s_platform->Stop(); @@ -201,11 +197,12 @@ static std::unique_ptr<Platform> GetPlatform(const optparse::Values& options) #define main app_main #endif -int main(int argc, char* argv[]) +int main(const int argc, char* argv[]) { Core::DeclareAsHostThread(); - auto parser = CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions); + const auto parser = + CommandLineParse::CreateParser(CommandLineParse::ParserOptions::OmitGUIOptions); parser->add_option("-p", "--platform") .action("store") .help("Window platform to use [%choices]") @@ -301,14 +298,14 @@ int main(int argc, char* argv[]) return 1; } - Core::AddOnStateChangedCallback([](Core::State state) { + Core::AddOnStateChangedCallback([](const Core::State state) { if (state == Core::State::Uninitialized) s_platform->Stop(); }); #ifdef _WIN32 - signal(SIGINT, signal_handler); - signal(SIGTERM, signal_handler); + std::signal(SIGINT, signal_handler); + std::signal(SIGTERM, signal_handler); #else // Shut down cleanly on SIGINT and SIGTERM struct sigaction sa; |
