fix utf8 build error

This commit is contained in:
Arvid Norberg 2013-11-28 08:41:35 +00:00
parent f0631e91ae
commit fb555cb558
2 changed files with 11 additions and 8 deletions

View File

@ -44,10 +44,13 @@ POSSIBILITY OF SUCH DAMAGE.
namespace libtorrent
{
// results from UTF-8 conversion functions utf8_wchar and
// wchar_utf8
enum utf8_conv_result_t
{
// conversion successful
conversion_oK,
conversion_ok,
// partial character in source, but hit end
source_exhausted,

View File

@ -53,7 +53,7 @@ namespace libtorrent
+ utf8.size(), (UTF32**)&dst_start, (UTF32*)dst_start + wide.size()
, lenientConversion);
wide.resize(dst_start - wide.c_str());
return ret;
return (utf8_conv_result_t)ret;
}
else if (sizeof(wchar_t) == sizeof(UTF16))
{
@ -61,11 +61,11 @@ namespace libtorrent
+ utf8.size(), (UTF16**)&dst_start, (UTF16*)dst_start + wide.size()
, lenientConversion);
wide.resize(dst_start - wide.c_str());
return ret;
return (utf8_conv_result_t)ret;
}
else
{
return sourceIllegal;
return source_illegal;
}
}
@ -73,7 +73,7 @@ namespace libtorrent
{
// allocate space for worst-case
utf8.resize(wide.size() * 6);
if (wide.empty()) return 0;
if (wide.empty()) return conversion_ok;
char* dst_start = &utf8[0];
wchar_t const* src_start = wide.c_str();
ConversionResult ret;
@ -83,7 +83,7 @@ namespace libtorrent
+ wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size()
, lenientConversion);
utf8.resize(dst_start - &utf8[0]);
return ret;
return (utf8_conv_result_t)ret;
}
else if (sizeof(wchar_t) == sizeof(UTF16))
{
@ -91,11 +91,11 @@ namespace libtorrent
+ wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size()
, lenientConversion);
utf8.resize(dst_start - &utf8[0]);
return ret;
return (utf8_conv_result_t)ret;
}
else
{
return sourceIllegal;
return source_illegal;
}
}
}