From 1de131ed1bf2419e4830dc5f1cd6082cbbbef146 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Thu, 20 Nov 2008 17:00:45 +0000 Subject: [PATCH] Fix compiler warning/error about incompatible function pointer type This is fixed by inserting a wrapper function whose pointer has the correct type as needed by g_list_find_custom. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17709 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-account-sel.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gnome-utils/gnc-account-sel.c b/src/gnome-utils/gnc-account-sel.c index acbabdcb99..f8c89fc0f2 100644 --- a/src/gnome-utils/gnc-account-sel.c +++ b/src/gnome-utils/gnc-account-sel.c @@ -231,6 +231,14 @@ gas_populate_list( GNCAccountSel *gas ) } } +/* Wrapper to offer the correct function declaration for + g_list_find_custom(), which needs void pointers instead of + gnc_commodity ones */ +static int gnc_commodity_compare_void(const void *a, const void *b) +{ + return gnc_commodity_compare(a, b); +} + static void gas_filter_accounts( gpointer data, gpointer user_data ) @@ -255,7 +263,7 @@ gas_filter_accounts( gpointer data, gpointer user_data ) if ( atnd->gas->acctCommodityFilters ) { if ( g_list_find_custom( atnd->gas->acctCommodityFilters, GINT_TO_POINTER(xaccAccountGetCommodity( a )), - gnc_commodity_compare) + gnc_commodity_compare_void) == NULL ) { return; }