Codechange: replace some more char*s with std::string_view
This commit is contained in:
@@ -271,9 +271,9 @@ static void WriteSavegameInfo(const std::string &name)
|
||||
* @param res variable to store the resolution in.
|
||||
* @param s the string to decompose.
|
||||
*/
|
||||
static void ParseResolution(Dimension *res, const char *s)
|
||||
static void ParseResolution(Dimension &res, std::string_view s)
|
||||
{
|
||||
StringConsumer consumer(std::string_view{s});
|
||||
StringConsumer consumer(s);
|
||||
auto width = consumer.TryReadIntegerBase<uint>(10);
|
||||
auto valid = consumer.ReadIf("x");
|
||||
auto height = consumer.TryReadIntegerBase<uint>(10);
|
||||
@@ -282,8 +282,8 @@ static void ParseResolution(Dimension *res, const char *s)
|
||||
return;
|
||||
}
|
||||
|
||||
res->width = std::max<uint>(*width, 64);
|
||||
res->height = std::max<uint>(*height, 64);
|
||||
res.width = std::max<uint>(*width, 64);
|
||||
res.height = std::max<uint>(*height, 64);
|
||||
}
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ int openttd_main(std::span<char * const> arguments)
|
||||
case 'p':
|
||||
scanner->join_server_password = mgo.opt;
|
||||
break;
|
||||
case 'r': ParseResolution(&resolution, mgo.opt); break;
|
||||
case 'r': ParseResolution(resolution, mgo.opt); break;
|
||||
case 't':
|
||||
if (auto value = ParseInteger(mgo.opt); value.has_value()) {
|
||||
scanner->startyear = TimerGameCalendar::Year(*value);
|
||||
|
||||
Reference in New Issue
Block a user