mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 14:01:17 +12:00
Code clean up + replace some wstring instances with utf8 (#640)
This commit is contained in:
parent
ca79a6aa0d
commit
f3ff919be2
41 changed files with 163 additions and 641 deletions
|
@ -344,10 +344,9 @@ public:
|
|||
if (L == nullptr)
|
||||
return false;
|
||||
FileStream* fs = FileStream::openFile(filename.c_str());
|
||||
|
||||
if (fs == nullptr)
|
||||
if (!fs)
|
||||
{
|
||||
forceLogDebug_printfW(L"XMLConfig::Load > failed \"%s\" with error %d", filename.c_str(), errno);
|
||||
cemuLog_logDebug(LogType::Force, "XMLConfig::Load > failed \"{}\" with error {}", boost::nowide::narrow(filename), errno);
|
||||
return false;
|
||||
}
|
||||
std::vector<uint8> xmlData;
|
||||
|
@ -360,7 +359,7 @@ public:
|
|||
const bool success = error == tinyxml2::XML_SUCCESS;
|
||||
if (error != 0)
|
||||
{
|
||||
forceLogDebug_printf("XMLConfig::Load > LoadFile %d", error);
|
||||
cemuLog_logDebug(LogType::Force, "XMLConfig::Load > LoadFile {}", error);
|
||||
}
|
||||
if (success)
|
||||
{
|
||||
|
@ -401,9 +400,9 @@ public:
|
|||
#else
|
||||
file = fopen(boost::nowide::narrow(tmp_name).c_str(), "wb");
|
||||
#endif
|
||||
if (file == nullptr)
|
||||
if (!file)
|
||||
{
|
||||
forceLogDebug_printfW(L"XMLConfig::Save > failed \"%s\" with error %d", filename.c_str(), errno);
|
||||
cemuLog_logDebug(LogType::Force, "XMLConfig::Save > failed \"{}\" with error {}", boost::nowide::narrow(filename), errno);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -417,7 +416,7 @@ public:
|
|||
const tinyxml2::XMLError error = doc.SaveFile(file);
|
||||
const bool success = error == tinyxml2::XML_SUCCESS;
|
||||
if(error != 0)
|
||||
forceLogDebug_printfW(L"XMLConfig::Save > SaveFile %d", error);
|
||||
cemuLog_logDebug(LogType::Force, "XMLConfig::Save > SaveFile {}", error);
|
||||
|
||||
fflush(file);
|
||||
fclose(file);
|
||||
|
@ -425,7 +424,7 @@ public:
|
|||
fs::rename(tmp_name, filename, err);
|
||||
if(err)
|
||||
{
|
||||
forceLog_printf("can't save settings to file: %s", err.message().c_str());
|
||||
cemuLog_log(LogType::Force, "Unable to save settings to file: {}", err.message().c_str());
|
||||
fs::remove(tmp_name, err);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue