From ea27d1b45a5ff975a1e90e3e9f4b74ff8d34056e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 29 Jul 2008 20:10:03 -0400 Subject: Moved around and renamed a very large amount of code in order to rationalize the way that value expressions extract information from journal objects. --- reconcile.cc | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'reconcile.cc') diff --git a/reconcile.cc b/reconcile.cc index 8a1be816..5d979251 100644 --- a/reconcile.cc +++ b/reconcile.cc @@ -3,14 +3,14 @@ namespace ledger { -#define xact_next(x) ((transaction_t *)transaction_xdata(*x).ptr) -#define xact_next_ptr(x) ((transaction_t **)&transaction_xdata(*x).ptr) +#define xact_next(x) ((xact_t *)xact_xdata(*x).ptr) +#define xact_next_ptr(x) ((xact_t **)&xact_xdata(*x).ptr) static bool search_for_balance(amount_t& amount, - transaction_t ** prev, transaction_t * next) + xact_t ** prev, xact_t * next) { for (; next; next = xact_next(next)) { - transaction_t * temp = *prev; + xact_t * temp = *prev; *prev = next; amount -= next->amount; @@ -24,32 +24,32 @@ static bool search_for_balance(amount_t& amount, return false; } -void reconcile_transactions::push_to_handler(transaction_t * first) +void reconcile_xacts::push_to_handler(xact_t * first) { for (; first; first = xact_next(first)) - item_handler::operator()(*first); + item_handler::operator()(*first); - item_handler::flush(); + item_handler::flush(); } -void reconcile_transactions::flush() +void reconcile_xacts::flush() { value_t cleared_balance; value_t pending_balance; - transaction_t * first = NULL; - transaction_t ** last_ptr = &first; + xact_t * first = NULL; + xact_t ** last_ptr = &first; - for (transactions_list::iterator x = xacts.begin(); + for (xacts_list::iterator x = xacts.begin(); x != xacts.end(); x++) { if (! is_valid(cutoff) || (*x)->date() < cutoff) { switch ((*x)->state) { - case transaction_t::CLEARED: + case xact_t::CLEARED: cleared_balance += (*x)->amount; break; - case transaction_t::UNCLEARED: - case transaction_t::PENDING: + case xact_t::UNCLEARED: + case xact_t::PENDING: pending_balance += (*x)->amount; *last_ptr = *x; last_ptr = xact_next_ptr(*x); -- cgit v1.2.3