diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/file_util.cpp | 2 | ||||
-rw-r--r-- | src/common/file_util.h | 2 | ||||
-rw-r--r-- | src/common/string_util.cpp | 12 | ||||
-rw-r--r-- | src/common/string_util.h | 3 |
4 files changed, 2 insertions, 17 deletions
diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index bf955386c..c882ab39f 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -592,7 +592,7 @@ std::string GetBundleDirectory() { #endif #ifdef _WIN32 -std::string& GetExeDirectory() { +const std::string& GetExeDirectory() { static std::string exe_path; if (exe_path.empty()) { wchar_t wchar_exe_path[2048]; diff --git a/src/common/file_util.h b/src/common/file_util.h index 026c84d94..1f38b1560 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -133,7 +133,7 @@ std::string GetBundleDirectory(); #endif #ifdef _WIN32 -std::string& GetExeDirectory(); +const std::string& GetExeDirectory(); std::string AppDataRoamingDirectory(); #endif diff --git a/src/common/string_util.cpp b/src/common/string_util.cpp index 0027888c7..f3ad3d68a 100644 --- a/src/common/string_util.cpp +++ b/src/common/string_util.cpp @@ -34,18 +34,6 @@ std::string ToUpper(std::string str) { return str; } -// faster than sscanf -bool AsciiToHex(const char* _szValue, u32& result) { - char* endptr = nullptr; - const u32 value = strtoul(_szValue, &endptr, 16); - - if (!endptr || *endptr) - return false; - - result = value; - return true; -} - // For Debugging. Read out an u8 array. std::string ArrayToString(const u8* data, size_t size, int line_len, bool spaces) { std::ostringstream oss; diff --git a/src/common/string_util.h b/src/common/string_util.h index 1f5a383cb..daa071f83 100644 --- a/src/common/string_util.h +++ b/src/common/string_util.h @@ -57,9 +57,6 @@ static bool TryParse(const std::string& str, N* const output) { return false; } -// TODO: kill this -bool AsciiToHex(const char* _szValue, u32& result); - std::string TabsToSpaces(int tab_size, const std::string& in); void SplitString(const std::string& str, char delim, std::vector<std::string>& output); |