Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix msvc warnings #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/pcg_uint128.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ inline bitcount_t flog2(uint32_t v)
{
unsigned long i;
_BitScanReverse(&i, v);
return i;
return static_cast<bitcount_t>(i);
}

inline bitcount_t trailingzeros(uint32_t v)
{
unsigned long i;
_BitScanForward(&i, v);
return i;
return static_cast<bitcount_t>(i);
}

inline bitcount_t flog2(uint64_t v)
{
#if defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
unsigned long i;
_BitScanReverse64(&i, v);
return i;
return static_cast<bitcount_t>(i);
#else
// 32-bit x86
uint32_t high = v >> 32;
Expand All @@ -169,7 +169,7 @@ inline bitcount_t trailingzeros(uint64_t v)
#if defined(_M_X64) || defined(_M_ARM) || defined(_M_ARM64)
unsigned long i;
_BitScanForward64(&i, v);
return i;
return static_cast<bitcount_t>(i);
#else
// 32-bit x86
uint32_t high = v >> 32;
Expand Down