1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Use return {} instead of return ""

This commit is contained in:
Gymnasiast
2022-01-16 13:18:41 +01:00
parent 0aa256a26a
commit c69ef062ab
4 changed files with 11 additions and 11 deletions

View File

@@ -87,14 +87,14 @@ namespace Platform
std::string GetSteamPath()
{
return "";
return {};
}
# ifndef NO_TTF
std::string GetFontPath(const TTFFontDescriptor& font)
{
STUB();
return "";
return {};
}
# endif

View File

@@ -297,7 +297,7 @@ namespace Platform
const char* homeDir = getpwuid(getuid())->pw_dir;
if (homeDir == nullptr)
{
return "";
return {};
}
auto steamPath = Path::Combine(homeDir, ".local/share/Steam/ubuntu12_32/steamapps/content");
@@ -312,7 +312,7 @@ namespace Platform
return steamPath;
}
return "";
return {};
}
std::string GetFontPath(const TTFFontDescriptor& font)
@@ -323,7 +323,7 @@ namespace Platform
{
log_error("Failed to initialize FontConfig library");
FcFini();
return "";
return {};
}
FcPattern* pat = FcNameParse(reinterpret_cast<const FcChar8*>(font.font_name));

View File

@@ -831,13 +831,13 @@ namespace Platform
LRESULT result;
if (RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Valve\\Steam", &hKey) != ERROR_SUCCESS)
return "";
return {};
// Get the size of the path first
if (RegQueryValueExW(hKey, L"SteamPath", nullptr, &type, nullptr, &size) != ERROR_SUCCESS)
{
RegCloseKey(hKey);
return "";
return {};
}
std::string outPath = "";
@@ -866,7 +866,7 @@ namespace Platform
return Path::Combine(outPathTemp, font.filename);
}
return "";
return {};
# else
log_warning("Compatibility hack: falling back to C:\\Windows\\Fonts");
return Path::Combine("C:\\Windows\\Fonts\\", font.filename);

View File

@@ -239,7 +239,7 @@ namespace Platform
const char* homeDir = getpwuid(getuid())->pw_dir;
if (homeDir == nullptr)
{
return "";
return {};
}
auto steamPath = Path::Combine(
@@ -249,7 +249,7 @@ namespace Platform
return steamPath;
}
return "";
return {};
}
std::string GetFontPath(const TTFFontDescriptor& font)
@@ -266,7 +266,7 @@ namespace Platform
}
else
{
return "";
return {};
}
}
}