[Scrub3.cpp] convert to cpp

This commit is contained in:
Christopher Lam 2024-03-17 16:27:56 +08:00
parent 6b5a4d7c11
commit 67d024c11f
3 changed files with 8 additions and 8 deletions

View File

@ -144,7 +144,7 @@ set (engine_SOURCES
SX-ttinfo.c SX-ttinfo.c
Scrub.cpp Scrub.cpp
Scrub2.cpp Scrub2.cpp
Scrub3.c Scrub3.cpp
ScrubBusiness.c ScrubBusiness.c
ScrubBudget.c ScrubBudget.c
Split.cpp Split.cpp

View File

@ -68,7 +68,7 @@ gains_possible (GNCLot *lot)
node = gnc_lot_get_split_list (lot); node = gnc_lot_get_split_list (lot);
if (!node) return FALSE; if (!node) return FALSE;
split = node->data; split = GNC_SPLIT(node->data);
acc_commodity = xaccAccountGetCommodity(acc); acc_commodity = xaccAccountGetCommodity(acc);
comeq = gnc_commodity_equiv (acc_commodity, split->parent->common_currency); comeq = gnc_commodity_equiv (acc_commodity, split->parent->common_currency);
@ -108,7 +108,7 @@ xaccScrubLot (GNCLot *lot)
gnc_numeric opening_baln; gnc_numeric opening_baln;
/* Get the opening balance for this lot */ /* 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)); 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 /* If the lot is fat, give the boot to all the non-opening
@ -121,7 +121,7 @@ xaccScrubLot (GNCLot *lot)
rethin: rethin:
for (node = gnc_lot_get_split_list(lot); node; node = node->next) 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; if (pcy->PolicyIsOpeningSplit (pcy, lot, s)) continue;
gnc_lot_remove_split (lot, s); gnc_lot_remove_split (lot, s);
goto rethin; goto rethin;
@ -144,7 +144,7 @@ rethin:
*/ */
if (gains_possible (lot)) if (gains_possible (lot))
{ {
xaccLotComputeCapGains (lot, NULL); xaccLotComputeCapGains (lot, nullptr);
xaccLotScrubDoubleBalance (lot); xaccLotScrubDoubleBalance (lot);
} }
xaccAccountCommitEdit(acc); xaccAccountCommitEdit(acc);
@ -169,7 +169,7 @@ xaccAccountScrubLots (Account *acc)
lots = xaccAccountGetLotList(acc); lots = xaccAccountGetLotList(acc);
for (node = lots; node; node = node->next) for (node = lots; node; node = node->next)
{ {
GNCLot *lot = node->data; GNCLot *lot = GNC_LOT(node->data);
xaccScrubLot (lot); xaccScrubLot (lot);
} }
g_list_free(lots); g_list_free(lots);
@ -191,7 +191,7 @@ xaccAccountTreeScrubLots (Account *acc)
{ {
if (!acc) return; if (!acc) return;
gnc_account_foreach_descendant(acc, lot_scrub_cb, NULL); gnc_account_foreach_descendant(acc, lot_scrub_cb, nullptr);
xaccAccountScrubLots (acc); xaccAccountScrubLots (acc);
} }

View File

@ -687,7 +687,7 @@ libgnucash/engine/Query.c
libgnucash/engine/Recurrence.cpp libgnucash/engine/Recurrence.cpp
libgnucash/engine/SchedXaction.c libgnucash/engine/SchedXaction.c
libgnucash/engine/Scrub2.cpp libgnucash/engine/Scrub2.cpp
libgnucash/engine/Scrub3.c libgnucash/engine/Scrub3.cpp
libgnucash/engine/ScrubBudget.c libgnucash/engine/ScrubBudget.c
libgnucash/engine/ScrubBusiness.c libgnucash/engine/ScrubBusiness.c
libgnucash/engine/Scrub.cpp libgnucash/engine/Scrub.cpp