Skip to content

Commit

Permalink
Fix 'possible loss of data' warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jp9000 committed Sep 14, 2014
1 parent 8a1d7b8 commit ea4a518
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions OBSApi/Utility/utf8-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@

size_t utf8_to_wchar(const char *in, size_t insize, wchar_t *out, size_t outsize, int flags)
{
return (size_t)MultiByteToWideChar(CP_UTF8, 0, in, insize, out, outsize);
return (size_t)MultiByteToWideChar(CP_UTF8, 0, in, (int)insize, out, (int)outsize);
}

size_t wchar_to_utf8(const wchar_t *in, size_t insize, char *out, size_t outsize, int flags)
{
return (size_t)WideCharToMultiByte(CP_UTF8, 0, in, insize, out, outsize, NULL, NULL);
return (size_t)WideCharToMultiByte(CP_UTF8, 0, in, (int)insize, out, (int)outsize, NULL, NULL);
}

size_t utf8_to_wchar_len(const char *in, size_t insize, int flags)
{
return (size_t)MultiByteToWideChar(CP_UTF8, 0, in, insize, NULL, 0);
return (size_t)MultiByteToWideChar(CP_UTF8, 0, in, (int)insize, NULL, 0);
}

size_t wchar_to_utf8_len(const wchar_t *in, size_t insize, int flags)
{
return (size_t)WideCharToMultiByte(CP_UTF8, 0, in, insize, NULL, 0, NULL, NULL);
return (size_t)WideCharToMultiByte(CP_UTF8, 0, in, (int)insize, NULL, 0, NULL, NULL);
}

0 comments on commit ea4a518

Please sign in to comment.