gnucash master: Multiple changes pushed

John Ralls jralls at code.gnucash.org
Mon Feb 20 19:06:19 EST 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/cbe52dad (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e322457e (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a193b9a2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0b09b58c (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d0726de3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b60d6a84 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bff0e745 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6220b850 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ea44b16f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/739c91a4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e506f9a4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/0403a666 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c633e80a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/ff7e6a37 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c3d22c42 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4a46ae3d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a54edf1a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/82fe06e3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4fef04c1 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/570c8a8d (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4a134ae0 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/06d22718 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/3975b0b4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/6f5d628b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b0dfd96a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/340fb976 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a88d2124 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/e1b280b3 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b1995932 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/a852dfb4 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/d9aa5e1a (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b5f06ab6 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/43fbb338 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/848f77da (commit)
	 via  https://github.com/Gnucash/gnucash/commit/b30a547d (commit)
	from  https://github.com/Gnucash/gnucash/commit/2c5f6b9c (commit)



commit cbe52dad34d7c9c5ab54df36ac836054d61eaaa5
Merge: b30a547 e322457
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 20 16:05:30 2017 -0800

    Merge fetaure-branch 'numeric', provides GncNumeric C++ API.

commit e322457e45cfe199ce67b18c8abce683b791acec
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 20 15:02:20 2017 -0800

    Fix Geert’s code review comments.
    
    Except the big one about string IO not being flexible enough.

commit a193b9a2c12d60c34e24facf0c324ab55a9e00ee
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 6 09:40:00 2017 -0800

    Fix documentation errors.

commit 0b09b58cf640aaeb5b995eccf76ea685c554fdf4
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Feb 3 10:49:09 2017 -0800

    Relax comparison test for GncRational::round_to_numeric
    
    To allow for a difference of 1 on very large numbers (>1e16). At the
    same time made the test harder with a wider range, skipping cases where
    the result overflows. Use GncRational::valid() instead of testing
    components for both overflow and NaN.

commit d0726de39131ce50412407af89c611792933f1a0
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Feb 3 09:41:35 2017 -0800

    Replace std::regex with boost::regex.
    
    Gcc's std::regex compiler doesn't correctly recognize capture blocks.

commit b60d6a84666756b516faf614fa9da86a7ac3391f
Author: John Ralls <jralls at ceridwen.us>
Date:   Fri Feb 3 08:55:01 2017 -0800

    Add libgnc-qof to dependencies for test-numeric.

commit bff0e745fc07e8b6a7fe1ae6c7c7145a1f46416d
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 2 21:53:06 2017 -0800

    Fix indentation error.

commit 6220b850453848f13619ece6c5c55f85f2990a61
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 2 15:14:23 2017 -0800

    Remove a commented-out diagnostic.

commit ea44b16f548f702fff62171fe9f5104ac0c0a222
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 2 15:13:10 2017 -0800

    Make the GncRational and GncNumeric APIs mostly identical.
    
    Leaving string conversion and stream operators out of GncRational.

commit 739c91a4ccb4e5d05d0fd842ec66ecde2a7dffc5
Author: John Ralls <jralls at ceridwen.us>
Date:   Thu Feb 2 13:15:52 2017 -0800

    Change GncRational::round to GncRational::convert.
    
    With the same signature as the GncNumeric version.

commit e506f9a4a1b3433a2927fb5dd78acaedd4b034a2
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 31 14:34:51 2017 -0800

    Make the rounding functions templates and move them to their own header.

commit 0403a6667aaa2ff80563061786b9d51d6f42b2da
Author: John Ralls <jralls at ceridwen.us>
Date:   Tue Jan 31 14:21:00 2017 -0800

    Replace GncInt128’s flags variable with bit-stuffing in the high leg.
    
    Loses three bits so GncInt128 becomes really a GncInt125, but we don’t
    really need the single order-of-magnitude: 10**38 is big enough. Saves
    a full word of memory for each GncInt128, which means 2 words for GncRational.
    That’s a 33% saving in memory for 64-bit and makes the object size the
    same (32 bytes) for all architectures.

commit c633e80a2480725f5a7ca85778270b139693cb0a
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 15:01:27 2017 -0800

    Convert GncRational to throw instead of using a status byte.
    
    More consistent with GncNumeric and saves a word of memory per instance.
    Still bleeping huge because the two GncInt128s each need 128 bits (2 or 4 words)
    plus a word for status (for 3 bits!).
    Also provide a couple of convenience functions, is_big() and valid() to
    test if the either numerator and denominator is big or overflowed or NaN.

commit ff7e6a37d531f05716e1e1214b84ea7cbe49de60
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:29:48 2017 -0800

    Reimplement gnc_numeric in terms of GncNumeric instead of GncRational.
    
    Except when how has DenomType::exact; that triggers direct use of GncRational
    and direct rounding to the specified denominator.

commit c3d22c429f1febdd1892f0b45d26606b1ea10ea9
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:26:41 2017 -0800

    Add GncRational test for GncRational::round_to_numeric().
    
    Needed GncNumeric to be defined.

commit 4a46ae3ddffd0e70a800aa925d6d3eaccbdb1837
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:25:23 2017 -0800

    Fix GncInt128 tests for older compilers.

commit a54edf1a5e04e7d1cc871e04da5c767020b3144a
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:23:00 2017 -0800

    Add GncRational(GncNumeric) constructor.

commit 82fe06e390ee5aa16ff2d46e5fed4865548780cc
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:17:05 2017 -0800

    Extract new class GncNumeric.
    
    Similar to GncRational, except that it’s based on int64_t instead of
    GncInt128 and throws instead of using a status byte.
    
    Most calculations are performed using GncRational, the result is then
    rounded (RoundType::half_down) to fit. GncRational should be used in
    circumstances where the automatic rounding is undesirable.

commit 4fef04c17b3df6b29ee3703af459adc3ea32c977
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 13:02:56 2017 -0800

    Remove #ifdef __cplusplus from gnu-numeric.cpp
    
    It’s always compiled with C++.

commit 570c8a8d60048f66ede9300e7ddf331192543ef6
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 12:59:45 2017 -0800

    Fix GncInt128 shift operators when shift amount will clear a leg.

commit 4a134ae0b1980ed830f3cff954ab870dae67bcd1
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 12:56:24 2017 -0800

    Declare GncInt128::div() const
    
    Because it doesn’t change the value of *this, it returns the results in
    the return value args.

commit 06d22718f5ad8ec213d992a6bfb9b5f8c9540805
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 12:55:06 2017 -0800

    Fix minor typos and whitespace issues.

commit 3975b0b465ec181ba36fad86599db192524751c7
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 12:42:08 2017 -0800

    Change signature of GncRational::round from taking a GncDenominator…
    
    to a separate denominator and RoundType.

commit 6f5d628b1258ee846eadb16afc392605371a9f59
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 10:56:10 2017 -0800

    Move test-numeric from src/engine to src/libqof/qof.
    
    It’s testing a file in qof and doesn’t need to be in engine just because
    it uses some functions from test-engine-stuff.

commit b0dfd96a93648cc890d9d89a0754f2567b1b2485
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 10:49:57 2017 -0800

    Add GncRational::reduce() and GncRational::round_to_numeric().

commit 340fb9761ca3c7de7c69bb55a7ce980633fb8013
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 10:37:45 2017 -0800

    Fix inverted subtraction.

commit a88d21245e348a5a49128c6f435c37ad72851597
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 30 10:37:15 2017 -0800

    Add guard macro to gnu-rational.hpp.

commit e1b280b36bd0a3f4834471ee776d0e368f437aa4
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 16 10:12:28 2017 -0800

    Untabify gnu-numeric.cpp.

commit b1995932fc2b5c6439b142b01068860fd522fcc2
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Jan 16 09:38:45 2017 -0800

    Remove unused gnc_numeric_foo_with_error functions.

commit a852dfb4eff74594acb55b10c0ba2fe6bc6f9f7e
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Jan 15 12:33:31 2017 -0800

    Implement basic arithmetic operators for GncRational.
    
    The operators do no rounding or reducing yet.

commit d9aa5e1ad5d70c12ec43d89860da262299b8e035
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 14 17:25:31 2017 -0800

    Reorder test parameters so that the expected value is first.

commit b5f06ab6dcbc14d67ef3b203bb72881a7b4c1c2d
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 14 14:59:13 2017 -0800

    Add an error parameter on the GncInt128 constructor.

commit 43fbb338af1cc56f2ab9588282d8f3271dbe8e28
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 14 14:34:30 2017 -0800

    Add GTest test program for GncRational.
    
    Starting off with the constructors.

commit 848f77dacfe99592504aaa5bd412bd448b6c8c7b
Author: John Ralls <jralls at ceridwen.us>
Date:   Sat Jan 14 14:33:47 2017 -0800

    Add explicit and correct default GncRational constructor.
    
    As suggested by Geert Janssens.

commit b30a547d18f08ff16268fb92d1f8545add5eb7cd
Author: John Ralls <jralls at ceridwen.us>
Date:   Mon Feb 20 15:50:14 2017 -0800

    Add ICU libraries on which Boost:locale is dependent to CSV-Import LINK_LIBRARIES.



Summary of changes:
 src/app-utils/gnc-ui-util.c                      |    3 +-
 src/app-utils/test/test-print-parse-amount.cpp   |   34 +-
 src/engine/test/CMakeLists.txt                   |    1 -
 src/engine/test/Makefile.am                      |    3 +-
 src/import-export/csv-imp/CMakeLists.txt         |   12 +-
 src/libqof/CMakeLists.txt                        |    8 +-
 src/libqof/qof/Makefile.am                       |    3 +
 src/libqof/qof/gnc-int128.cpp                    |  325 +++++--
 src/libqof/qof/gnc-int128.hpp                    |   27 +-
 src/libqof/qof/gnc-numeric.cpp                   | 1062 +++++++++++++++-------
 src/libqof/qof/gnc-numeric.h                     |   32 -
 src/libqof/qof/gnc-numeric.hpp                   |  433 +++++++++
 src/libqof/qof/gnc-rational-rounding.hpp         |  133 +++
 src/libqof/qof/gnc-rational.cpp                  |  443 ++++-----
 src/libqof/qof/gnc-rational.hpp                  |  290 ++++--
 src/libqof/qof/test/CMakeLists.txt               |   38 +
 src/libqof/qof/test/Makefile.am                  |  190 ++--
 src/libqof/qof/test/gtest-gnc-int128.cpp         |  404 ++++----
 src/libqof/qof/test/gtest-gnc-numeric.cpp        |  525 +++++++++++
 src/libqof/qof/test/gtest-gnc-rational.cpp       |  173 ++++
 src/libqof/qof/test/test-gnc-numeric.c           |   47 -
 src/{engine => libqof/qof}/test/test-numeric.cpp |  135 +--
 22 files changed, 3145 insertions(+), 1176 deletions(-)
 create mode 100644 src/libqof/qof/gnc-numeric.hpp
 create mode 100644 src/libqof/qof/gnc-rational-rounding.hpp
 create mode 100644 src/libqof/qof/test/gtest-gnc-numeric.cpp
 create mode 100644 src/libqof/qof/test/gtest-gnc-rational.cpp
 delete mode 100644 src/libqof/qof/test/test-gnc-numeric.c
 rename src/{engine => libqof/qof}/test/test-numeric.cpp (87%)



More information about the gnucash-patches mailing list