Skip to content

Commit

Permalink
don't use gnc_difftime
Browse files Browse the repository at this point in the history
because it casts time64 to doubles
  • Loading branch information
christopherlam committed Sep 8, 2024
1 parent 04c3191 commit 9c4ef93
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
7 changes: 3 additions & 4 deletions gnucash/gnome/reconcile-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
/* Just an extra verification that our query is correct ;) */
g_assert (recn == NREC || recn == CREC);

if (recn == CREC && gnc_difftime (trans_date, statement_date_day_end) <= 0)
if (recn == CREC && trans_date <= statement_date_day_end)
g_hash_table_insert (view->reconciled, split, split);
}
}
Expand Down Expand Up @@ -973,9 +973,8 @@ gnc_reconcile_view_postpone (GNCReconcileView *view)

// Don't change splits past reconciliation date that haven't been
// set to be reconciled
if (gnc_difftime (view->statement_date,
xaccTransGetDate (xaccSplitGetParent (entry))) >= 0 ||
g_hash_table_lookup (view->reconciled, entry))
if (view->statement_date >= xaccTransGetDate (xaccSplitGetParent (entry)) ||
g_hash_table_lookup (view->reconciled, entry))
{
recn = g_hash_table_lookup (view->reconciled, entry) ? CREC : NREC;
xaccSplitSetReconcile (entry, recn);
Expand Down
5 changes: 2 additions & 3 deletions gnucash/gnome/window-reconcile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -603,16 +603,15 @@ gnc_save_reconcile_interval(Account *account, time64 statement_date)
{
time64 prev_statement_date;
int days = 0, months = 0;
double seconds;

if (!xaccAccountGetReconcileLastDate (account, &prev_statement_date))
return;

/*
* Compute the number of days difference.
*/
seconds = gnc_difftime (statement_date, prev_statement_date);
days = (int)(seconds / 60 / 60 / 24);
auto seconds = statement_date - prev_statement_date;
days = seconds / 60 / 60 / 24;

/*
* See if we need to remember days(weeks) or months. The only trick
Expand Down

0 comments on commit 9c4ef93

Please sign in to comment.