summaryrefslogtreecommitdiff
path: root/src/citra/citra.cpp
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2016-09-21 11:29:48 -0700
committerGravatar GitHub2016-09-21 11:29:48 -0700
commitd5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a (patch)
tree8a22ca73ff838f3f0090b29a548ae81087fc90ed /src/citra/citra.cpp
parentREADME: Specify master branch for Travis CI badge (diff)
parentFix Travis clang-format check (diff)
downloadyuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.gz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.tar.xz
yuzu-d5d2ca8058a0f1c00ab7ca9fe2c058ba47546c0a.zip
Merge pull request #2086 from linkmauve/clang-format
Add clang-format as part of our {commit,travis}-time checks
Diffstat (limited to 'src/citra/citra.cpp')
-rw-r--r--src/citra/citra.cpp44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 128b9a16d..e47375f88 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -2,10 +2,10 @@
2// Licensed under GPLv2 or any later version 2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included. 3// Refer to the license.txt file included.
4 4
5#include <string>
6#include <thread>
7#include <iostream> 5#include <iostream>
8#include <memory> 6#include <memory>
7#include <string>
8#include <thread>
9 9
10// This needs to be included before getopt.h because the latter #defines symbols used by it 10// This needs to be included before getopt.h because the latter #defines symbols used by it
11#include "common/microprofile.h" 11#include "common/microprofile.h"
@@ -13,53 +13,48 @@
13#ifdef _MSC_VER 13#ifdef _MSC_VER
14#include <getopt.h> 14#include <getopt.h>
15#else 15#else
16#include <unistd.h>
17#include <getopt.h> 16#include <getopt.h>
17#include <unistd.h>
18#endif 18#endif
19 19
20#ifdef _WIN32 20#ifdef _WIN32
21#include <Windows.h> 21#include <Windows.h>
22#endif 22#endif
23 23
24#include "common/logging/log.h" 24#include "citra/config.h"
25#include "citra/emu_window/emu_window_sdl2.h"
25#include "common/logging/backend.h" 26#include "common/logging/backend.h"
26#include "common/logging/filter.h" 27#include "common/logging/filter.h"
28#include "common/logging/log.h"
27#include "common/scm_rev.h" 29#include "common/scm_rev.h"
28#include "common/scope_exit.h" 30#include "common/scope_exit.h"
29#include "common/string_util.h" 31#include "common/string_util.h"
30
31#include "core/settings.h"
32#include "core/system.h"
33#include "core/core.h" 32#include "core/core.h"
34#include "core/gdbstub/gdbstub.h" 33#include "core/gdbstub/gdbstub.h"
35#include "core/loader/loader.h" 34#include "core/loader/loader.h"
36 35#include "core/settings.h"
37#include "citra/config.h" 36#include "core/system.h"
38#include "citra/emu_window/emu_window_sdl2.h"
39
40#include "video_core/video_core.h" 37#include "video_core/video_core.h"
41 38
42 39static void PrintHelp(const char* argv0) {
43static void PrintHelp(const char *argv0) 40 std::cout << "Usage: " << argv0
44{ 41 << " [options] <filename>\n"
45 std::cout << "Usage: " << argv0 << " [options] <filename>\n"
46 "-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n" 42 "-g, --gdbport=NUMBER Enable gdb stub on port NUMBER\n"
47 "-h, --help Display this help and exit\n" 43 "-h, --help Display this help and exit\n"
48 "-v, --version Output version information and exit\n"; 44 "-v, --version Output version information and exit\n";
49} 45}
50 46
51static void PrintVersion() 47static void PrintVersion() {
52{
53 std::cout << "Citra " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl; 48 std::cout << "Citra " << Common::g_scm_branch << " " << Common::g_scm_desc << std::endl;
54} 49}
55 50
56/// Application entry point 51/// Application entry point
57int main(int argc, char **argv) { 52int main(int argc, char** argv) {
58 Config config; 53 Config config;
59 int option_index = 0; 54 int option_index = 0;
60 bool use_gdbstub = Settings::values.use_gdbstub; 55 bool use_gdbstub = Settings::values.use_gdbstub;
61 u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port); 56 u32 gdb_port = static_cast<u32>(Settings::values.gdbstub_port);
62 char *endarg; 57 char* endarg;
63#ifdef _WIN32 58#ifdef _WIN32
64 int argc_w; 59 int argc_w;
65 auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w); 60 auto argv_w = CommandLineToArgvW(GetCommandLineW(), &argc_w);
@@ -72,10 +67,10 @@ int main(int argc, char **argv) {
72 std::string boot_filename; 67 std::string boot_filename;
73 68
74 static struct option long_options[] = { 69 static struct option long_options[] = {
75 { "gdbport", required_argument, 0, 'g' }, 70 {"gdbport", required_argument, 0, 'g'},
76 { "help", no_argument, 0, 'h' }, 71 {"help", no_argument, 0, 'h'},
77 { "version", no_argument, 0, 'v' }, 72 {"version", no_argument, 0, 'v'},
78 { 0, 0, 0, 0 } 73 {0, 0, 0, 0},
79 }; 74 };
80 75
81 while (optind < argc) { 76 while (optind < argc) {
@@ -86,7 +81,8 @@ int main(int argc, char **argv) {
86 errno = 0; 81 errno = 0;
87 gdb_port = strtoul(optarg, &endarg, 0); 82 gdb_port = strtoul(optarg, &endarg, 0);
88 use_gdbstub = true; 83 use_gdbstub = true;
89 if (endarg == optarg) errno = EINVAL; 84 if (endarg == optarg)
85 errno = EINVAL;
90 if (errno != 0) { 86 if (errno != 0) {
91 perror("--gdbport"); 87 perror("--gdbport");
92 exit(1); 88 exit(1);