Skip to content

Commit

Permalink
fix compiler warnings about narrowing conversions
Browse files Browse the repository at this point in the history
Signed-off-by: Daniela Engert <dani@ngrt.de>
  • Loading branch information
DanielaE committed Jul 19, 2018
1 parent 5a93351 commit d889455
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/unique_path.cpp
Expand Up @@ -111,7 +111,7 @@ void system_crypt_random(void* buf, std::size_t len, boost::system::error_code*

if (!errval)
{
BOOL gen_ok = ::CryptGenRandom(handle, len, static_cast<unsigned char*>(buf));
BOOL gen_ok = ::CryptGenRandom(handle, static_cast<DWORD>(len), static_cast<unsigned char*>(buf));
if (!gen_ok)
errval = ::GetLastError();
::CryptReleaseContext(handle, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/windows_file_codecvt.cpp
Expand Up @@ -40,7 +40,7 @@

int count;
if ((count = ::MultiByteToWideChar(codepage, MB_PRECOMPOSED, from,
from_end - from, to, to_end - to)) == 0)
static_cast<int>(from_end - from), to, static_cast<int>(to_end - to))) == 0)
{
return error; // conversion failed
}
Expand All @@ -60,7 +60,7 @@

int count;
if ((count = ::WideCharToMultiByte(codepage, WC_NO_BEST_FIT_CHARS, from,
from_end - from, to, to_end - to, 0, 0)) == 0)
static_cast<int>(from_end - from), to, static_cast<int>(to_end - to), 0, 0)) == 0)
{
return error; // conversion failed
}
Expand Down

0 comments on commit d889455

Please sign in to comment.