1
0
Fork 0

Cleanup: remove some unneeded c_str() calls

pull/9369/head
Rubidium 2021-06-14 23:17:58 +02:00 committed by rubidium42
parent 05005dcdfa
commit d31a535c87
4 changed files with 6 additions and 6 deletions

View File

@ -231,7 +231,7 @@ GameStrings *LoadTranslations()
basename.erase(e + 1); basename.erase(e + 1);
std::string filename = basename + "lang" PATHSEP "english.txt"; std::string filename = basename + "lang" PATHSEP "english.txt";
if (!FioCheckFileExists(filename.c_str() , GAME_DIR)) return nullptr; if (!FioCheckFileExists(filename, GAME_DIR)) return nullptr;
auto ls = ReadRawLanguageStrings(filename); auto ls = ReadRawLanguageStrings(filename);
if (!ls.IsValid()) return nullptr; if (!ls.IsValid()) return nullptr;

View File

@ -182,7 +182,7 @@ struct ScriptFileChecksumCreator : FileScanner {
byte tmp_md5sum[16]; byte tmp_md5sum[16];
/* Open the file ... */ /* Open the file ... */
FILE *f = FioFOpenFile(filename.c_str(), "rb", this->dir, &size); FILE *f = FioFOpenFile(filename, "rb", this->dir, &size);
if (f == nullptr) return false; if (f == nullptr) return false;
/* ... calculate md5sum... */ /* ... calculate md5sum... */

View File

@ -708,7 +708,7 @@ static void IniSaveSettingList(IniFile *ini, const char *grpname, StringList &li
group->Clear(); group->Clear();
for (const auto &iter : list) { for (const auto &iter : list) {
group->GetItem(iter.c_str(), true)->SetValue(""); group->GetItem(iter, true)->SetValue("");
} }
} }
@ -1272,7 +1272,7 @@ static void AILoadConfig(IniFile *ini, const char *grpname)
continue; continue;
} }
} }
if (item->value.has_value()) config->StringToSettings(item->value->c_str()); if (item->value.has_value()) config->StringToSettings(*item->value);
} }
} }
@ -1299,7 +1299,7 @@ static void GameLoadConfig(IniFile *ini, const char *grpname)
return; return;
} }
} }
if (item->value.has_value()) config->StringToSettings(item->value->c_str()); if (item->value.has_value()) config->StringToSettings(*item->value);
} }
/** /**

View File

@ -804,7 +804,7 @@ static void CloneVehicleName(const Vehicle *src, Vehicle *dst)
/* Check the name is unique. */ /* Check the name is unique. */
auto new_name = oss.str(); auto new_name = oss.str();
if (IsUniqueVehicleName(new_name.c_str())) { if (IsUniqueVehicleName(new_name)) {
dst->name = new_name; dst->name = new_name;
break; break;
} }