mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix mask error in operator<<= and operator>>=
Must specify 1 as a uint64_t to get the right masks.
This commit is contained in:
parent
7c22669a76
commit
765d5583c1
@ -246,7 +246,7 @@ QofInt128::operator<<= (uint i) noexcept
|
||||
m_lo = 0;
|
||||
return *this;
|
||||
}
|
||||
uint64_t carry {(m_lo & (((1 << i) - 1) << (legbits - i)))};
|
||||
uint64_t carry {(m_lo & (((UINT64_C(1) << i) - 1) << (legbits - i)))};
|
||||
m_lo <<= i;
|
||||
m_hi <<= i;
|
||||
m_hi += carry;
|
||||
@ -263,7 +263,7 @@ QofInt128::operator>>= (uint i) noexcept
|
||||
m_lo = 0;
|
||||
return *this;
|
||||
}
|
||||
uint64_t carry {(m_hi & ((1 << i) - 1))};
|
||||
uint64_t carry {(m_hi & ((UINT64_C(1) << i) - 1))};
|
||||
m_lo >>= i;
|
||||
m_hi >>= i;
|
||||
m_lo += (carry << (legbits - i));
|
||||
|
Loading…
Reference in New Issue
Block a user