Use return {} instead of return ""

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

No files matched your search

+2 -2
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
+3 -3
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));
+3 -3
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);
+3 -3
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 {};
}
}
}