Merge pull request #3335 from mailwl/citra-sdl-small-fix

citra(SDL) small fixes: fix fall-through
This commit is contained in:
Yuri Kunde Schlesner 2018-01-01 21:00:10 -08:00 committed by GitHub
commit 337e9e12eb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -11,10 +11,8 @@
// This needs to be included before getopt.h because the latter #defines symbols used by it
#include "common/microprofile.h"
#ifdef _MSC_VER
#include <getopt.h>
#else
#include <getopt.h>
#ifndef _MSC_VER
#include <unistd.h>
#endif
@ -157,13 +155,14 @@ int main(int argc, char** argv) {
errno = EINVAL;
if (errno != 0)
exit(1);
break;
}
case 'm': {
use_multiplayer = true;
std::string str_arg(optarg);
const std::string str_arg(optarg);
// regex to check if the format is nickname:password@ip:port
// with optional :password
std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$");
const std::regex re("^([^:]+)(?::(.+))?@([^:]+)(?::([0-9]+))?$");
if (!std::regex_match(str_arg, re)) {
std::cout << "Wrong format for option --multiplayer\n";
PrintHelp(argv[0]);
@ -188,10 +187,6 @@ int main(int argc, char** argv) {
std::cout << "Address to room must not be empty.\n";
return 0;
}
if (port > 65535) {
std::cout << "Port must be between 0 and 65535.\n";
return 0;
}
break;
}
case 'h':