Skip to content

Commit ba91a0a

Browse files
committed
fix: conversion warning in mul_hi64()
1 parent cc9b4e1 commit ba91a0a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libutil/src/MulHi64.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ auto mul_hi64(
5252
{
5353
__extension__ using uint128_t = unsigned __int128;
5454

55-
return (static_cast<uint128_t>(first) * static_cast<uint128_t>(second)) >> UINT64_C(64);
55+
const uint128_t prod = static_cast<uint128_t>(first) * static_cast<uint128_t>(second);
56+
57+
return static_cast<uint64_t>(
58+
prod >> static_cast<uint128_t>(64));
5659
}
5760

5861
} // namespace util::math

0 commit comments

Comments
 (0)