Re-indentation of source code.

This re-indentation was done using astyle-1.24 using the following options:

astyle --indent=spaces=4 --brackets=break --pad-oper --pad-header --suffix=none

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19301 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming 2010-06-25 18:44:40 +00:00
parent 63eed826bd
commit 187da546b6
30 changed files with 232 additions and 207 deletions

View File

@ -60,7 +60,11 @@ sqlEscapeString (sqlEscape *b, const char *str)
ENTER("str = %s", str);
if (!b || !str) { LEAVE("(null) args"); return NULL; }
if (!b || !str)
{
LEAVE("(null) args");
return NULL;
}
/* if a string is escaped twice, just return the first */
if (b->escape == str)
@ -144,7 +148,11 @@ void
sqlEscape_destroy (sqlEscape *b)
{
ENTER(" ");
if (!b) { LEAVE("b is (null)"); return; }
if (!b)
{
LEAVE("b is (null)");
return;
}
g_free (b->escape);
b->escape = NULL;
g_free (b);

View File

@ -1249,7 +1249,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler string_handler
= {
=
{
load_string,
add_string_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1261,8 +1262,8 @@ typedef void (*IntSetterFunc)( const gpointer, gint );
static void
load_int( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
gint int_value;
@ -1297,7 +1298,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_int_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1312,7 +1313,7 @@ GList** pList )
static void
add_gvalue_int_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
gint int_value = 0;
IntAccessFunc i_getter;
@ -1346,7 +1347,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler int_handler
= {
=
{
load_int,
add_int_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1358,8 +1360,8 @@ typedef void (*BooleanSetterFunc)( const gpointer, gboolean );
static void
load_boolean( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
gint int_value;
@ -1394,7 +1396,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_boolean_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1409,7 +1411,7 @@ GList** pList )
static void
add_gvalue_boolean_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
gint int_value = 0;
BooleanAccessFunc b_getter;
@ -1443,7 +1445,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler boolean_handler
= {
=
{
load_boolean,
add_boolean_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1455,8 +1458,8 @@ typedef void (*Int64SetterFunc)( const gpointer, gint64 );
static void
load_int64( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
gint64 i64_value = 0;
@ -1485,7 +1488,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_int64_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1500,7 +1503,7 @@ GList** pList )
static void
add_gvalue_int64_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
gint64 i64_value = 0;
Int64AccessFunc getter;
@ -1533,7 +1536,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler int64_handler
= {
=
{
load_int64,
add_int64_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1543,8 +1547,8 @@ static GncSqlColumnTypeHandler int64_handler
static void
load_double( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
gdouble d_value;
@ -1592,7 +1596,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_double_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1607,7 +1611,7 @@ GList** pList )
static void
add_gvalue_double_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
QofAccessFunc getter;
gdouble* pDouble = NULL;
@ -1642,7 +1646,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler double_handler
= {
=
{
load_double,
add_double_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1652,8 +1657,8 @@ static GncSqlColumnTypeHandler double_handler
static void
load_guid( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
GncGUID guid;
@ -1691,7 +1696,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_guid_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1706,7 +1711,7 @@ GList** pList )
static void
add_gvalue_guid_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
QofAccessFunc getter;
const GncGUID* guid = NULL;
@ -1743,7 +1748,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler guid_handler
= {
=
{
load_guid,
add_guid_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1753,7 +1759,7 @@ static GncSqlColumnTypeHandler guid_handler
void
gnc_sql_add_gvalue_objectref_guid_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
QofAccessFunc getter;
const GncGUID* guid = NULL;
@ -1796,8 +1802,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
void
gnc_sql_add_objectref_guid_col_info_to_list( const GncSqlBackend* be,
const GncSqlColumnTableEntry* table_row,
GList** pList )
const GncSqlColumnTableEntry* table_row,
GList** pList )
{
add_guid_col_info_to_list( be, table_row, pList );
}
@ -1830,8 +1836,8 @@ gnc_sql_convert_timespec_to_string( const GncSqlBackend* be, Timespec ts )
static void
load_timespec( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
Timespec ts = {0, 0};
@ -1891,7 +1897,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_timespec_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -1906,7 +1912,7 @@ GList** pList )
static void
add_gvalue_timespec_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList )
{
TimespecAccessFunc ts_getter;
Timespec ts;
@ -1945,7 +1951,8 @@ const gpointer pObject, const GncSqlColumnTableEntry* table_row, GSList** pList
}
static GncSqlColumnTypeHandler timespec_handler
= {
=
{
load_timespec,
add_timespec_col_info_to_list,
gnc_sql_add_colname_to_list,
@ -1956,8 +1963,8 @@ static GncSqlColumnTypeHandler timespec_handler
static void
load_date( const GncSqlBackend* be, GncSqlRow* row,
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
/*@ null @*/ QofSetterFunc setter, gpointer pObject,
const GncSqlColumnTableEntry* table_row )
{
const GValue* val;
GDate* date;
@ -2016,7 +2023,7 @@ const GncSqlColumnTableEntry* table_row )
static void
add_date_col_info_to_list( const GncSqlBackend* be, const GncSqlColumnTableEntry* table_row,
GList** pList )
GList** pList )
{
GncSqlColumnInfo* info;
@ -2031,8 +2038,8 @@ GList** pList )
static void
add_gvalue_date_to_slist( const GncSqlBackend* be, QofIdTypeConst obj_name,
const gpointer pObject,
const GncSqlColumnTableEntry* table_row, GSList** pList )
const gpointer pObject,
const GncSqlColumnTableEntry* table_row, GSList** pList )
{
GDate* date = NULL;
QofAccessFunc getter;
@ -2070,7 +2077,8 @@ const GncSqlColumnTableEntry* table_row, GSList** pList )
}
static GncSqlColumnTypeHandler date_handler
= {
=
{
load_date,
add_date_col_info_to_list,
gnc_sql_add_colname_to_list,

View File

@ -105,13 +105,13 @@ static gchar *environment_expand(gchar *param)
gchar *closing_brace;
gchar *result;
gchar *tmp;
gchar *expanded=NULL;
gchar *expanded = NULL;
if (!param)
return NULL;
/* Set an initial return value, so we can always use g_strconcat below) */
result=g_strdup ("x");
result = g_strdup ("x");
/* Look for matching pairs of { and }. Anything in between should be expanded */
search_start = param;
@ -142,7 +142,7 @@ static gchar *environment_expand(gchar *param)
}
/* Expand the variable we found and append it to the result */
to_expand = g_strndup (opening_brace + 1, closing_brace - opening_brace -1);
to_expand = g_strndup (opening_brace + 1, closing_brace - opening_brace - 1);
env_val = g_getenv (to_expand);
tmp = g_strconcat (result, env_val, NULL);
g_free (result);
@ -173,7 +173,7 @@ environment_override()
{
const gchar *path;
gchar *env_file;
GKeyFile *keyfile=g_key_file_new();
GKeyFile *keyfile = g_key_file_new();
GError *error;
gchar **env_vars;
gsize param_count;

View File

@ -71,12 +71,14 @@ static GncSqlColumnTableEntry tt_col_table[] =
{ "guid", CT_GUID, 0, COL_NNUL | COL_PKEY, "guid" },
{ "name", CT_STRING, MAX_NAME_LEN, COL_NNUL, "name" },
{ "refcount", CT_INT64, 0, COL_NNUL, NULL, GNC_TT_REFCOUNT },
{ "invisible", CT_BOOLEAN, 0, COL_NNUL, NULL, NULL,
{
"invisible", CT_BOOLEAN, 0, COL_NNUL, NULL, NULL,
(QofAccessFunc)gncTaxTableGetInvisible, (QofSetterFunc)set_invisible
},
/* { "child", CT_TAXTABLEREF, 0, 0, NULL, NULL,
get_child, (QofSetterFunc)gncTaxTableSetChild }, */
{ "parent", CT_GUID, 0, 0, NULL, NULL,
{
"parent", CT_GUID, 0, 0, NULL, NULL,
(QofAccessFunc)bt_get_parent, tt_set_parent
},
{ NULL }

View File

@ -367,7 +367,8 @@ gnc_gbr_find_prefix (const gchar *default_prefix)
GtkOSXApplication* theApp = g_object_new (GTK_TYPE_OSX_APPLICATION, NULL);
gchar *id = gtk_osxapplication_get_bundle_id (theApp);
gchar *path = gtk_osxapplication_get_resource_path (theApp);
if (id == NULL) {
if (id == NULL)
{
gchar *dirname = g_path_get_dirname (path);
g_free (path);
g_free (id);

View File

@ -610,9 +610,11 @@ gnc_budget_get_default (QofBook *book)
OPTION_NAME_DEFAULT_BUDGET,
NULL);
if (kvp_default_budget != NULL ) {
if (kvp_default_budget != NULL )
{
default_budget_guid = kvp_value_get_guid(kvp_default_budget);
if (default_budget_guid != NULL) {
if (default_budget_guid != NULL)
{
col = qof_book_get_collection(book, GNC_ID_BUDGET);
bgt = (GncBudget *) qof_collection_lookup_entity(col,
default_budget_guid);
@ -621,7 +623,8 @@ gnc_budget_get_default (QofBook *book)
/* Revert to 2.2.x behavior if there is no defined budget in KVP */
if ( bgt == NULL ) {
if ( bgt == NULL )
{
col = qof_book_get_collection(book, GNC_ID_BUDGET);
if (qof_collection_count(col) > 0)
{

View File

@ -220,7 +220,7 @@ static gnc_quote_source multiple_quote_sources[] =
{ FALSE, 0, 0, "Nasdaq (Yahoo, ...)", "NASDAQ", "nasdaq" },
{ FALSE, 0, 0, "New Zealand (Yahoo, ...)", "NZ", "nz" },
{ FALSE, 0, 0, "NYSE (Yahoo, ...)", "NYSE", "nyse" },
/* { FALSE, 0, 0, "South Africa (Sharenet, ...)", "ZA", "za" }, */
/* { FALSE, 0, 0, "South Africa (Sharenet, ...)", "ZA", "za" }, */
{ FALSE, 0, 0, "T. Rowe Price", "TRPRICE", "troweprice" },
{ FALSE, 0, 0, "U.K. Unit Trusts", "UKUNITTRUSTS", "uk_unit_trusts" },
{ FALSE, 0, 0, "USA (Yahoo, Fool ...)", "USA", "usa" },

View File

@ -1168,7 +1168,7 @@ test_recursion (QofSession *original, guint counter)
copy = qof_session_new();
if (debug)
{
/* FIXME XML backend can't handle STDOUT
/* FIXME XML backend can't handle STDOUT
* qof_session_begin(copy, QOF_STDOUT, TRUE, FALSE); */
}
/* TODO: implement QOF_TYPE_CHOICE testing. */
@ -1190,7 +1190,7 @@ test_recursion (QofSession *original, guint counter)
do_test((f == c.collect), "Number of children in descendents does not match");
if (counter == 4 && debug == TRUE)
{
/* FIXME XML backend can't handle STDOUT
/* FIXME XML backend can't handle STDOUT
* qof_session_save(copy, NULL);
qof_session_save(original, NULL); */
}
@ -1213,7 +1213,7 @@ main (int argc, const char *argv[])
original = qof_session_new();
if (debug)
{
/* FIXME XML backend can't handle STDOUT
/* FIXME XML backend can't handle STDOUT
* qof_session_begin(original, QOF_STDOUT, TRUE, FALSE); */
}
create_data(original, (counter % 5));

View File

@ -573,12 +573,12 @@ gnc_post_file_open (const char * filename)
char * newfile;
QofBackendError io_err = ERR_BACKEND_NO_ERR;
gchar *protocol=NULL;
gchar *hostname=NULL;
gchar *username=NULL;
gchar *password=NULL;
gchar *path=NULL;
gint32 port=0;
gchar *protocol = NULL;
gchar *hostname = NULL;
gchar *username = NULL;
gchar *password = NULL;
gchar *path = NULL;
gint32 port = 0;
ENTER(" ");
@ -1072,12 +1072,12 @@ gnc_file_do_save_as (const char* filename)
char *newfile;
const char *oldfile;
gchar *protocol=NULL;
gchar *hostname=NULL;
gchar *username=NULL;
gchar *password=NULL;
gchar *path=NULL;
gint32 port=0;
gchar *protocol = NULL;
gchar *hostname = NULL;
gchar *username = NULL;
gchar *password = NULL;
gchar *path = NULL;
gint32 port = 0;
QofBackendError io_err = ERR_BACKEND_NO_ERR;

View File

@ -1572,7 +1572,8 @@ gnc_main_window_update_radio_button (GncMainWindow *window)
/* Block the signal so as not to affect window ordering (top to
* bottom) on the screen */
action_list = gtk_radio_action_get_group(GTK_RADIO_ACTION(action));
if (action_list) {
if (action_list)
{
first_action = g_slist_last(action_list)->data;
g_signal_handlers_block_by_func(G_OBJECT(first_action),
G_CALLBACK(gnc_main_window_cmd_window_raise),

View File

@ -135,7 +135,9 @@ gnc_html_webkit_init( GncHtmlWebkit* self )
if (default_font_family == NULL)
{
PWARN("webkit_settings: Cannot get default font family.");
}else{
}
else
{
g_object_set (G_OBJECT(webkit_settings),
"default-font-family", default_font_family,
NULL);
@ -562,7 +564,7 @@ webkit_navigation_requested_cb( WebKitWebView* web_view, WebKitWebFrame* frame,
}
type = gnc_html_parse_url( GNC_HTML(self), url, &location, &label );
if( strcmp( type, "file" ) == 0 )
if ( strcmp( type, "file" ) == 0 )
{
LEAVE("URI type is 'file'");
return WEBKIT_NAVIGATION_RESPONSE_ACCEPT;

View File

@ -160,7 +160,7 @@ gnc_basic_cell_has_type_name (BasicCell *cell, const gchar *type_name)
{
if (!cell) return FALSE;
if (!type_name) return FALSE;
if(!cell->cell_type_name) return FALSE;
if (!cell->cell_type_name) return FALSE;
return (g_strcmp0 (type_name, cell->cell_type_name));
}

View File

@ -1218,7 +1218,7 @@ gnucash_sheet_check_direct_update_cell(GnucashSheet *sheet,
type_name = gnc_table_get_cell_type_name (sheet->table, virt_loc);
if( (g_strcmp0 (type_name, DATE_CELL_TYPE_NAME) == 0)
if ( (g_strcmp0 (type_name, DATE_CELL_TYPE_NAME) == 0)
|| (g_strcmp0 (type_name, COMBO_CELL_TYPE_NAME) == 0)
|| (g_strcmp0 (type_name, NUM_CELL_TYPE_NAME) == 0)
|| (g_strcmp0 (type_name, PRICE_CELL_TYPE_NAME) == 0)
@ -1918,7 +1918,7 @@ gnucash_sheet_key_press_event (GtkWidget *widget, GdkEventKey *event)
else
{
sheet->shift_state = event->state & GDK_SHIFT_MASK;
sheet->keyval_state = (event->keyval == GDK_KP_Decimal)? GDK_KP_Decimal:0;
sheet->keyval_state = (event->keyval == GDK_KP_Decimal) ? GDK_KP_Decimal : 0;
}
if (gtk_im_context_filter_keypress (sheet->im_context, event))
{