diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp --- a/src/company_cmd.cpp +++ b/src/company_cmd.cpp @@ -1049,7 +1049,7 @@ CommandCost CmdSetCompanyColour(TileInde * @param name Name to search. * @return \c true if the name us unique (that is, not in use), else \c false. */ -static bool IsUniqueCompanyName(const char *name) +static bool IsUniqueCompanyName(const std::string &name) { for (const Company *c : Company::Iterate()) { if (!c->name.empty() && c->name == name) return false; @@ -1095,7 +1095,7 @@ CommandCost CmdRenameCompany(TileIndex t * @param name Name to search. * @return \c true if the name us unique (that is, not in use), else \c false. */ -static bool IsUniquePresidentName(const char *name) +static bool IsUniquePresidentName(const std::string &name) { for (const Company *c : Company::Iterate()) { if (!c->president_name.empty() && c->president_name == name) return false; diff --git a/src/depot_cmd.cpp b/src/depot_cmd.cpp --- a/src/depot_cmd.cpp +++ b/src/depot_cmd.cpp @@ -26,7 +26,7 @@ * @param name The name to check. * @return True if there is no depot with the given name. */ -static bool IsUniqueDepotName(const char *name) +static bool IsUniqueDepotName(const std::string &name) { for (const Depot *d : Depot::Iterate()) { if (!d->name.empty() && d->name == name) return false; diff --git a/src/engine.cpp b/src/engine.cpp --- a/src/engine.cpp +++ b/src/engine.cpp @@ -1061,7 +1061,7 @@ void EnginesMonthlyLoop() * @param name New name of an engine. * @return \c false if the name is being used already, else \c true. */ -static bool IsUniqueEngineName(const char *name) +static bool IsUniqueEngineName(const std::string &name) { for (const Engine *e : Engine::Iterate()) { if (!e->name.empty() && e->name == name) return false; diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -3915,7 +3915,7 @@ static uint UpdateStationWaiting(Station return amount; } -static bool IsUniqueStationName(const char *name) +static bool IsUniqueStationName(const std::string &name) { for (const Station *st : Station::Iterate()) { if (!st->name.empty() && st->name == name) return false; diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -1907,7 +1907,7 @@ static CommandCost TownCanBePlacedHere(T * @param name name to check * @return is this name unique? */ -static bool IsUniqueTownName(const char *name) +static bool IsUniqueTownName(const std::string &name) { for (const Town *t : Town::Iterate()) { if (!t->name.empty() && t->name == name) return false; diff --git a/src/vehicle_cmd.cpp b/src/vehicle_cmd.cpp --- a/src/vehicle_cmd.cpp +++ b/src/vehicle_cmd.cpp @@ -748,7 +748,7 @@ CommandCost CmdDepotMassAutoReplace(Tile * @param name Name to test. * @return True ifffffff the name is unique. */ -static bool IsUniqueVehicleName(const char *name) +static bool IsUniqueVehicleName(const std::string &name) { for (const Vehicle *v : Vehicle::Iterate()) { if (!v->name.empty() && v->name == name) return false; diff --git a/src/waypoint_cmd.cpp b/src/waypoint_cmd.cpp --- a/src/waypoint_cmd.cpp +++ b/src/waypoint_cmd.cpp @@ -395,7 +395,7 @@ CommandCost RemoveBuoy(TileIndex tile, D * @param name The name to check. * @return True iff the name is unique. */ -static bool IsUniqueWaypointName(const char *name) +static bool IsUniqueWaypointName(const std::string &name) { for (const Waypoint *wp : Waypoint::Iterate()) { if (!wp->name.empty() && wp->name == name) return false;