summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/company_cmd.cpp4
-rw-r--r--src/depot_cmd.cpp2
-rw-r--r--src/engine.cpp2
-rw-r--r--src/station_cmd.cpp2
-rw-r--r--src/town_cmd.cpp2
-rw-r--r--src/vehicle_cmd.cpp2
-rw-r--r--src/waypoint_cmd.cpp2
7 files changed, 8 insertions, 8 deletions
diff --git a/src/company_cmd.cpp b/src/company_cmd.cpp
index 85809544d..5a2b9ba1d 100644
--- a/src/company_cmd.cpp
+++ b/src/company_cmd.cpp
@@ -1049,7 +1049,7 @@ CommandCost CmdSetCompanyColour(TileIndex tile, DoCommandFlag flags, uint32 p1,
* @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 tile, DoCommandFlag flags, uint32 p1, uin
* @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
index 9379afb82..729678072 100644
--- 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
index 41cd9dba8..e60cd7f4d 100644
--- 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
index d9529da11..887c347d4 100644
--- a/src/station_cmd.cpp
+++ b/src/station_cmd.cpp
@@ -3915,7 +3915,7 @@ static uint UpdateStationWaiting(Station *st, CargoID type, uint amount, SourceT
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
index 177b507e4..f70776c57 100644
--- a/src/town_cmd.cpp
+++ b/src/town_cmd.cpp
@@ -1907,7 +1907,7 @@ static CommandCost TownCanBePlacedHere(TileIndex tile)
* @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
index 9da6b89ce..f55e66ace 100644
--- a/src/vehicle_cmd.cpp
+++ b/src/vehicle_cmd.cpp
@@ -748,7 +748,7 @@ CommandCost CmdDepotMassAutoReplace(TileIndex tile, DoCommandFlag flags, uint32
* @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
index e8e9e6945..b41e80f97 100644
--- a/src/waypoint_cmd.cpp
+++ b/src/waypoint_cmd.cpp
@@ -395,7 +395,7 @@ CommandCost RemoveBuoy(TileIndex tile, DoCommandFlag flags)
* @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;