gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Dec 8 17:10:20 EST 2014


Updated	 via  https://github.com/Gnucash/gnucash/commit/6a546f72 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/517e853e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/70ccc6c6 (commit)
	from  https://github.com/Gnucash/gnucash/commit/0b1842ce (commit)



commit 6a546f727b0e6ec091fdc5a759d44f15e6553321
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Dec 8 13:10:56 2014 -0800

    Ubuntu 14.04's C++ already defines these, so guard them.

diff --git a/src/libqof/qof/gnc-int128.hpp b/src/libqof/qof/gnc-int128.hpp
index da7f2b4..47cf69a 100644
--- a/src/libqof/qof/gnc-int128.hpp
+++ b/src/libqof/qof/gnc-int128.hpp
@@ -27,9 +27,11 @@
 
 extern "C"
 {
+#ifndef __STDC_LIMIT_MACROS
 #define  __STDC_LIMIT_MACROS 1
 #define  __STDC_CONSTANT_MACROS 1
 #define  __STDC_FORMAT_MACROS 1
+#endif
 #include <inttypes.h>
 }
 

commit 517e853eb68caff6389e82d60e991aac99d30062
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Dec 8 13:10:10 2014 -0800

    MinGW needs cstdio included to find sprintf.

diff --git a/src/libqof/qof/gnc-int128.cpp b/src/libqof/qof/gnc-int128.cpp
index 3bb3112..4120dc3 100644
--- a/src/libqof/qof/gnc-int128.cpp
+++ b/src/libqof/qof/gnc-int128.cpp
@@ -31,6 +31,7 @@ extern "C"
 #include <iomanip>
 #include <utility>
 #include <cassert>
+#include <cstdio>
 
 /* All algorithms from Donald E. Knuth, "The Art of Computer
  * Programming, Volume 2: Seminumerical Algorithms", 3rd Ed.,

commit 70ccc6c6902163bf4ea19eb7427c8edf2e826d77
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Dec 8 13:09:32 2014 -0800

    More uint fixes.

diff --git a/src/libqof/qof/gnc-int128.hpp b/src/libqof/qof/gnc-int128.hpp
index 0cfab84..da7f2b4 100644
--- a/src/libqof/qof/gnc-int128.hpp
+++ b/src/libqof/qof/gnc-int128.hpp
@@ -57,9 +57,9 @@ class GncInt128
     uint64_t m_lo;
 
 public:
-static const uint numlegs = 2;
-static const uint legbits = 64;
-static const uint maxbits = legbits * numlegs;
+static const unsigned int numlegs = 2;
+static const unsigned int legbits = 64;
+static const unsigned int maxbits = legbits * numlegs;
 
 enum // Values for m_flags
 {
@@ -135,7 +135,7 @@ enum // Values for m_flags
  * value greater than 128 would overflow on any value other than 1.
  * @return A GncInt128
  */
-    GncInt128 pow (uint n) const noexcept;
+    GncInt128 pow (unsigned int n) const noexcept;
 
 /**
  * Computes a quotient and a remainder, passed as reference parameters.
@@ -190,7 +190,7 @@ enum // Values for m_flags
 /**
  * @return the number of bits used to represent the value
  */
-    uint bits() const noexcept;
+    unsigned int bits() const noexcept;
 
 /**
  * Fills a supplied buffer with a representation of the number in base 10. If
@@ -211,8 +211,8 @@ enum // Values for m_flags
     GncInt128& operator++ (int) noexcept;
     GncInt128& operator-- () noexcept;
     GncInt128& operator-- (int) noexcept;
-    GncInt128& operator<<= (uint i) noexcept;
-    GncInt128& operator>>= (uint i) noexcept;
+    GncInt128& operator<<= (unsigned int i) noexcept;
+    GncInt128& operator>>= (unsigned int i) noexcept;
     GncInt128& operator+= (const GncInt128& b) noexcept;
     GncInt128& operator-= (const GncInt128& b) noexcept;
     GncInt128& operator*= (const GncInt128& b) noexcept;
@@ -235,8 +235,8 @@ GncInt128 operator% (GncInt128 a, const GncInt128& b) noexcept;
 GncInt128 operator& (GncInt128 a, const GncInt128& b) noexcept;
 GncInt128 operator| (GncInt128 a, const GncInt128& b) noexcept;
 GncInt128 operator^ (GncInt128 a, const GncInt128& b) noexcept;
-GncInt128 operator<< (GncInt128 a, uint b) noexcept;
-GncInt128 operator>> (GncInt128 a, uint b) noexcept;
+GncInt128 operator<< (GncInt128 a, unsigned int b) noexcept;
+GncInt128 operator>> (GncInt128 a, unsigned int b) noexcept;
 
 bool operator== (const GncInt128& a, const GncInt128& b) noexcept;
 bool operator!= (const GncInt128& a, const GncInt128& b) noexcept;
diff --git a/src/libqof/qof/gnc-rational.cpp b/src/libqof/qof/gnc-rational.cpp
index 30e5cf4..28a343f 100644
--- a/src/libqof/qof/gnc-rational.cpp
+++ b/src/libqof/qof/gnc-rational.cpp
@@ -272,7 +272,7 @@ GncRational::round (GncDenom& denom) noexcept
 }
 
 GncDenom::GncDenom (GncRational& a, GncRational& b,
-                    int64_t spec, uint how) noexcept :
+                    int64_t spec, unsigned int how) noexcept :
     m_value (spec),
     m_round (static_cast<GncDenom::RoundType>(how & GNC_NUMERIC_RND_MASK)),
     m_type (static_cast<GncDenom::DenomType>(how & GNC_NUMERIC_DENOM_MASK)),
@@ -337,7 +337,7 @@ GncDenom::reduce (const GncRational& a) noexcept
             val = a.m_num.abs() / a.m_den;
         else
             val = a.m_den / a.m_num.abs();
-        uint digits {};
+        unsigned int digits {};
         while (val >= 10)
         {
             ++digits;
diff --git a/src/libqof/qof/gnc-rational.hpp b/src/libqof/qof/gnc-rational.hpp
index 0457c21..a7db8e4 100644
--- a/src/libqof/qof/gnc-rational.hpp
+++ b/src/libqof/qof/gnc-rational.hpp
@@ -53,7 +53,7 @@ public:
 
 struct GncDenom
 {
-    GncDenom (GncRational& a, GncRational& b, int64_t spec, uint how) noexcept;
+    GncDenom (GncRational& a, GncRational& b, int64_t spec, unsigned int how) noexcept;
     void reduce (const GncRational& a) noexcept;
     GncInt128 get () const noexcept { return m_value; }
 
@@ -81,7 +81,7 @@ struct GncDenom
     RoundType m_round;
     DenomType m_type;
     bool m_auto;
-    uint m_sigfigs;
+    unsigned int m_sigfigs;
     GNCNumericErrorCode m_error;
 };
 



Summary of changes:
 src/libqof/qof/gnc-int128.cpp   |  1 +
 src/libqof/qof/gnc-int128.hpp   | 20 +++++++++++---------
 src/libqof/qof/gnc-rational.cpp |  4 ++--
 src/libqof/qof/gnc-rational.hpp |  4 ++--
 4 files changed, 16 insertions(+), 13 deletions(-)



More information about the gnucash-changes mailing list