David Seifert
c06bc18dc4
Add missing `#include <cstdint>`
...
* GCC 15 has reduced transitive dependencies between headers.
Bug: https://bugs.gentoo.org/939856
1 year ago
Christopher Lam
1e1d21b716
[Transaction.hpp] rename to .hpp
2 years ago
Christopher Lam
f70ee754fc
use xaccAccountGetSplits and gnc_account_find_split
2 years ago
Christopher Lam
d100df7ef7
[AccountP.hpp] .h -> .hpp, remove extern "C" {} wrapper
2 years ago
Richard Cohen
f1e889dbcb
Valgrind: fix "definitely lost" memory in test - test-lots
...
==67054== 320 bytes in 32 blocks are definitely lost in loss record 2,213 of 2,238
==67054== at 0x4848A13: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==67054== by 0x503C550: g_malloc0 (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==67054== by 0x118AD8: get_random_transaction_with_currency (test-engine-stuff.cpp:1395)
==67054== by 0x119897: add_random_transactions_to_book (test-engine-stuff.cpp:1848)
==67054== by 0x115FE8: run_test() (test-lots.cpp:99)
==67054== by 0x1160BF: main (test-lots.cpp:135)
==67054==
3 years ago
Richard Cohen
66c5e398ae
Change g_assert() -> g_assert_true() in tests
...
g_assert() can be compiled out, so should not be used for tests
g_assert_true was removed
to fis https://bugs.gnucash.org/show_bug.cgi?id=792008 because
g_assert_true was introduced in glib-2.38 and at the time GnuCash required
only glib-2.26. GnuCash has required glib >= 2.40 since 8acbc41c6 so
g_assert_true can be restored.
3 years ago
Richard Cohen
46e6477f88
Refactor: use common code to free the list of guids
3 years ago
Richard Cohen
f1a3f2a8c8
Valgrind: fix "Mismatched free/delete" - test-scm-query etc.
...
- test-scm-query
- test-print-queries
- test-scm-query-string
==14597== Mismatched free() / delete / delete []
==14597== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==14597== by 0x118851: free_random_guids(_GList*) (test-engine-stuff.cpp:1505)
==14597== by 0x118CF5: get_random_query (test-engine-stuff.cpp:1674)
...
==14597== Address 0xa1366a0 is 0 bytes inside a block of size 16 alloc'd
==14597== at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==14597== by 0x5342FA6: guid_malloc (guid.cpp:106)
==14597== by 0x534300D: guid_copy (guid.cpp:123)
==14597== by 0x534311F: guid_new (guid.cpp:154)
==14597== by 0x115D1A: get_random_guid (test-engine-stuff.cpp:207)
==14597== by 0x1187FA: get_random_guids(int) (test-engine-stuff.cpp:1494)
==14597== by 0x118CC0: get_random_query (test-engine-stuff.cpp:1668)
...
==15045== Mismatched free() / delete / delete []
==15045== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==15045== by 0x118E96: get_random_query (test-engine-stuff.cpp:1735)
...
==15045== Address 0xa077d40 is 0 bytes inside a block of size 16 alloc'd
==15045== at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==15045== by 0x5342FA6: guid_malloc (guid.cpp:106)
==15045== by 0x534300D: guid_copy (guid.cpp:123)
==15045== by 0x534311F: guid_new (guid.cpp:154)
==15045== by 0x115D1A: get_random_guid (test-engine-stuff.cpp:207)
==15045== by 0x118E65: get_random_query (test-engine-stuff.cpp:1730)
...
3 years ago
Richard Cohen
e5a26e3c77
Valgrind: fix "Mismatched free/delete" - test-query
...
==31803== Mismatched free() / delete / delete []
==31803== at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803== by 0x1198CB: make_trans_query (test-engine-stuff.cpp:2030)
==31803== by 0x115898: test_trans_query(transaction_s*, void*) (test-query.cpp:40)
...
==31803== Address 0x7fed160 is 0 bytes inside a block of size 16 alloc'd
==31803== at 0x4843FA3: operator new(unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31803== by 0x4E3706E: guid_malloc (guid.cpp:106)
==31803== by 0x4E370D5: guid_copy (guid.cpp:123)
==31803== by 0x4E371E7: guid_new (guid.cpp:154)
==31803== by 0x115D64: get_random_guid (test-engine-stuff.cpp:207)
==31803== by 0x11984C: make_trans_query (test-engine-stuff.cpp:2023)
...
3 years ago
Richard Cohen
4018ff1722
Valgrind: fix "Mismatched free/delete" - test-kvp-frames etc.
...
- test-kvp-frames
- test-xml-account
- test-xml-transaction
- test-account-object
- test-group-vs-book
- test-lots
- test-query
- test-import-pending-matches
==30223== Mismatched free() / delete / delete []
==30223== at 0x4846AFF: operator delete(void*, unsigned long) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223== by 0x4E370AA: guid_free (guid.cpp:116)
...
==30223== Address 0x7ea4390 is 0 bytes inside a block of size 16 alloc'd
==30223== at 0x4843828: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==30223== by 0x5032948: g_malloc (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==30223== by 0x11603A: get_random_guid (test-engine-stuff.cpp:209)
...
3 years ago
Richard Cohen
9c6ad222a9
[-Wunused-function] - remove
3 years ago
Richard Cohen
ea2d3be217
Remove some unused variables with obviously no side effects
3 years ago
Richard Cohen
1cec0cb3f3
Use internal extern "C" { ... } for C++
...
- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
3 years ago
John Ralls
8ff5af4c19
Decouple QofBook creation from QofSession.
...
So that we don't create two books when loading a session.
Step 1 to not having a dirty book when we think we should have no
book at all.
6 years ago
John Ralls
4c1c485db6
Use split SCU when borking random split pairs.
...
Reduces likelihood of a zero value in the transaction currency.
7 years ago
John Ralls
40bcd1e377
Bump the max_denom_mult to match the new GNC_COMMODITY_MAX_FRACTION.
8 years ago
John Ralls
62b17ca5db
Timespec removal, engine odds-and-ends.
8 years ago
John Ralls
358cd979d9
Remove Timespec from the main engine classes (Transaction, Split, & Account.
8 years ago
John Ralls
fee589b28c
Remove Timespec from pricedb.
...
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
8 years ago
John Ralls
c8b372e390
Convert GNC_TYPE_TIMESPEC to GNC_TYPE_TIME64, Kvp::Type::Timespec to Kvp::Type::Time64
...
They have to go together because of using gvalues to hide KVP from most of
GnuCash.
8 years ago
Geert Janssens
c71204628d
Bug 795031 - 3.0 Crashes on loading when opening 2.6.19 file
8 years ago
lmat
1f050fd1e5
Transaction members Timespec->time64
8 years ago
lmat
f77369bb96
Removing timspec from some xml parsing
...
And several other sprawling references that are connected in one
way or another.
8 years ago
lmat
5636afc4a2
Kvp no longer parses entries looking for delimiters
8 years ago
lmat
34e0d6cfa0
kvp frame to template and correcting failure macro
...
The template avoids the need to cast to and from void*, and adds flexibility to
the targeted function's signature.
test-stuff.h defines a macro, "failure" which is used as an identifier
in the standard IO library, so I moved any inclusion of test-stuff.h to
the last include position so that "failure" wouldn't be defined before
the IO library was included.
8 years ago
Geert Janssens
83d14e1c1c
Restructure the src directory
...
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)
This is the first step in restructuring the code. It will need much
more fine tuning later on.
9 years ago