diff --git a/winlibs/include/opencc/DictEntry.hpp b/winlibs/include/opencc/DictEntry.hpp index ecef4891..0a840a68 100644 --- a/winlibs/include/opencc/DictEntry.hpp +++ b/winlibs/include/opencc/DictEntry.hpp @@ -140,11 +140,11 @@ public: size_t NumValues() const { return values.size(); } vector Values() const { - vector values; + vector retsult; for (const string& value : this->values) { - values.push_back(value.c_str()); + retsult.push_back(value.c_str()); } - return values; + return retsult; } private: diff --git a/winlibs/include/opencc/Exception.hpp b/winlibs/include/opencc/Exception.hpp index a1134e85..33cb5d9d 100644 --- a/winlibs/include/opencc/Exception.hpp +++ b/winlibs/include/opencc/Exception.hpp @@ -32,7 +32,7 @@ namespace opencc { -class OPENCC_EXPORT Exception : public std::exception { +class OPENCC_EXPORT Exception { public: Exception() {} diff --git a/winlibs/include/opencc/UTF8Util.hpp b/winlibs/include/opencc/UTF8Util.hpp index ea03dc01..70bbf83b 100644 --- a/winlibs/include/opencc/UTF8Util.hpp +++ b/winlibs/include/opencc/UTF8Util.hpp @@ -262,20 +262,22 @@ public: #ifdef _MSC_VER static std::string U16ToU8(const std::wstring& wstr) { std::string ret; - int convcnt = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), wstr.length(), NULL, 0, NULL, NULL); + int length = static_cast(wstr.length()); + int convcnt = WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), length, NULL, 0, NULL, NULL); if (convcnt > 0) { ret.resize(convcnt); - WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), wstr.length(), &ret[0], convcnt, NULL, NULL); + WideCharToMultiByte(CP_UTF8, 0, wstr.c_str(), length, &ret[0], convcnt, NULL, NULL); } return ret; } static std::wstring U8ToU16(const std::string& str) { std::wstring ret; - int convcnt = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), NULL, 0); + int length = static_cast(str.length()); + int convcnt = MultiByteToWideChar(CP_UTF8, 0, str.c_str(), length, NULL, 0); if (convcnt > 0) { ret.resize(convcnt); - MultiByteToWideChar(CP_UTF8, 0, str.c_str(), str.length(), &ret[0], convcnt); + MultiByteToWideChar(CP_UTF8, 0, str.c_str(), length, &ret[0], convcnt); } return ret; } diff --git a/winlibs/lib/libopencc.dll.a b/winlibs/lib/libopencc.dll.a index 9da2061a..04dc187f 100644 Binary files a/winlibs/lib/libopencc.dll.a and b/winlibs/lib/libopencc.dll.a differ diff --git a/winlibs/lib/opencc.dll b/winlibs/lib/opencc.dll index 1835d054..834a698f 100644 Binary files a/winlibs/lib/opencc.dll and b/winlibs/lib/opencc.dll differ