mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-27 03:10:23 -06:00
Change some functions to use const gnc_commodity for gnc_pricedb
This commit is contained in:
parent
e75308e684
commit
e535ba5411
@ -3609,8 +3609,8 @@ xaccAccountConvertBalanceToCurrency(const Account *acc, /* for book */
|
||||
gnc_numeric
|
||||
xaccAccountConvertBalanceToCurrencyAsOfDate(const Account *acc, /* for book */
|
||||
gnc_numeric balance,
|
||||
gnc_commodity *balance_currency,
|
||||
gnc_commodity *new_currency,
|
||||
const gnc_commodity *balance_currency,
|
||||
const gnc_commodity *new_currency,
|
||||
time64 date)
|
||||
{
|
||||
QofBook *book;
|
||||
@ -3667,7 +3667,7 @@ xaccAccountGetXxxBalanceAsOfDateInCurrency(Account *acc, time64 date,
|
||||
|
||||
priv = GET_PRIVATE(acc);
|
||||
return xaccAccountConvertBalanceToCurrencyAsOfDate(
|
||||
acc, fn(acc, date), priv->commodity, (gnc_commodity*)report_commodity, date);
|
||||
acc, fn(acc, date), priv->commodity, report_commodity, date);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3769,7 +3769,7 @@ xaccAccountGetXxxBalanceInCurrencyRecursive (const Account *acc,
|
||||
static gnc_numeric
|
||||
xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
||||
Account *acc, time64 date, xaccGetBalanceAsOfDateFn fn,
|
||||
gnc_commodity *report_commodity, gboolean include_children)
|
||||
const gnc_commodity *report_commodity, gboolean include_children)
|
||||
{
|
||||
gnc_numeric balance;
|
||||
|
||||
@ -3843,7 +3843,7 @@ xaccAccountGetPresentBalanceInCurrency (const Account *acc,
|
||||
{
|
||||
return xaccAccountGetXxxBalanceAsOfDateInCurrencyRecursive (
|
||||
(Account*)acc, gnc_time64_get_today_end (), xaccAccountGetBalanceAsOfDate,
|
||||
(gnc_commodity*)report_commodity,
|
||||
report_commodity,
|
||||
include_children);
|
||||
}
|
||||
|
||||
|
@ -584,8 +584,8 @@ gnc_numeric xaccAccountConvertBalanceToCurrency(
|
||||
const gnc_commodity *new_currency);
|
||||
gnc_numeric xaccAccountConvertBalanceToCurrencyAsOfDate(
|
||||
const Account *account, /* for book */
|
||||
gnc_numeric balance, gnc_commodity *balance_currency,
|
||||
gnc_commodity *new_currency, time64 date);
|
||||
gnc_numeric balance, const gnc_commodity *balance_currency,
|
||||
const gnc_commodity *new_currency, time64 date);
|
||||
|
||||
/* These functions get some type of balance in the desired commodity.
|
||||
'report_commodity' may be NULL to use the account's commodity. */
|
||||
|
@ -2406,8 +2406,8 @@ gnc_pricedb_lookup_nearest_in_time64(GNCPriceDB *db,
|
||||
|
||||
GNCPrice *
|
||||
gnc_pricedb_lookup_nearest_before_t64 (GNCPriceDB *db,
|
||||
gnc_commodity *c,
|
||||
gnc_commodity *currency,
|
||||
const gnc_commodity *c,
|
||||
const gnc_commodity *currency,
|
||||
time64 t)
|
||||
{
|
||||
GList *price_list;
|
||||
@ -2566,7 +2566,7 @@ direct_price_conversion (GNCPriceDB *db, const gnc_commodity *from,
|
||||
if (t == INT64_MAX)
|
||||
price = gnc_pricedb_lookup_latest(db, from, to);
|
||||
else if (before_date)
|
||||
price = gnc_pricedb_lookup_nearest_before_t64(db, (gnc_commodity*)from, (gnc_commodity*)to, t);
|
||||
price = gnc_pricedb_lookup_nearest_before_t64(db, from, to, t);
|
||||
else
|
||||
price = gnc_pricedb_lookup_nearest_in_time64(db, from, to, t);
|
||||
|
||||
|
@ -539,8 +539,8 @@ PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency_t64(GNCPriceDB *db,
|
||||
* @return A GNCPrice or NULL if no prices are found before t.
|
||||
*/
|
||||
GNCPrice * gnc_pricedb_lookup_nearest_before_t64 (GNCPriceDB *db,
|
||||
gnc_commodity *c,
|
||||
gnc_commodity *currency,
|
||||
const gnc_commodity *c,
|
||||
const gnc_commodity *currency,
|
||||
time64 t);
|
||||
|
||||
/** @brief Return the nearest price between the given commodity and any other
|
||||
|
Loading…
Reference in New Issue
Block a user