Add some const where applicable.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21366 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2011-09-30 18:47:43 +00:00
parent 7ca4a0bb26
commit c8ecb4d937
2 changed files with 11 additions and 9 deletions

View File

@ -714,7 +714,9 @@ KvpFrame* gncOwnerGetSlots(GncOwner* owner)
static gboolean static gboolean
gnc_lot_match_invoice_owner (GNCLot *lot, gpointer user_data) gnc_lot_match_invoice_owner (GNCLot *lot, gpointer user_data)
{ {
GncOwner owner_def, *owner, *this_owner = user_data; GncOwner owner_def;
const GncOwner *owner;
const GncOwner *this_owner = user_data;
GncInvoice *invoice; GncInvoice *invoice;
/* If this lot is not for this owner, then ignore it */ /* If this lot is not for this owner, then ignore it */
@ -722,7 +724,7 @@ gnc_lot_match_invoice_owner (GNCLot *lot, gpointer user_data)
if (invoice) if (invoice)
{ {
owner = gncInvoiceGetOwner (invoice); owner = gncInvoiceGetOwner (invoice);
owner = gncOwnerGetEndOwner (owner); owner = gncOwnerGetEndOwner ((GncOwner*)owner);
} }
else else
{ {
@ -754,7 +756,7 @@ gnc_lot_sort_func (GNCLot *a, GNCLot *b)
* (bank or other asset) and the posted_account (A/R or A/P). * (bank or other asset) and the posted_account (A/R or A/P).
*/ */
Transaction * Transaction *
gncOwnerApplyPayment (GncOwner *owner, GncInvoice* invoice, gncOwnerApplyPayment (const GncOwner *owner, GncInvoice* invoice,
Account *posted_acc, Account *xfer_acc, Account *posted_acc, Account *xfer_acc,
gnc_numeric amount, gnc_numeric exch, Timespec date, gnc_numeric amount, gnc_numeric exch, Timespec date,
const char *memo, const char *num) const char *memo, const char *num)
@ -778,7 +780,7 @@ gncOwnerApplyPayment (GncOwner *owner, GncInvoice* invoice,
/* Compute the ancillary data */ /* Compute the ancillary data */
book = gnc_account_get_book (posted_acc); book = gnc_account_get_book (posted_acc);
name = gncOwnerGetName (gncOwnerGetEndOwner (owner)); name = gncOwnerGetName (gncOwnerGetEndOwner ((GncOwner*)owner));
commodity = gncOwnerGetCurrency (owner); commodity = gncOwnerGetCurrency (owner);
reverse = (gncOwnerGetType (owner) == GNC_OWNER_CUSTOMER); reverse = (gncOwnerGetType (owner) == GNC_OWNER_CUSTOMER);
@ -823,7 +825,7 @@ gncOwnerApplyPayment (GncOwner *owner, GncInvoice* invoice,
*/ */
fifo = xaccAccountFindOpenLots (posted_acc, gnc_lot_match_invoice_owner, fifo = xaccAccountFindOpenLots (posted_acc, gnc_lot_match_invoice_owner,
owner, (gpointer)owner,
(GCompareFunc)gnc_lot_sort_func); (GCompareFunc)gnc_lot_sort_func);
/* Check if an invoice was passed in, and if so, does it match the /* Check if an invoice was passed in, and if so, does it match the
@ -994,7 +996,7 @@ gncOwnerGetCommoditiesList (const GncOwner *owner)
* convert it to the desired currency. * convert it to the desired currency.
*/ */
gnc_numeric gnc_numeric
gncOwnerGetBalanceInCurrency (GncOwner *owner, gncOwnerGetBalanceInCurrency (const GncOwner *owner,
const gnc_commodity *report_currency) const gnc_commodity *report_currency)
{ {
gnc_numeric balance = gnc_numeric_zero (); gnc_numeric balance = gnc_numeric_zero ();
@ -1027,7 +1029,7 @@ gncOwnerGetBalanceInCurrency (GncOwner *owner,
/* Get a list of open lots for this owner and account */ /* Get a list of open lots for this owner and account */
lot_list = xaccAccountFindOpenLots (account, gnc_lot_match_invoice_owner, lot_list = xaccAccountFindOpenLots (account, gnc_lot_match_invoice_owner,
owner, (gpointer)owner,
(GCompareFunc)gnc_lot_sort_func); (GCompareFunc)gnc_lot_sort_func);
/* For each lot */ /* For each lot */
for (lot_node = lot_list; lot_node; lot_node = lot_node->next) for (lot_node = lot_list; lot_node; lot_node = lot_node->next)

View File

@ -185,7 +185,7 @@ KvpFrame* gncOwnerGetSlots(GncOwner* owner);
* payment to that invoice first before any other invoice. * payment to that invoice first before any other invoice.
*/ */
Transaction * Transaction *
gncOwnerApplyPayment (GncOwner *owner, GncInvoice *invoice, gncOwnerApplyPayment (const GncOwner *owner, GncInvoice *invoice,
Account *posted_acc, Account *xfer_acc, Account *posted_acc, Account *xfer_acc,
gnc_numeric amount, gnc_numeric exch, Timespec date, gnc_numeric amount, gnc_numeric exch, Timespec date,
const char *memo, const char *num); const char *memo, const char *num);
@ -201,7 +201,7 @@ GList * gncOwnerGetCommoditiesList (const GncOwner *owner);
* convert it to the desired currency. * convert it to the desired currency.
*/ */
gnc_numeric gnc_numeric
gncOwnerGetBalanceInCurrency (GncOwner *owner, gncOwnerGetBalanceInCurrency (const GncOwner *owner,
const gnc_commodity *report_currency); const gnc_commodity *report_currency);
#define OWNER_TYPE "type" #define OWNER_TYPE "type"