C-style comment conventions; rename identifiers that are C++ keywords.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@12870 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled 2006-01-19 01:29:24 +00:00
parent 8906c31ef1
commit dafcbea15e
3 changed files with 24 additions and 19 deletions

View File

@ -1,3 +1,8 @@
2006-01-18 Joshua Sled <jsled@asynchronous.org>
* src/app-utils/gnc-account-merge.[ch]: C-style comment
conventions; rename identifiers that are C++ keywords.
2006-01-18 Joshua Sled <jsled@asynchronous.org>
* src/gnome/gnc-plugin-page-account-tree.c

View File

@ -1,4 +1,4 @@
// Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
/* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> */
#include "gnc-account-merge.h"
#include "Account.h"
@ -33,22 +33,22 @@ determine_merge_disposition(AccountGroup *existing_root, Account *new_acct)
}
static void
_account_merge_error_detection(AccountGroup *existing, AccountGroup *new, GList **error_accum)
_account_merge_error_detection(AccountGroup *existing_grp, AccountGroup *new_grp, GList **error_accum)
{
AccountList *accts;
for (accts = xaccGroupGetAccountList(new); accts; accts = accts->next)
for (accts = xaccGroupGetAccountList(new_grp); accts; accts = accts->next)
{
Account *new_acct, *existing_acct;
GncAccountMergeDisposition disp;
new_acct = (Account*)accts->data;
existing_acct = xaccGetAccountFromName(existing, xaccAccountGetName(new_acct));
existing_acct = xaccGetAccountFromName(existing_grp, xaccAccountGetName(new_acct));
disp = determine_account_merge_disposition(existing_acct, new_acct);
if (disp == GNC_ACCOUNT_MERGE_DISPOSITION_ERROR)
{
GncAccountMergeError *err = g_new0(GncAccountMergeError, 1);
err->existing = existing_acct;
err->new = new_acct;
err->existing_acct = existing_acct;
err->new_acct = new_acct;
err->disposition = disp;
*error_accum = g_list_append(*error_accum, err);
}
@ -59,10 +59,10 @@ _account_merge_error_detection(AccountGroup *existing, AccountGroup *new, GList
}
GList*
account_merge_error_detection(AccountGroup *existing, AccountGroup *new)
account_merge_error_detection(AccountGroup *existing_grp, AccountGroup *new_grp)
{
GList *errors = NULL;
_account_merge_error_detection(existing, new, &errors);
_account_merge_error_detection(existing_grp, new_grp, &errors);
return errors;
}
@ -74,9 +74,9 @@ account_group_merge(AccountGroup *existing_grp, AccountGroup *new_grp)
g_return_if_fail(new_grp != NULL);
g_return_if_fail(existing_grp != NULL);
// since we're have a chance of mutating the list (via
// xaccGroupInsertAccount) while we're iterating over it, iterate over a
// copy.
/* since we're have a chance of mutating the list (via
* xaccGroupInsertAccount) while we're iterating over it, iterate over a
* copy. */
accounts_copy = g_list_copy(xaccGroupGetAccountList(new_grp));
for (accounts = accounts_copy; accounts; accounts = accounts->next)
{
@ -92,12 +92,12 @@ account_group_merge(AccountGroup *existing_grp, AccountGroup *new_grp)
g_assert_not_reached();
return;
case GNC_ACCOUNT_MERGE_DISPOSITION_USE_EXISTING:
// recurse
/* recurse */
account_group_merge(xaccAccountGetChildren(existing_named),
xaccAccountGetChildren(new_acct));
break;
case GNC_ACCOUNT_MERGE_DISPOSITION_CREATE_NEW:
// merge this one in.
/* merge this one in. */
xaccGroupInsertAccount(existing_grp, new_acct);
break;
}

View File

@ -1,4 +1,4 @@
// Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org>
/* Copyright (C) 2006 Joshua Sled <jsled@asynchronous.org> */
#ifndef GNC_ACCOUNT_MERGE_H
#define GNC_ACCOUNT_MERGE_H
@ -13,17 +13,17 @@ typedef enum {
} GncAccountMergeDisposition;
typedef struct _merge_error {
Account *existing;
Account *new;
Account *existing_acct;
Account *new_acct;
GncAccountMergeDisposition disposition;
} GncAccountMergeError;
GncAccountMergeDisposition determine_account_merge_disposition(Account *existing_acct, Account *new_acct);
GncAccountMergeDisposition determine_merge_disposition(AccountGroup *existing_root, Account *new_acct);
/** @return GList<GncAccountMergerError> **/
GList* account_merge_error_detection(AccountGroup *existing, AccountGroup *new);
/** @return GList<GncAccountMergeError> **/
GList* account_merge_error_detection(AccountGroup *existing_grp, AccountGroup *new_grp);
void account_group_merge(AccountGroup *existing_grp, AccountGroup *new_grp);
#endif // GNC_ACCOUNT_MERGE_H
#endif /* GNC_ACCOUNT_MERGE_H */