Skip to content

Commit

Permalink
fix warning C4244 in util.h (#7171)
Browse files Browse the repository at this point in the history
Add a static cast to avoid warning C4244 on MSVC
  • Loading branch information
XiangYyang authored Mar 20, 2024
1 parent 1a74371 commit a9054bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static inline unsigned get_num_1bits(uint64_t v) {
v = (v + (v >> 4)) & 0x0F0F0F0F0F0F0F0F;
uint64_t r = (v * 0x0101010101010101) >> 56;
SASSERT(c == r);
return r;
return static_cast<unsigned>(r);
#endif
}

Expand Down

0 comments on commit a9054bc

Please sign in to comment.