don't use gnc_difftime

because it casts time64 to doubles
This commit is contained in:
Christopher Lam
2024-09-08 21:10:41 +08:00
parent 04c3191b87
commit 9c4ef934ce
2 changed files with 5 additions and 7 deletions

View File

@@ -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);
}
}
@@ -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);

View File

@@ -603,7 +603,6 @@ 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;
@@ -611,8 +610,8 @@ gnc_save_reconcile_interval(Account *account, time64 statement_date)
/*
* 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