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

John Ralls jralls at code.gnucash.org
Mon Dec 8 12:50:24 EST 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/369befaa (commit)
	from  https://github.com/Gnucash/gnucash/commit/c5d87ec3 (commit)



commit 369befaae402d05a32446b0a44f2c24735666a8c
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Dec 8 09:49:34 2014 -0800

    Don't use uint as an alias for unsigned int.
    
    MinGW doesn't know about it, and errors out.

diff --git a/src/libqof/qof/gnc-int128.cpp b/src/libqof/qof/gnc-int128.cpp
index 0bcdc5f..3bb3112 100644
--- a/src/libqof/qof/gnc-int128.cpp
+++ b/src/libqof/qof/gnc-int128.cpp
@@ -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;



Summary of changes:
 src/libqof/qof/gnc-int128.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)



More information about the gnucash-changes mailing list