Fixed incorrect get_params function signature

This commit is contained in:
2026-09-08 00:25:49 +03:00
parent c4d3dcc16c
commit dcc85ab478
3 changed files with 5 additions and 6 deletions
+2 -3
View File
@@ -17,7 +17,6 @@ ProgramOptions get_params(int argc, char *argv[])
{0, 0, 0, 0 }
};
bool seed_found = false;
int option, option_index, seed = 0;
while (( option = getopt_long(argc, argv, "m:n:s:", long_options, &option_index)))
{
@@ -37,7 +36,7 @@ ProgramOptions get_params(int argc, char *argv[])
break;
case 's':
seed_found = true;
is_seed_specified = true;
seed = atoi(optarg);
break;
@@ -46,5 +45,5 @@ ProgramOptions get_params(int argc, char *argv[])
}
}
return {max_range, num_entries, seed_found ? std::optional<int>(seed): std::nullopt};
return {max_range, num_entries, is_seed_specified ? std::optional<int>(seed): std::nullopt};
}
+1 -1
View File
@@ -9,4 +9,4 @@ struct ProgramOptions
std::optional<int> seed;
};
ProgramOptions get_params();
ProgramOptions get_params(int argc, char *argv[]);
+1 -1
View File
@@ -4,6 +4,6 @@
int main(int argc, char *argv[])
{
auto parameters = get_params();
auto parameters = get_params(argc, argv);
return 0;
}