diff --git a/driver/main.cpp b/driver/main.cpp index b444a94..03f9a0b 100644 --- a/driver/main.cpp +++ b/driver/main.cpp @@ -93,8 +93,10 @@ int main(int argc, char* argv[]) if (NOD::Stat(argv[6], &theStat) || !S_ISREG(theStat.st_mode)) NOD::LogModule.report(LogVisor::FatalError, "unable to stat %s as file", argv[6]); - NOD::SystemUTF8View gameId(argv[2]); - NOD::SystemUTF8View gameTitle(argv[3]); + NOD::SystemString gameIdSys(argv[2]); + NOD::SystemUTF8View gameId(gameIdSys); + NOD::SystemString gameTitleSys(argv[3]); + NOD::SystemUTF8View gameTitle(gameTitleSys); size_t lastIdx = -1; auto progFunc = [&](size_t idx, const NOD::SystemString& name, size_t bytes) { @@ -150,8 +152,10 @@ int main(int argc, char* argv[]) if (NOD::Stat(argv[7], &theStat) || !S_ISREG(theStat.st_mode)) NOD::LogModule.report(LogVisor::FatalError, _S("unable to stat %s as file"), argv[7]); - NOD::SystemUTF8View gameId(argv[2]); - NOD::SystemUTF8View gameTitle(argv[3]); + NOD::SystemString gameIdSys(argv[2]); + NOD::SystemUTF8View gameId(gameIdSys); + NOD::SystemString gameTitleSys(argv[3]); + NOD::SystemUTF8View gameTitle(gameTitleSys); size_t lastIdx = -1; auto progFunc = [&](size_t idx, const NOD::SystemString& name, size_t bytes) { diff --git a/include/NOD/Util.hpp b/include/NOD/Util.hpp index e6329d1..24c459f 100644 --- a/include/NOD/Util.hpp +++ b/include/NOD/Util.hpp @@ -83,7 +83,7 @@ class SystemUTF8View { std::string m_utf8; public: - SystemUTF8View(const SystemString& str) + explicit SystemUTF8View(const SystemString& str) { int len = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), str.size(), nullptr, 0, nullptr, nullptr); m_utf8.assign(len, '\0'); @@ -95,7 +95,7 @@ class SystemStringView { std::wstring m_sys; public: - SystemStringView(const std::string& str) + explicit SystemStringView(const std::string& str) { int len = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.size(), nullptr, 0); m_sys.assign(len, L'\0'); @@ -118,7 +118,7 @@ class SystemUTF8View { const std::string& m_utf8; public: - SystemUTF8View(const SystemString& str) + explicit SystemUTF8View(const SystemString& str) : m_utf8(str) {} inline const std::string& utf8_str() {return m_utf8;} }; @@ -126,7 +126,7 @@ class SystemStringView { const std::string& m_sys; public: - SystemStringView(const std::string& str) + explicit SystemStringView(const std::string& str) : m_sys(str) {} inline const std::string& sys_str() {return m_sys;} }; diff --git a/lib/FileIOFILE.cpp b/lib/FileIOFILE.cpp index 87c0400..77f56cd 100644 --- a/lib/FileIOFILE.cpp +++ b/lib/FileIOFILE.cpp @@ -30,7 +30,7 @@ public: if (!fp) return 0; FSeek(fp, 0, SEEK_END); - uint64_t result = ftello(fp); + uint64_t result = FTell(fp); fclose(fp); return result; }