From 224142a57e33142a02048c8ca508c162e2cf6be8 Mon Sep 17 00:00:00 2001
From: xperia64 <xperiancedapps@gmail.com>
Date: Fri, 15 Mar 2019 23:19:24 +0000
Subject: [PATCH] Fix getopt on systems where char is unsigned by default

---
 src/citra/citra.cpp               | 4 ++--
 src/dedicated_room/citra-room.cpp | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/citra/citra.cpp b/src/citra/citra.cpp
index 2fabfbfc7..6d422e4da 100644
--- a/src/citra/citra.cpp
+++ b/src/citra/citra.cpp
@@ -221,9 +221,9 @@ int main(int argc, char** argv) {
     };
 
     while (optind < argc) {
-        char arg = getopt_long(argc, argv, "g:i:m:r:p:fhv", long_options, &option_index);
+        int arg = getopt_long(argc, argv, "g:i:m:r:p:fhv", long_options, &option_index);
         if (arg != -1) {
-            switch (arg) {
+            switch (static_cast<char>(arg)) {
             case 'g':
                 errno = 0;
                 gdb_port = strtoul(optarg, &endarg, 0);
diff --git a/src/dedicated_room/citra-room.cpp b/src/dedicated_room/citra-room.cpp
index 8a8c2ae0f..5f776e12b 100644
--- a/src/dedicated_room/citra-room.cpp
+++ b/src/dedicated_room/citra-room.cpp
@@ -170,9 +170,9 @@ int main(int argc, char** argv) {
     };
 
     while (optind < argc) {
-        char arg = getopt_long(argc, argv, "n:d:p:m:w:g:u:t:a:i:hv", long_options, &option_index);
+        int arg = getopt_long(argc, argv, "n:d:p:m:w:g:u:t:a:i:hv", long_options, &option_index);
         if (arg != -1) {
-            switch (arg) {
+            switch (static_cast<char>(arg)) {
             case 'n':
                 room_name.assign(optarg);
                 break;