Review comments

This commit is contained in:
kalaposfos13 2025-01-18 11:11:41 +01:00
parent adaeb7ca6d
commit 0063fcbc03
5 changed files with 5 additions and 20 deletions

View File

@ -143,7 +143,7 @@ public:
void Relocate(Module* module);
bool Resolve(const std::string& name, Loader::SymbolType type, Module* module,
Loader::SymbolRecord* return_info);
void Execute(const std::vector<std::string> args = std::vector<std::string>());
void Execute(const std::vector<std::string> args = {});
void DebugDump();
private:

View File

@ -152,7 +152,7 @@ void Emulator::Run(const std::filesystem::path& file, const std::vector<std::str
psf_attributes.raw = *raw_attributes;
}
if (!args.empty()) {
int argc = args.size() > 32 ? 32 : args.size();
int argc = std::min<int>(args.size(), 32);
for (int i = 0; i < argc; i++) {
LOG_INFO(Loader, "Game argument {}: {}", i, args[i]);
}

View File

@ -26,7 +26,7 @@ public:
~Emulator();
void Run(const std::filesystem::path& file,
const std::vector<std::string> args = std::vector<std::string>());
const std::vector<std::string> args = {});
void UpdatePlayTime(const std::string& serial);
private:

View File

@ -139,18 +139,11 @@ int main(int argc, char* argv[]) {
game_args.push_back(argv[j]);
}
break;
} else if (std::string(argv[i + 1]) == "--") {
} else if (i + 1 < argc && std::string(argv[i + 1]) == "--") {
if (!has_game_argument) {
game_path = argv[i];
has_game_argument = true;
}
if (i + 2 == argc) {
std::cerr << "Warning: -- is set, but no game arguments are added!\n";
break;
}
for (int j = i + 2; j < argc; j++) {
game_args.push_back(argv[j]);
}
break;
} else {
std::cerr << "Unknown argument: " << cur_arg << ", see --help for info.\n";

View File

@ -144,19 +144,11 @@ int main(int argc, char* argv[]) {
game_args.push_back(argv[j]);
}
break;
} else if (std::string(argv[i + 1]) == "--") {
} else if (i + 1 < argc && std::string(argv[i + 1]) == "--") {
if (!has_game_argument) {
game_path = argv[i];
has_game_argument = true;
}
if (i + 2 == argc) {
std::cerr << "Warning: -- is set, but no game arguments are added!\n";
break;
}
for (int j = i + 2; j < argc; j++) {
game_args.push_back(argv[j]);
}
break;
} else {
std::cerr << "Unknown argument: " << cur_arg << ", see --help for info.\n";
return 1;