mirror of https://github.com/OpenTTD/OpenTTD.git
Codechange: Remove some unnecessary c_str() when passing std::strings. (#12532)
Functions have been updated from `char *` to `std::string` since without removing `c_str()`.
This commit is contained in:
parent
45886e50b2
commit
d57bf84196
|
@ -707,7 +707,7 @@ FiosNumberedSaveName::FiosNumberedSaveName(const std::string &prefix) : prefix(p
|
||||||
/* Get the save list. */
|
/* Get the save list. */
|
||||||
FileList list;
|
FileList list;
|
||||||
FiosFileScanner scanner(SLO_SAVE, proc, list);
|
FiosFileScanner scanner(SLO_SAVE, proc, list);
|
||||||
scanner.Scan(".sav", _autosave_path->c_str(), false);
|
scanner.Scan(".sav", *_autosave_path, false);
|
||||||
|
|
||||||
/* Find the number for the most recent save, if any. */
|
/* Find the number for the most recent save, if any. */
|
||||||
if (list.begin() != list.end()) {
|
if (list.begin() != list.end()) {
|
||||||
|
|
|
@ -180,7 +180,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Scan.
|
* Scan.
|
||||||
*/
|
*/
|
||||||
void Scan(const char *directory)
|
void Scan(const std::string &directory)
|
||||||
{
|
{
|
||||||
this->FileScanner::Scan(".txt", directory, false);
|
this->FileScanner::Scan(".txt", directory, false);
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ GameStrings *LoadTranslations()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Scan filesystem */
|
/* Scan filesystem */
|
||||||
scanner.Scan(ldir.c_str());
|
scanner.Scan(ldir);
|
||||||
}
|
}
|
||||||
|
|
||||||
gs->Compile();
|
gs->Compile();
|
||||||
|
|
|
@ -63,7 +63,7 @@ public:
|
||||||
std::string extension = "-social.so";
|
std::string extension = "-social.so";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
this->FileScanner::Scan(extension.c_str(), SOCIAL_INTEGRATION_DIR, false);
|
this->FileScanner::Scan(extension, SOCIAL_INTEGRATION_DIR, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AddFile(const std::string &filename, size_t basepath_length, const std::string &) override
|
bool AddFile(const std::string &filename, size_t basepath_length, const std::string &) override
|
||||||
|
|
Loading…
Reference in New Issue