Don't use uint as an alias for unsigned int.

MinGW doesn't know about it, and errors out.
This commit is contained in:
John Ralls 2014-12-08 09:49:34 -08:00
parent c5d87ec3b6
commit 369befaae4

View File

@ -38,8 +38,8 @@ extern "C"
*/
namespace {
static const uint sublegs = GncInt128::numlegs * 2;
static const uint sublegbits = GncInt128::legbits / 2;
static const unsigned int sublegs = GncInt128::numlegs * 2;
static const unsigned int sublegbits = GncInt128::legbits / 2;
static const uint64_t sublegmask = (UINT64_C(1) << sublegbits) - 1;
}
@ -142,7 +142,7 @@ GncInt128::gcd(GncInt128 b) const noexcept
GncInt128 a (isNeg() ? -(*this) : *this);
if (b.isNeg()) b = -b;
uint k {};
unsigned int k {};
const uint64_t one {1};
while (!((a & one) || (b & one))) //B1
{
@ -174,7 +174,7 @@ GncInt128::lcm(const GncInt128& b) const noexcept
/* Knuth section 4.6.3 */
GncInt128
GncInt128::pow(uint b) const noexcept
GncInt128::pow(unsigned int b) const noexcept
{
if (isZero() || (m_lo == 1 && m_hi == 0) || isNan() || isOverflow())
return *this;
@ -230,10 +230,10 @@ GncInt128::abs() const noexcept
return *this;
}
uint
unsigned int
GncInt128::bits() const noexcept
{
uint bits {static_cast<uint>(m_hi == 0 ? 0 : 64)};
unsigned int bits {static_cast<unsigned int>(m_hi == 0 ? 0 : 64)};
uint64_t temp {(m_hi == 0 ? m_lo : m_hi)};
for (;temp > 0; temp >>= 1)
++bits;
@ -304,7 +304,7 @@ GncInt128::operator+= (const GncInt128& b) noexcept
}
GncInt128&
GncInt128::operator<<= (uint i) noexcept
GncInt128::operator<<= (unsigned int i) noexcept
{
if (i > maxbits)
{
@ -321,7 +321,7 @@ GncInt128::operator<<= (uint i) noexcept
}
GncInt128&
GncInt128::operator>>= (uint i) noexcept
GncInt128::operator>>= (unsigned int i) noexcept
{
if (i > maxbits)
{
@ -406,7 +406,7 @@ GncInt128::operator*= (const GncInt128& b) noexcept
return *this;
}
uint abits {bits()}, bbits {b.bits()};
unsigned int abits {bits()}, bbits {b.bits()};
if (abits + bbits > maxbits)
{
m_flags |= overflow;
@ -793,7 +793,7 @@ GncInt128::asCharBufR(char* buf) const noexcept
if (isNeg()) *(next++) = neg;
bool trailing {false};
for (uint i {dec_array_size}; i; --i)
for (unsigned int i {dec_array_size}; i; --i)
if (d[i - 1] || trailing)
{
if (trailing)
@ -907,14 +907,14 @@ operator^ (GncInt128 a, const GncInt128& b) noexcept
}
GncInt128
operator<< (GncInt128 a, uint b) noexcept
operator<< (GncInt128 a, unsigned int b) noexcept
{
a <<= b;
return a;
}
GncInt128
operator>> (GncInt128 a, uint b) noexcept
operator>> (GncInt128 a, unsigned int b) noexcept
{
a >>= b;
return a;