1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 20:49:11 +00:00

Codechange: internally use a span of arguments for GetOptData

This commit is contained in:
Rubidium
2024-04-10 22:21:56 +02:00
committed by rubidium42
parent 5592b4409b
commit afd7878de0
5 changed files with 25 additions and 34 deletions

View File

@@ -435,7 +435,7 @@ int CDECL main(int argc, char *argv[])
const char *before_file = nullptr;
const char *after_file = nullptr;
GetOptData mgo(argc - 1, argv + 1, _opts);
GetOptData mgo(std::span(argv + 1, argc - 1), _opts);
for (;;) {
int i = mgo.GetOpt();
if (i == -1) break;
@@ -472,7 +472,7 @@ int CDECL main(int argc, char *argv[])
_stored_output.Clear();
_post_amble_output.Clear();
for (int i = 0; i < mgo.numleft; i++) ProcessIniFile(mgo.argv[i]);
for (auto &argument : mgo.arguments) ProcessIniFile(argument);
/* Write output. */
if (output_file == nullptr) {