Christopher Lam
949c9c97c0
Bug 799300 - Nullpointer exception in gnc_quote_source_s
...
avoids constructing std::string with nullptr
2 years ago
Christopher Lam
87dbbf25f8
[account.cpp] add gnc_account_foreach_until_date
...
- uses binary search to find first split after date
- for_each from earliest split to (but excluding) the above first split
2 years ago
John Ralls
9c18bc889c
Don't use Googletest internal API for unused decls.
2 years ago
Bruce P Schuck
d01aad68fb
Update gnc-commodity.cpp
...
Fool.pm not working. Removed references to it from sources JSON structures.
2 years ago
Bruce Schuck
6696bf0a41
Updated QuoteSourceVec to match F::Q v1.59
2 years ago
Christopher Lam
0f791c474a
[Account.cpp][api] gnc_account_foreach_split takes std::function<void(Split*)>
2 years ago
Christopher Lam
871f669a19
[Account.cpp] explicitly destroy priv->splits
...
better than 35b6fb767d
2 years ago
Christopher Lam
35b6fb767d
[Account.cpp] ensure priv->splits releases memory on shutdown
2 years ago
Christopher Lam
94368f4cb4
[Account.cpp] SplitsVec&, ensure xaccAccountGetSplitList is freed
2 years ago
Christopher Lam
2b71219766
[Account.cpp] remove obsolete comment
2 years ago
Christopher Lam
1b50c6261a
g_list_free xaccAccountGetSplitList
2 years ago
Christopher Lam
606da28d25
use xaccAccountGetSplitsSize
2 years ago
Christopher Lam
f70ee754fc
use xaccAccountGetSplits and gnc_account_find_split
2 years ago
Christopher Lam
3f7a5a8267
[Account.hpp][API] xaccAccountGetSplits and gnc_account_find_split
2 years ago
Christopher Lam
a54caaab61
[Account.cpp] GetBalanceAsOfDate gets std::function instead of bool
2 years ago
Christopher Lam
cc10b9a0b7
[SX-book.c] tidy for loop
...
because splits will need to be g_list_free in a future commit
2 years ago
Christopher Lam
c1ee59c39b
[Account.h] size_t xaccAccountGetSplitsSize returns g_list_length (splits)
...
which is easily replaced with vector.size()
2 years ago
Christopher Lam
f08e0f5b61
[policy.cpp] rewrite to avoid goto
2 years ago
Christopher Lam
2251bf8966
[Account.hpp] use std::optional for cached values
...
whereby {} denotes uncached values
2 years ago
Sherlock
f0d45de642
Resolve test assert.
2 years ago
Sherlock
8d6f748aca
Bug 799281 - Deleting a transaction may trigger a crash
...
Update qof_collection_lookup_entity() to prevent returning instances marked to be destroyed.
2 years ago
Christopher Lam
d100df7ef7
[AccountP.hpp] .h -> .hpp, remove extern "C" {} wrapper
2 years ago
Christopher Lam
a67e4651c3
[Query.cpp] convert to cpp
2 years ago
Christopher Lam
4d9836aac2
[TransLog.cpp] convert to cpp
2 years ago
Christopher Lam
093781c018
[policy.cpp] convert to cpp
2 years ago
Christopher Lam
f913bed7e6
[gnc-engine.cpp] convert to cpp
2 years ago
Christopher Lam
96f041a1d6
[cap-gains.cpp] convert to cpp
2 years ago
Christopher Lam
79b7267cdd
[cashobjects.cpp] convert to cpp
2 years ago
Christopher Lam
67d024c11f
[Scrub3.cpp] convert to cpp
2 years ago
Christopher Lam
6b5a4d7c11
[Scrub2.cpp] convert to cpp
2 years ago
Christopher Lam
ddfa664601
[Scrub.cpp] convert to cpp
2 years ago
Christopher Lam
dab32807ef
[engine/*.cpp] NULL -> nullptr changes
...
It's the done thing
2 years ago
Christopher Lam
9a85eb4a2a
[engine/*.h] add extern "C" {} wrappers
2 years ago
Christopher Lam
4945db6b7d
[AccountP.h] remove struct members obsolete with 76014f18a0
...
forgot to remove
2 years ago
Christopher Lam
ba403e4a7c
[guid.hpp] GUID::from_string and is_valid_string takes a const char*
...
boost::uuids::string_generator has operator()(const char*).
thus we can avoid allocating std::string, with a consistent 4% speedup
2 years ago
Christopher Lam
cba7da30fd
[gnc-date.cpp] specialise iso-8601 parsing where TZ=+0000
...
- avoid allocating new TZPtr
- parse y/m/d/h/m/s and construct PTime directly
- avoid boost's time_from_string which creates an std::string
2 years ago
Christopher Lam
27c16517e9
[gnc-numeric.cpp] shortcut parsing num/denom as gnc_numeric
...
The gnc_numeric is serialised as "num/denom" with no whitespace, and
denom > 0. This function takes advantage of std::from_chars to parse
it. The "num" serialisation is also optimised as a free side effect of
this function.
2 years ago
Christopher Lam
11da03bc67
[gtest-gnc-numeric.cpp] test int64 limits for GncNumeric
2 years ago
John Ralls
af18ea598e
Bug 799093 - Cannot reconcile since v5.4
...
Covers the final case where having the reconcile window open and
auto-completing a transaction then deleting the transaction before
committing it leaves the transaction in the reconcile window.
We need to signal that the account is modified even if it isn't
because that's what the reconcile window is watching.
2 years ago
John Ralls
2db6988e25
Remove bogus include.
2 years ago
John Ralls
8ebac5b596
Bug 799213 - SIGSEGV caused by revising an auto completed transaction
...
Calling xaccSplitDestroy without also calling xaccSplitCommitEdit then
deleting the split list before calling xaccTransCommitEdit prevents
xaccSplitCommitEdit from being called on the supposedly deleted
splits. Not only does this leak them it leaves them in the book
potentially with a dangling parent pointer.
2 years ago
Christopher Lam
229d9300cf
[engine-helpers.h] key is a const char*
...
thus allowing compilation in cpp with stricter type checking
2 years ago
Christopher Lam
c345fc9d3c
add #ifdef __cplusplus extern "C" {} wrappers to .h files
2 years ago
Christopher Lam
6cb2eeeaa8
Merge branch 'more-engine-cpp' into stable #1866
2 years ago
John Ralls
226bfea108
Fix a bunch of UB errors from ASAN about mismatched function types.
...
The casts fool the compiler but not the UB sanitizer.
2 years ago
John Ralls
7bd97f15d0
Fix transaction delete use-after-free, take 2.
...
The problem with take 1 was that the duplicate split uses the same lot
and account pointers without adding itself to those lists, causing
checks in unit tests to fail.
2 years ago
John Ralls
8546aa975e
Revert "Fix two use-after-free issues found by address sanitizer."
...
This reverts commit 4dbf803041 .
The use-after free errors are caused by the compiler reordering the
steps in xaccSplitFree and Transaction's do_destroy. Unfortunately the
corrections here caused trouble in other places, leading to test failures.
2 years ago
John Ralls
4dbf803041
Fix two use-after-free issues found by address sanitizer.
2 years ago
Christopher Lam
28cc26f207
[gnc-commodities.cpp] gnc_new_iso_codes is a std::unordered_map
2 years ago
Geert Janssens
00640f9ded
Replace naked for loops with C++ algorithms
2 years ago