From 67d024c11fef03007062e55a7cfc86ea60440e7f Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Sun, 17 Mar 2024 16:27:56 +0800 Subject: [PATCH] [Scrub3.cpp] convert to cpp --- libgnucash/engine/CMakeLists.txt | 2 +- libgnucash/engine/{Scrub3.c => Scrub3.cpp} | 12 ++++++------ po/POTFILES.in | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) rename libgnucash/engine/{Scrub3.c => Scrub3.cpp} (95%) diff --git a/libgnucash/engine/CMakeLists.txt b/libgnucash/engine/CMakeLists.txt index 71d8cb1a40..313ee2c0c6 100644 --- a/libgnucash/engine/CMakeLists.txt +++ b/libgnucash/engine/CMakeLists.txt @@ -144,7 +144,7 @@ set (engine_SOURCES SX-ttinfo.c Scrub.cpp Scrub2.cpp - Scrub3.c + Scrub3.cpp ScrubBusiness.c ScrubBudget.c Split.cpp diff --git a/libgnucash/engine/Scrub3.c b/libgnucash/engine/Scrub3.cpp similarity index 95% rename from libgnucash/engine/Scrub3.c rename to libgnucash/engine/Scrub3.cpp index b3ed4b720b..3eeca2ff43 100644 --- a/libgnucash/engine/Scrub3.c +++ b/libgnucash/engine/Scrub3.cpp @@ -68,7 +68,7 @@ gains_possible (GNCLot *lot) node = gnc_lot_get_split_list (lot); if (!node) return FALSE; - split = node->data; + split = GNC_SPLIT(node->data); acc_commodity = xaccAccountGetCommodity(acc); comeq = gnc_commodity_equiv (acc_commodity, split->parent->common_currency); @@ -108,7 +108,7 @@ xaccScrubLot (GNCLot *lot) gnc_numeric opening_baln; /* Get the opening balance for this lot */ - pcy->PolicyGetLotOpening (pcy, lot, &opening_baln, NULL, NULL); + pcy->PolicyGetLotOpening (pcy, lot, &opening_baln, nullptr, nullptr); PINFO ("lot opener baln=%s", gnc_num_dbg_to_string (opening_baln)); /* If the lot is fat, give the boot to all the non-opening @@ -121,7 +121,7 @@ xaccScrubLot (GNCLot *lot) rethin: for (node = gnc_lot_get_split_list(lot); node; node = node->next) { - Split *s = node->data; + Split *s = GNC_SPLIT(node->data); if (pcy->PolicyIsOpeningSplit (pcy, lot, s)) continue; gnc_lot_remove_split (lot, s); goto rethin; @@ -144,7 +144,7 @@ rethin: */ if (gains_possible (lot)) { - xaccLotComputeCapGains (lot, NULL); + xaccLotComputeCapGains (lot, nullptr); xaccLotScrubDoubleBalance (lot); } xaccAccountCommitEdit(acc); @@ -169,7 +169,7 @@ xaccAccountScrubLots (Account *acc) lots = xaccAccountGetLotList(acc); for (node = lots; node; node = node->next) { - GNCLot *lot = node->data; + GNCLot *lot = GNC_LOT(node->data); xaccScrubLot (lot); } g_list_free(lots); @@ -191,7 +191,7 @@ xaccAccountTreeScrubLots (Account *acc) { if (!acc) return; - gnc_account_foreach_descendant(acc, lot_scrub_cb, NULL); + gnc_account_foreach_descendant(acc, lot_scrub_cb, nullptr); xaccAccountScrubLots (acc); } diff --git a/po/POTFILES.in b/po/POTFILES.in index 8ac72daa69..ca430135f7 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -687,7 +687,7 @@ libgnucash/engine/Query.c libgnucash/engine/Recurrence.cpp libgnucash/engine/SchedXaction.c libgnucash/engine/Scrub2.cpp -libgnucash/engine/Scrub3.c +libgnucash/engine/Scrub3.cpp libgnucash/engine/ScrubBudget.c libgnucash/engine/ScrubBusiness.c libgnucash/engine/Scrub.cpp