@ -171,7 +171,7 @@ gchar *gnc_account_name_violations_errmsg (const gchar *separator, GList* invali
for ( node = invalid_account_names ; node ; node = g_list_next ( node ) )
{
if ( ! account_list )
account_list = node - > data ;
account_list = static_cast < gchar * > ( node - > data ) ;
else
{
gchar * tmp_list = NULL ;
@ -251,9 +251,9 @@ gnc_account_init(Account* acc)
priv - > parent = NULL ;
priv - > children = NULL ;
priv - > accountName = CACHE_INSERT ( " " ) ;
priv - > accountCode = CACHE_INSERT ( " " ) ;
priv - > description = CACHE_INSERT ( " " ) ;
priv - > accountName = static_cast < char * > ( qof_string_cache_insert ( " " ) ) ;
priv - > accountCode = static_cast < char * > ( qof_string_cache_insert ( " " ) ) ;
priv - > description = static_cast < char * > ( qof_string_cache_insert ( " " ) ) ;
priv - > type = ACCT_TYPE_NONE ;
@ -473,10 +473,10 @@ gnc_account_set_property (GObject *object,
break ;
case PROP_TYPE :
// NEED TO BE CONVERTED TO A G_TYPE_ENUM
xaccAccountSetType ( account , g_value_get_int ( value ) ) ;
xaccAccountSetType ( account , static_cast < GNCAccountType > ( g_value_get_int ( value ) ) ) ;
break ;
case PROP_COMMODITY :
xaccAccountSetCommodity ( account , g_value_get_object ( value ) ) ;
xaccAccountSetCommodity ( account , static_cast < gnc_commodity * > ( g_value_get_object ( value ) ) ) ;
break ;
case PROP_COMMODITY_SCU :
xaccAccountSetCommoditySCU ( account , g_value_get_int ( value ) ) ;
@ -491,19 +491,19 @@ gnc_account_set_property (GObject *object,
gnc_account_set_balance_dirty ( account ) ;
break ;
case PROP_START_BALANCE :
number = g_value_get_boxed ( value ) ;
number = static_cast < gnc_numeric * > ( g_value_get_boxed ( value ) ) ;
gnc_account_set_start_balance ( account , * number ) ;
break ;
case PROP_START_CLEARED_BALANCE :
number = g_value_get_boxed ( value ) ;
number = static_cast < gnc_numeric * > ( g_value_get_boxed ( value ) ) ;
gnc_account_set_start_cleared_balance ( account , * number ) ;
break ;
case PROP_START_RECONCILED_BALANCE :
number = g_value_get_boxed ( value ) ;
number = static_cast < gnc_numeric * > ( g_value_get_boxed ( value ) ) ;
gnc_account_set_start_reconciled_balance ( account , * number ) ;
break ;
case PROP_POLICY :
gnc_account_set_policy ( account , g_value_get_pointer ( value ) ) ;
gnc_account_set_policy ( account , static_cast < GNCPolicy * > ( g_value_get_pointer ( value ) ) ) ;
break ;
case PROP_MARK :
xaccAccountSetMark ( account , g_value_get_int ( value ) ) ;
@ -595,7 +595,7 @@ gnc_account_class_init (AccountClass *klass)
" repeated. but no two accounts that share "
" a parent may have the same name. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -606,7 +606,7 @@ gnc_account_class_init (AccountClass *klass)
" all its parent account names to indicate "
" a unique account. " ,
NULL ,
G_PARAM_READABLE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READABLE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -618,7 +618,7 @@ gnc_account_class_init (AccountClass *klass)
" be reporting code that is a synonym for "
" the accountName. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -630,7 +630,7 @@ gnc_account_class_init (AccountClass *klass)
" to be a longer, 1-5 sentence description of "
" what this account is all about. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -641,7 +641,7 @@ gnc_account_class_init (AccountClass *klass)
" by the user. It is intended to highlight the "
" account based on the users wishes. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -652,7 +652,7 @@ gnc_account_class_init (AccountClass *klass)
" for the user to attach any other text that "
" they would like to associate with the account. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -665,7 +665,7 @@ gnc_account_class_init (AccountClass *klass)
ACCT_TYPE_NONE ,
NUM_ACCOUNT_TYPES - 1 ,
ACCT_TYPE_BANK ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -676,7 +676,7 @@ gnc_account_class_init (AccountClass *klass)
" 'stuff' stored in this account, whether "
" it is USD, gold, stock, etc. " ,
GNC_TYPE_COMMODITY ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -691,7 +691,7 @@ gnc_account_class_init (AccountClass *klass)
0 ,
G_MAXINT32 ,
1000000 ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -704,7 +704,7 @@ gnc_account_class_init (AccountClass *klass)
" mismatched values in older versions of "
" GnuCash. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -719,7 +719,7 @@ gnc_account_class_init (AccountClass *klass)
" affect the sort order of the account. Note: "
" This value can only be set to TRUE. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -733,7 +733,7 @@ gnc_account_class_init (AccountClass *klass)
" the engine to say a split has been modified. "
" Note: This value can only be set to TRUE. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -749,7 +749,7 @@ gnc_account_class_init (AccountClass *klass)
" the 'starting balance' will represent the "
" summation of the splits up to that date. " ,
GNC_TYPE_NUMERIC ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -766,7 +766,7 @@ gnc_account_class_init (AccountClass *klass)
" balance' will represent the summation of the "
" splits up to that date. " ,
GNC_TYPE_NUMERIC ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -783,7 +783,7 @@ gnc_account_class_init (AccountClass *klass)
" balance' will represent the summation of the "
" splits up to that date. " ,
GNC_TYPE_NUMERIC ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -818,7 +818,7 @@ gnc_account_class_init (AccountClass *klass)
" the starting balance and all reconciled splits "
" in the account. " ,
GNC_TYPE_NUMERIC ,
G_PARAM_READABLE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READABLE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -826,7 +826,7 @@ gnc_account_class_init (AccountClass *klass)
g_param_spec_pointer ( " policy " ,
" Policy " ,
" The account lots policy. " ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -837,7 +837,7 @@ gnc_account_class_init (AccountClass *klass)
0 ,
G_MAXINT16 ,
0 ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -847,7 +847,7 @@ gnc_account_class_init (AccountClass *klass)
" Whether the account maps to an entry on an "
" income tax document. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -859,7 +859,7 @@ gnc_account_class_init (AccountClass *klass)
" United States it is used to transfer totals "
" into tax preparation software. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -868,7 +868,7 @@ gnc_account_class_init (AccountClass *klass)
" Tax Source " ,
" This specifies where exported name comes from. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -880,7 +880,7 @@ gnc_account_class_init (AccountClass *klass)
( gint64 ) 1 ,
G_MAXINT64 ,
( gint64 ) 1 ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -890,7 +890,7 @@ gnc_account_class_init (AccountClass *klass)
" Whether the account should be hidden in the "
" account tree. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -900,7 +900,7 @@ gnc_account_class_init (AccountClass *klass)
" Whether the account is a placeholder account which does not "
" allow transactions to be created, edited or deleted. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -910,7 +910,7 @@ gnc_account_class_init (AccountClass *klass)
" The account filter is a value saved to allow "
" filters to be recalled. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -920,7 +920,7 @@ gnc_account_class_init (AccountClass *klass)
" The account sort order is a value saved to allow "
" the sort order to be recalled. " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -929,7 +929,7 @@ gnc_account_class_init (AccountClass *klass)
" Account Sort Reversed " ,
" Parameter to store whether the sort order is reversed or not. " ,
FALSE ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -940,7 +940,7 @@ gnc_account_class_init (AccountClass *klass)
( gint64 ) 1 ,
G_MAXINT64 ,
( gint64 ) 1 ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -950,7 +950,7 @@ gnc_account_class_init (AccountClass *klass)
" The online account which corresponds to this "
" account for OFX import " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property (
gobject_class ,
@ -959,7 +959,7 @@ gnc_account_class_init (AccountClass *klass)
" Associated income account " ,
" Used by the OFX importer. " ,
GNC_TYPE_GUID ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -969,7 +969,7 @@ gnc_account_class_init (AccountClass *klass)
" The AqBanking account which corresponds to this "
" account for AQBanking import " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
PROP_AB_BANK_CODE ,
@ -978,7 +978,7 @@ gnc_account_class_init (AccountClass *klass)
" The online account which corresponds to this "
" account for AQBanking import " ,
NULL ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -989,7 +989,7 @@ gnc_account_class_init (AccountClass *klass)
( gint64 ) 1 ,
G_MAXINT64 ,
( gint64 ) 1 ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
g_object_class_install_property
( gobject_class ,
@ -999,7 +999,7 @@ gnc_account_class_init (AccountClass *klass)
" The time of the last transaction retrieval for this "
" account. " ,
GNC_TYPE_TIMESPEC ,
G_PARAM_READWRITE ) ) ;
static_cast < GParamFlags > ( G_PARAM_READWRITE ) ) ) ;
}
@ -1028,7 +1028,7 @@ static Account *
gnc_coll_get_root_account ( QofCollection * col )
{
if ( ! col ) return NULL ;
return qof_collection_get_data ( col ) ;
return static_cast < Account * > ( qof_collection_get_data ( col ) ) ;
}
static void
@ -1101,7 +1101,7 @@ xaccMallocAccount (QofBook *book)
g_return_val_if_fail ( book , NULL ) ;
acc = g_object_new ( GNC_TYPE_ACCOUNT , NULL ) ;
acc = static_cast < Account * > ( g_object_new ( GNC_TYPE_ACCOUNT , NULL ) ) ;
xaccInitAccount ( acc , book ) ;
qof_event_gen ( & acc - > inst , QOF_EVENT_CREATE , NULL ) ;
@ -1118,7 +1118,7 @@ gnc_account_create_root (QofBook *book)
rpriv = GET_PRIVATE ( root ) ;
xaccAccountBeginEdit ( root ) ;
rpriv - > type = ACCT_TYPE_ROOT ;
CACHE_REPLACE( rpriv - > accountName , " Root Account " ) ;
qof_string_cache_replace( ( void const * * ) ( & rpriv - > accountName ) , " Root Account " ) ;
mark_account ( root ) ;
xaccAccountCommitEdit ( root ) ;
gnc_book_set_root_account ( book , root ) ;
@ -1135,7 +1135,7 @@ xaccCloneAccount(const Account *from, QofBook *book)
g_return_val_if_fail ( QOF_IS_BOOK ( book ) , NULL ) ;
ENTER ( " " ) ;
ret = g_object_new ( GNC_TYPE_ACCOUNT , NULL ) ;
ret = static_cast < Account * > ( g_object_new ( GNC_TYPE_ACCOUNT , NULL ) ) ;
g_return_val_if_fail ( ret , NULL ) ;
from_priv = GET_PRIVATE ( from ) ;
@ -1147,9 +1147,9 @@ xaccCloneAccount(const Account *from, QofBook *book)
* Also let caller issue the generate_event ( EVENT_CREATE ) */
priv - > type = from_priv - > type ;
priv - > accountName = CACHE_INSERT ( from_priv - > accountName ) ;
priv - > accountCode = CACHE_INSERT ( from_priv - > accountCode ) ;
priv - > description = CACHE_INSERT ( from_priv - > description ) ;
priv - > accountName = static_cast < char * > ( qof_string_cache_insert ( from_priv - > accountName ) ) ;
priv - > accountCode = static_cast < char * > ( qof_string_cache_insert ( from_priv - > accountCode ) ) ;
priv - > description = static_cast < char * > ( qof_string_cache_insert ( from_priv - > description ) ) ;
qof_instance_copy_kvp ( QOF_INSTANCE ( ret ) , QOF_INSTANCE ( from ) ) ;
@ -1229,7 +1229,7 @@ xaccFreeAccount (Account *acc)
for ( lp = priv - > lots ; lp ; lp = lp - > next )
{
GNCLot * lot = lp - > data ;
GNCLot * lot = static_cast < GNCLot * > ( lp - > data ) ;
gnc_lot_destroy ( lot ) ;
}
g_list_free ( priv - > lots ) ;
@ -1261,15 +1261,16 @@ xaccFreeAccount (Account *acc)
*/
}
CACHE_REPLACE ( priv - > accountName , NULL ) ;
CACHE_REPLACE ( priv - > accountCode , NULL ) ;
CACHE_REPLACE ( priv - > description , NULL ) ;
qof_string_cache_remove ( priv - > accountName ) ;
qof_string_cache_remove ( priv - > accountCode ) ;
qof_string_cache_remove ( priv - > description ) ;
priv - > accountName = priv - > accountCode = priv - > description = nullptr ;
/* zero out values, just in case stray
* pointers are pointing here . */
priv - > parent = NULL ;
priv - > children = NULL ;
priv - > parent = nullptr ;
priv - > children = nullptr ;
priv - > balance = gnc_numeric_zero ( ) ;
priv - > cleared_balance = gnc_numeric_zero ( ) ;
@ -1327,7 +1328,7 @@ destroy_pending_splits_for_account(QofInstance *ent, gpointer acc)
Split * split ;
if ( xaccTransIsOpen ( trans ) )
while ( ( split = xaccTransFindSplitByAccount ( trans , acc ) ) )
while ( ( split = xaccTransFindSplitByAccount ( trans , static_cast < Account * > ( acc ) ) ) )
xaccSplitDestroy ( split ) ;
}
@ -1365,7 +1366,7 @@ xaccAccountCommitEdit (Account *acc)
slist = g_list_copy ( priv - > splits ) ;
for ( lp = slist ; lp ; lp = lp - > next )
{
Split * s = lp - > data ;
Split * s = static_cast < Split * > ( lp - > data ) ;
xaccSplitDestroy ( s ) ;
}
g_list_free ( slist ) ;
@ -1392,7 +1393,7 @@ xaccAccountCommitEdit (Account *acc)
/* the lots should be empty by now */
for ( lp = priv - > lots ; lp ; lp = lp - > next )
{
GNCLot * lot = lp - > data ;
GNCLot * lot = static_cast < GNCLot * > ( lp - > data ) ;
gnc_lot_destroy ( lot ) ;
}
}
@ -1455,7 +1456,7 @@ xaccAcctChildrenEqual(const GList *na,
while ( na )
{
Account * aa = na - > data ;
Account * aa = static_cast < Account * > ( na - > data ) ;
Account * ab ;
GList * node = g_list_find_custom ( ( GList * ) nb , aa ,
( GCompareFunc ) compare_account_by_name ) ;
@ -1465,7 +1466,7 @@ xaccAcctChildrenEqual(const GList *na,
PINFO ( " Unable to find matching child account. " ) ;
return FALSE ;
}
ab = node - > data ;
ab = static_cast < Account * > ( node - > data ) ;
if ( ! xaccAccountEqual ( aa , ab , check_guids ) )
{
char sa [ GUID_ENCODING_LENGTH + 1 ] ;
@ -1883,7 +1884,7 @@ xaccClearMarkDown (Account *acc, short val)
priv - > mark = val ;
for ( node = priv - > children ; node ; node = node - > next )
{
xaccClearMarkDown ( node - > data , val ) ;
xaccClearMarkDown ( static_cast < Account * > ( node - > data ) , val ) ;
}
}
@ -2254,7 +2255,7 @@ xaccAccountSetName (Account *acc, const char *str)
return ;
xaccAccountBeginEdit ( acc ) ;
CACHE_REPLACE( priv - > accountName , str ) ;
qof_string_cache_replace( ( void const * * ) ( & priv - > accountName ) , str ) ;
mark_account ( acc ) ;
xaccAccountCommitEdit ( acc ) ;
}
@ -2273,7 +2274,7 @@ xaccAccountSetCode (Account *acc, const char *str)
return ;
xaccAccountBeginEdit ( acc ) ;
CACHE_REPLACE( priv - > accountCode , str ? str : " " ) ;
qof_string_cache_replace( ( void const * * ) ( & priv - > accountCode ) , str ? str : " " ) ;
mark_account ( acc ) ;
xaccAccountCommitEdit ( acc ) ;
}
@ -2292,7 +2293,7 @@ xaccAccountSetDescription (Account *acc, const char *str)
return ;
xaccAccountBeginEdit ( acc ) ;
CACHE_REPLACE( priv - > description , str ? str : " " ) ;
qof_string_cache_replace( ( void const * * ) ( & priv - > description ) , str ? str : " " ) ;
mark_account ( acc ) ;
xaccAccountCommitEdit ( acc ) ;
}
@ -2691,7 +2692,7 @@ Account *
gnc_account_nth_child ( const Account * parent , gint num )
{
g_return_val_if_fail ( GNC_IS_ACCOUNT ( parent ) , NULL ) ;
return g_list_nth_data( GET_PRIVATE ( parent ) - > children , num ) ;
return static_cast < Account * > ( g_list_nth_data( GET_PRIVATE ( parent ) - > children , num ) ) ;
}
gint
@ -2706,7 +2707,7 @@ gnc_account_n_descendants (const Account *account)
priv = GET_PRIVATE ( account ) ;
for ( node = priv - > children ; node ; node = g_list_next ( node ) )
{
count + = gnc_account_n_descendants ( node - > data ) + 1 ;
count + = gnc_account_n_descendants ( static_cast < Account * > ( node - > data ) ) + 1 ;
}
return count ;
}
@ -2745,7 +2746,7 @@ gnc_account_get_tree_depth (const Account *account)
for ( node = priv - > children ; node ; node = g_list_next ( node ) )
{
child_depth = gnc_account_get_tree_depth ( node - > data ) ;
child_depth = gnc_account_get_tree_depth ( static_cast < Account const * > ( node - > data ) ) ;
depth = MAX ( depth , child_depth ) ;
}
return depth + 1 ;
@ -2768,7 +2769,7 @@ gnc_account_get_descendants (const Account *account)
{
descendants = g_list_append ( descendants , child - > data ) ;
descendants = g_list_concat ( descendants ,
gnc_account_get_descendants ( child - > data ) ) ;
gnc_account_get_descendants ( static_cast < Account const * > ( child - > data ) ) ) ;
}
return descendants ;
}
@ -2793,7 +2794,7 @@ gnc_account_get_descendants_sorted (const Account *account)
{
descendants = g_list_append ( descendants , child - > data ) ;
descendants = g_list_concat ( descendants ,
gnc_account_get_descendants_sorted ( child - > data ) ) ;
gnc_account_get_descendants_sorted ( static_cast < Account const * > ( child - > data ) ) ) ;
}
g_list_free ( children ) ;
return descendants ;
@ -2813,7 +2814,7 @@ gnc_account_lookup_by_name (const Account *parent, const char * name)
ppriv = GET_PRIVATE ( parent ) ;
for ( node = ppriv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
cpriv = GET_PRIVATE ( child ) ;
if ( g_strcmp0 ( cpriv - > accountName , name ) = = 0 )
return child ;
@ -2823,7 +2824,7 @@ gnc_account_lookup_by_name (const Account *parent, const char * name)
* Recursively search each of the child accounts next */
for ( node = ppriv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
result = gnc_account_lookup_by_name ( child , name ) ;
if ( result )
return result ;
@ -2846,7 +2847,7 @@ gnc_account_lookup_by_code (const Account *parent, const char * code)
ppriv = GET_PRIVATE ( parent ) ;
for ( node = ppriv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
cpriv = GET_PRIVATE ( child ) ;
if ( g_strcmp0 ( cpriv - > accountCode , code ) = = 0 )
return child ;
@ -2856,7 +2857,7 @@ gnc_account_lookup_by_code (const Account *parent, const char * code)
* Recursively search each of the child accounts next */
for ( node = ppriv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
result = gnc_account_lookup_by_code ( child , code ) ;
if ( result )
return result ;
@ -2884,7 +2885,7 @@ gnc_account_lookup_by_full_name_helper (const Account *parent,
ppriv = GET_PRIVATE ( parent ) ;
for ( node = ppriv - > children ; node ; node = node - > next )
{
Account * account = node - > data ;
Account * account = static_cast < Account * > ( node - > data ) ;
priv = GET_PRIVATE ( account ) ;
if ( g_strcmp0 ( priv - > accountName , names [ 0 ] ) = = 0 )
@ -2950,7 +2951,7 @@ gnc_account_foreach_child (const Account *acc,
priv = GET_PRIVATE ( acc ) ;
for ( node = priv - > children ; node ; node = node - > next )
{
thunk ( node - > data , user_data ) ;
thunk ( static_cast < Account * > ( node - > data ) , user_data ) ;
}
}
@ -2969,7 +2970,7 @@ gnc_account_foreach_descendant (const Account *acc,
priv = GET_PRIVATE ( acc ) ;
for ( node = priv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
thunk ( child , user_data ) ;
gnc_account_foreach_descendant ( child , thunk , user_data ) ;
}
@ -2991,7 +2992,7 @@ gnc_account_foreach_descendant_until (const Account *acc,
priv = GET_PRIVATE ( acc ) ;
for ( node = priv - > children ; node ; node = node - > next )
{
child = node - > data ;
child = static_cast < Account * > ( node - > data ) ;
result = thunk ( child , user_data ) ;
if ( result )
return ( result ) ;
@ -3040,7 +3041,6 @@ gnc_account_get_full_name(const Account *account)
AccountPrivate * priv ;
const Account * a ;
char * fullname ;
gchar * * names ;
int level ;
/* So much for hardening the API. Too many callers to this function don't
@ -3067,7 +3067,7 @@ gnc_account_get_full_name(const Account *account)
/* Get all the pointers in the right order. The root node "entry"
* becomes the terminating NULL pointer for the array of strings . */
names = g_malloc ( level * sizeof ( gchar * ) ) ;
gchar* names [ level * sizeof ( gchar * ) ] ;
names [ - - level ] = NULL ;
for ( a = account ; level > 0 ; a = priv - > parent )
{
@ -3077,7 +3077,6 @@ gnc_account_get_full_name(const Account *account)
/* Build the full name */
fullname = g_strjoinv ( account_separator , names ) ;
g_free ( names ) ;
return fullname ;
}
@ -3267,7 +3266,7 @@ xaccAccountGetProjectedMinimumBalance (const Account *acc)
today = gnc_time64_get_today_end ( ) ;
for ( node = g_list_last ( priv - > splits ) ; node ; node = node - > prev )
{
Split * split = node - > data ;
Split * split = static_cast < Split * > ( node - > data ) ;
if ( ! seen_a_transaction )
{
@ -3383,7 +3382,7 @@ xaccAccountGetPresentBalance (const Account *acc)
today = gnc_time64_get_today_end ( ) ;
for ( node = g_list_last ( priv - > splits ) ; node ; node = node - > prev )
{
Split * split = node - > data ;
Split * split = static_cast < Split * > ( node - > data ) ;
if ( xaccTransGetDate ( xaccSplitGetParent ( split ) ) < = today )
return xaccSplitGetBalance ( split ) ;
@ -3517,7 +3516,7 @@ typedef struct
static void
xaccAccountBalanceHelper ( Account * acc , gpointer data )
{
CurrencyBalance * cb = data ;
CurrencyBalance * cb = static_cast < CurrencyBalance * > ( data ) ;
gnc_numeric balance ;
if ( ! cb - > fn | | ! cb - > currency )
@ -3531,7 +3530,7 @@ xaccAccountBalanceHelper (Account *acc, gpointer data)
static void
xaccAccountBalanceAsOfDateHelper ( Account * acc , gpointer data )
{
CurrencyBalance * cb = data ;
CurrencyBalance * cb = static_cast < CurrencyBalance * > ( data ) ;
gnc_numeric balance ;
g_return_if_fail ( cb - > asOfDateFn & & cb - > currency ) ;
@ -3768,7 +3767,7 @@ xaccAccountFindOpenLots (const Account *acc,
priv = GET_PRIVATE ( acc ) ;
for ( lot_list = priv - > lots ; lot_list ; lot_list = lot_list - > next )
{
GNCLot * lot = lot_list - > data ;
GNCLot * lot = static_cast < GNCLot * > ( lot_list - > data ) ;
/* If this lot is closed, then ignore it */
if ( gnc_lot_is_closed ( lot ) )
@ -4111,7 +4110,7 @@ xaccAccountStringToEnum(const char* str)
/********************************************************************\
\ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
static char *
static char const *
account_type_name [ NUM_ACCOUNT_TYPES ] =
{
N_ ( " Bank " ) ,
@ -4763,7 +4762,7 @@ finder_help_function(const Account *acc, const char *description,
priv = GET_PRIVATE ( acc ) ;
for ( slp = g_list_last ( priv - > splits ) ; slp ; slp = slp - > prev )
{
Split * lsplit = slp - > data ;
Split * lsplit = static_cast < Split * > ( slp - > data ) ;
Transaction * ltrans = xaccSplitGetParent ( lsplit ) ;
if ( g_strcmp0 ( description , xaccTransGetDescription ( ltrans ) ) = = 0 )
@ -4821,7 +4820,7 @@ gnc_account_join_children (Account *to_parent, Account *from_parent)
ENTER ( " " ) ;
children = g_list_copy ( from_priv - > children ) ;
for ( node = children ; node ; node = g_list_next ( node ) )
gnc_account_append_child ( to_parent , node - > data ) ;
gnc_account_append_child ( to_parent , static_cast < Account * > ( node - > data ) ) ;
g_list_free ( children ) ;
LEAVE ( " " ) ;
}
@ -4839,12 +4838,12 @@ gnc_account_merge_children (Account *parent)
ppriv = GET_PRIVATE ( parent ) ;
for ( node_a = ppriv - > children ; node_a ; node_a = node_a - > next )
{
Account * acc_a = node_a - > data ;
Account * acc_a = static_cast < Account * > ( node_a - > data ) ;
priv_a = GET_PRIVATE ( acc_a ) ;
for ( node_b = node_a - > next ; node_b ; node_b = g_list_next ( node_b ) )
{
Account * acc_b = node_b - > data ;
Account * acc_b = static_cast < Account * > ( node_b - > data ) ;
priv_b = GET_PRIVATE ( acc_b ) ;
if ( 0 ! = null_strcmp ( priv_a - > accountName , priv_b - > accountName ) )
@ -4881,7 +4880,7 @@ gnc_account_merge_children (Account *parent)
/* consolidate transactions */
while ( priv_b - > splits )
xaccSplitSetAccount ( priv_b - > splits - > data , acc_a ) ;
xaccSplitSetAccount ( static_cast < Split * > ( priv_b - > splits - > data ) , acc_a ) ;
/* move back one before removal. next iteration around the loop
* will get the node after node_b */
@ -4906,7 +4905,7 @@ xaccSplitsBeginStagedTransactionTraversals (GList *splits)
for ( lp = splits ; lp ; lp = lp - > next )
{
Split * s = lp - > data ;
Split * s = static_cast < Split * > ( lp - > data ) ;
Transaction * trans = s - > parent ;
if ( trans )
@ -4987,7 +4986,7 @@ xaccAccountStagedTransactionTraversal (const Account *acc,
* a thunk removes splits from this account . */
next = g_list_next ( split_p ) ;
s = split_p - > data ;
s = static_cast < Split * > ( split_p - > data ) ;
trans = s - > parent ;
if ( trans & & ( trans - > marker < stage ) )
{
@ -5021,15 +5020,15 @@ gnc_account_tree_staged_transaction_traversal (const Account *acc,
priv = GET_PRIVATE ( acc ) ;
for ( acc_p = priv - > children ; acc_p ; acc_p = g_list_next ( acc_p ) )
{
retval = gnc_account_tree_staged_transaction_traversal ( acc_p - > data , stage ,
thunk , cb_data ) ;
retval = gnc_account_tree_staged_transaction_traversal ( static_cast < Account * > ( acc_p - > data ) ,
stage , thunk , cb_data ) ;
if ( retval ) return retval ;
}
/* Now this account */
for ( split_p = priv - > splits ; split_p ; split_p = g_list_next ( split_p ) )
{
s = split_p - > data ;
s = static_cast < Split * > ( split_p - > data ) ;
trans = s - > parent ;
if ( trans & & ( trans - > marker < stage ) )
{
@ -5294,7 +5293,7 @@ highestProbability(gpointer key, gpointer value, gpointer data)
{
/* Save the new highest probability and the assoaciated account guid */
account_i - > probability = GPOINTER_TO_INT ( value ) ;
account_i - > account_guid = key ;
account_i - > account_guid = static_cast < char * > ( key ) ;
}
}
@ -5370,8 +5369,8 @@ gnc_account_imap_find_account_bayes (GncImportMatchMap *imap, GList *tokens)
account_c - > account_guid , account_c - > token_count ,
tokenInfo . total_count ) ;
account_p = g_hash_table_lookup ( running_probabilities ,
account_c - > account_guid ) ;
account_p = static_cast < account_probability * > (
g_hash_table_lookup ( running_probabilities , account_c - > account_guid ) ) ;
/* if the account exists in the list then continue
* the running probablities
@ -5612,7 +5611,7 @@ build_bayes_layer_two (const char *key, const GValue *value, gpointer user_data)
g_free ( guid ) ;
imapInfo_node = g_malloc ( sizeof ( * imapInfo_node ) ) ;
imapInfo_node = static_cast < imap_info * > ( g_malloc ( sizeof ( * imapInfo_node ) ) ) ;
imapInfo_node - > source_account = imapInfo - > source_account ;
imapInfo_node - > map_account = map_account ;
@ -5688,7 +5687,7 @@ build_non_bayes (const char *key, const GValue *value, gpointer user_data)
PINFO ( " build_non_bayes: kvp_path is '%s' " , kvp_path ) ;
imapInfo_node = g_malloc ( sizeof ( * imapInfo_node ) ) ;
imapInfo_node = static_cast < imap_info * > ( g_malloc ( sizeof ( * imapInfo_node ) ) ) ;
imapInfo_node - > source_account = imapInfo - > source_account ;
imapInfo_node - > map_account = xaccAccountLookup ( guid , book ) ;
@ -5810,7 +5809,7 @@ look_for_old_separator_descendants (Account *root, gchar *full_name, const gchar
/* Go through list of top level accounts */
for ( ptr = top_accounts ; ptr ; ptr = g_list_next ( ptr ) )
{
const gchar * name = xaccAccountGetName ( ptr - > data ) ;
const gchar * name = xaccAccountGetName ( static_cast < Account const * > ( ptr - > data ) ) ;
// we are looking for the longest top level account that matches
if ( g_str_has_prefix ( full_name , name ) )
@ -5935,7 +5934,7 @@ convert_imap_account (Account *acc)
for ( node = imap_list ; node ; node = g_list_next ( node ) )
{
Account * map_account = NULL ;
GncImapInfo * imapInfo = node - > data ;
GncImapInfo * imapInfo = static_cast < GncImapInfo * > ( node - > data ) ;
// Lets start doing stuff
map_account = look_for_old_mapping ( imapInfo ) ;
@ -5980,7 +5979,7 @@ gnc_account_imap_convert_bayes (QofBook *book)
/* Go through list of accounts */
for ( ptr = accts ; ptr ; ptr = g_list_next ( ptr ) )
{
Account * acc = ptr - > data ;
Account * acc = static_cast < Account * > ( ptr - > data ) ;
convert_imap_account ( acc ) ;
}
@ -6020,7 +6019,7 @@ static QofObject account_object_def =
DI ( . interface_version = ) QOF_OBJECT_VERSION ,
DI ( . e_type = ) GNC_ID_ACCOUNT ,
DI ( . type_label = ) " Account " ,
DI ( . create = ) ( gpointer ) xaccMallocAccount ,
DI ( . create = ) ( void * ( * ) ( QofBook * ) ) xaccMallocAccount ,
DI ( . book_begin = ) NULL ,
DI ( . book_end = ) gnc_account_book_end ,
DI ( . is_dirty = ) qof_collection_is_dirty ,