Re-indentation of source code, next batch.

This also strips trailing whitespaces from lines where they existed.
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@18787 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2010-03-02 21:40:02 +00:00
parent b325f24c91
commit ce99c42871
20 changed files with 1224 additions and 1207 deletions

View File

@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -36,14 +36,16 @@ gmtime_r(const time_t *const timep, struct tm *p_tm)
static int time_mutex_inited = 0;
struct tm *tmp;
if (!time_mutex_inited) {
if (!time_mutex_inited)
{
time_mutex_inited = 1;
pthread_mutex_init(&time_mutex, NULL);
}
pthread_mutex_lock(&time_mutex);
tmp = gmtime(timep);
if (tmp) {
if (tmp)
{
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
@@ -57,10 +59,11 @@ gmtime_r(const time_t *const timep, struct tm *p_tm)
{
static struct tm* tmp;
tmp = gmtime(timep);
if (tmp) {
if (tmp)
{
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
}
return tmp;
}
#endif /* HAVE_PTHREAD_MUTEX_INIT */

View File

@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

View File

@@ -2,5 +2,5 @@ void gnc_libc_missing_noop (void);
void gnc_libc_missing_noop (void)
{
return;
return;
}

View File

@@ -11,24 +11,26 @@
struct tm *
localtime_r(const time_t *const timep, struct tm *p_tm)
{
static pthread_mutex_t time_mutex;
static int time_mutex_inited = 0;
struct tm *tmp;
static pthread_mutex_t time_mutex;
static int time_mutex_inited = 0;
struct tm *tmp;
if (!time_mutex_inited) {
time_mutex_inited = 1;
pthread_mutex_init(&time_mutex, NULL);
}
if (!time_mutex_inited)
{
time_mutex_inited = 1;
pthread_mutex_init(&time_mutex, NULL);
}
pthread_mutex_lock(&time_mutex);
tmp = localtime(timep);
if (tmp) {
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
pthread_mutex_unlock(&time_mutex);
pthread_mutex_lock(&time_mutex);
tmp = localtime(timep);
if (tmp)
{
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
pthread_mutex_unlock(&time_mutex);
return tmp;
return tmp;
}
#else
struct tm *
@@ -36,10 +38,11 @@ localtime_r(const time_t *const timep, struct tm *p_tm)
{
static struct tm* tmp;
tmp = localtime(timep);
if (tmp) {
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
if (tmp)
{
memcpy(p_tm, tmp, sizeof(struct tm));
tmp = p_tm;
}
return tmp;
}
#endif /* HAVE_PTHREAD_MUTEX_INIT */

View File

@@ -1,15 +1,15 @@
/* Copyright (C) 1995,1996,1997,1998, 1999, 2000 Free Software Foundation, Inc.
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
@@ -110,67 +110,67 @@ filltime (struct tm *bd_time, int zoff, char *zname);
static SCM
filltime (struct tm *bd_time, int zoff, char *zname)
{
SCM result = scm_make_vector (SCM_MAKINUM(11), SCM_UNDEFINED);
SCM result = scm_make_vector (SCM_MAKINUM(11), SCM_UNDEFINED);
SCM_VELTS (result)[0] = SCM_MAKINUM (bd_time->tm_sec);
SCM_VELTS (result)[1] = SCM_MAKINUM (bd_time->tm_min);
SCM_VELTS (result)[2] = SCM_MAKINUM (bd_time->tm_hour);
SCM_VELTS (result)[3] = SCM_MAKINUM (bd_time->tm_mday);
SCM_VELTS (result)[4] = SCM_MAKINUM (bd_time->tm_mon);
SCM_VELTS (result)[5] = SCM_MAKINUM (bd_time->tm_year);
SCM_VELTS (result)[6] = SCM_MAKINUM (bd_time->tm_wday);
SCM_VELTS (result)[7] = SCM_MAKINUM (bd_time->tm_yday);
SCM_VELTS (result)[8] = SCM_MAKINUM (bd_time->tm_isdst);
SCM_VELTS (result)[9] = SCM_MAKINUM (zoff);
SCM_VELTS (result)[10] = zname ? scm_makfrom0str (zname) : SCM_BOOL_F;
return result;
SCM_VELTS (result)[0] = SCM_MAKINUM (bd_time->tm_sec);
SCM_VELTS (result)[1] = SCM_MAKINUM (bd_time->tm_min);
SCM_VELTS (result)[2] = SCM_MAKINUM (bd_time->tm_hour);
SCM_VELTS (result)[3] = SCM_MAKINUM (bd_time->tm_mday);
SCM_VELTS (result)[4] = SCM_MAKINUM (bd_time->tm_mon);
SCM_VELTS (result)[5] = SCM_MAKINUM (bd_time->tm_year);
SCM_VELTS (result)[6] = SCM_MAKINUM (bd_time->tm_wday);
SCM_VELTS (result)[7] = SCM_MAKINUM (bd_time->tm_yday);
SCM_VELTS (result)[8] = SCM_MAKINUM (bd_time->tm_isdst);
SCM_VELTS (result)[9] = SCM_MAKINUM (zoff);
SCM_VELTS (result)[10] = zname ? scm_makfrom0str (zname) : SCM_BOOL_F;
return result;
}
#ifndef HAVE_STRPTIME
SCM_DEFINE (scm_strptime, "strptime", 2, 0, 0,
(SCM format, SCM string),
"Performs the reverse action to @code{strftime}, parsing @var{string}\n"
"according to the specification supplied in @var{template}. The\n"
"interpretation of month and day names is dependent on the current\n"
"locale. The\n"
"value returned is a pair. The CAR has an object with time components \n"
"in the form returned by @code{localtime} or @code{gmtime},\n"
"but the time zone components\n"
"are not usefully set.\n"
"The CDR reports the number of characters from @var{string} which\n"
"vwere used for the conversion.")
"Performs the reverse action to @code{strftime}, parsing @var{string}\n"
"according to the specification supplied in @var{template}. The\n"
"interpretation of month and day names is dependent on the current\n"
"locale. The\n"
"value returned is a pair. The CAR has an object with time components \n"
"in the form returned by @code{localtime} or @code{gmtime},\n"
"but the time zone components\n"
"are not usefully set.\n"
"The CDR reports the number of characters from @var{string} which\n"
"vwere used for the conversion.")
#define FUNC_NAME s_scm_strptime
{
struct tm t;
char *fmt, *str, *rest;
struct tm t;
char *fmt, *str, *rest;
SCM_VALIDATE_ROSTRING (1,format);
SCM_VALIDATE_ROSTRING (2,string);
SCM_VALIDATE_ROSTRING (1, format);
SCM_VALIDATE_ROSTRING (2, string);
SCM_COERCE_SUBSTR (format);
SCM_COERCE_SUBSTR (string);
fmt = SCM_ROCHARS (format);
str = SCM_ROCHARS (string);
SCM_COERCE_SUBSTR (format);
SCM_COERCE_SUBSTR (string);
fmt = SCM_ROCHARS (format);
str = SCM_ROCHARS (string);
/* initialize the struct tm */
/* initialize the struct tm */
#define tm_init(field) t.field = 0
tm_init (tm_sec);
tm_init (tm_min);
tm_init (tm_hour);
tm_init (tm_mday);
tm_init (tm_mon);
tm_init (tm_year);
tm_init (tm_wday);
tm_init (tm_yday);
tm_init (tm_sec);
tm_init (tm_min);
tm_init (tm_hour);
tm_init (tm_mday);
tm_init (tm_mon);
tm_init (tm_year);
tm_init (tm_wday);
tm_init (tm_yday);
#undef tm_init
t.tm_isdst = -1;
SCM_DEFER_INTS;
if ((rest = strptime (str, fmt, &t)) == NULL)
SCM_SYSERROR;
t.tm_isdst = -1;
SCM_DEFER_INTS;
if ((rest = strptime (str, fmt, &t)) == NULL)
SCM_SYSERROR;
SCM_ALLOW_INTS;
return scm_cons (filltime (&t, 0, NULL), SCM_MAKINUM (rest - str));
SCM_ALLOW_INTS;
return scm_cons (filltime (&t, 0, NULL), SCM_MAKINUM (rest - str));
}
#undef FUNC_NAME
#endif /* HAVE_STRPTIME */

View File

@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
@@ -47,46 +47,46 @@
int
setenv(const char *name, const char *value, int overwrite)
{
const char *old_value = getenv(name);
int result = 0;
const char *old_value = getenv(name);
int result = 0;
if ((name == NULL) || (value == NULL)) return -1;
if ((name == NULL) || (value == NULL)) return -1;
if(overwrite || (!old_value))
{
char *new_value = g_strdup_printf("%s=%s", name, value);
if(putenv(new_value) != 0) result = -1;
if(old_value)
if (overwrite || (!old_value))
{
/* for now, do nothing, but it would be nice if we could figure
out a safe way to reclaim any memory that *we* allocated,
taking in to account whether or not other code (in other
system libs) is allowed to have cached a pointer into the
value via getenv -- is that kosher?
Also we have to *know* that we allocated the memory.
*/
char *new_value = g_strdup_printf("%s=%s", name, value);
if (putenv(new_value) != 0) result = -1;
if (old_value)
{
/* for now, do nothing, but it would be nice if we could figure
out a safe way to reclaim any memory that *we* allocated,
taking in to account whether or not other code (in other
system libs) is allowed to have cached a pointer into the
value via getenv -- is that kosher?
Also we have to *know* that we allocated the memory.
*/
}
}
}
return result;
return result;
}
int
unsetenv(const char *name)
{
int result = 0;
char *putenv_str;
if(name == NULL) return -1;
if(strchr(name, '=') != NULL) return -1;
if(*name == '\0') return -1;
putenv_str = g_strdup_printf("%s=", name);
if(!putenv_str) return -1;
int result = 0;
char *putenv_str;
result = putenv(putenv_str);
g_free(putenv_str);
return result;
if (name == NULL) return -1;
if (strchr(name, '=') != NULL) return -1;
if (*name == '\0') return -1;
putenv_str = g_strdup_printf("%s=", name);
if (!putenv_str) return -1;
result = putenv(putenv_str);
g_free(putenv_str);
return result;
}
#endif

View File

@@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

File diff suppressed because it is too large Load Diff

View File

@@ -10,12 +10,12 @@
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA

View File

@@ -50,20 +50,20 @@ typedef struct _RecnWindow RecnWindow;
RecnWindow *recnWindow (gncUIWidget parent, Account *account);
/********************************************************************\
* recnWindowWithBalance
* recnWindowWithBalance
*
* Opens up the window to reconcile an account, but with ending
* balance and statement date already given.
*
*
* Args: parent - The parent widget of the new window
* account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* Return: recnData - the instance of this RecnWindow
\********************************************************************/
RecnWindow *recnWindowWithBalance (GtkWidget *parent,
Account *account,
gnc_numeric new_ending,
time_t statement_date);
RecnWindow *recnWindowWithBalance (GtkWidget *parent,
Account *account,
gnc_numeric new_ending,
time_t statement_date);
#endif

View File

@@ -339,7 +339,7 @@ gnc_sx_instance_new(GncSxInstances *parent, GncSxInstanceState state, GDate *dat
static gint
_compare_GncSxVariables(gconstpointer a, gconstpointer b)
{
return strcmp(((const GncSxVariable*)a)->name, ((const GncSxVariable*)b)->name);
return strcmp(((const GncSxVariable*)a)->name, ((const GncSxVariable*)b)->name);
}
static void

View File

@@ -243,9 +243,9 @@ xml_session_begin(QofBackend *be_start, QofSession *session,
rc = g_stat (be->dirname, &statbuf);
if (rc != 0
#ifndef _MSC_VER
|| !S_ISDIR(statbuf.st_mode)
|| !S_ISDIR(statbuf.st_mode)
#endif
)
)
{
/* Error on stat or if it isn't a directory means we
cannot find this filename */
@@ -273,9 +273,9 @@ xml_session_begin(QofBackend *be_start, QofSession *session,
}
if (rc == 0
#ifndef _MSC_VER
&& S_ISDIR(statbuf.st_mode)
&& S_ISDIR(statbuf.st_mode)
#endif
)
)
{
/* FIXME: What is actually checked here? Whether the
fullpath erroneously points to a directory or what?

View File

@@ -70,36 +70,36 @@
extern gboolean
gnc_verify_dialog(gncUIWidget parent,
gboolean yes_is_default,
const char *format, ...) G_GNUC_PRINTF (3, 4);
gboolean yes_is_default,
const char *format, ...) G_GNUC_PRINTF (3, 4);
extern gint
gnc_ok_cancel_dialog(gncUIWidget parent,
gint default_result,
const char *format, ...) G_GNUC_PRINTF (3,4);
gint default_result,
const char *format, ...) G_GNUC_PRINTF (3, 4);
extern void
gnc_warning_dialog(gncUIWidget parent,
const char *format, ...) G_GNUC_PRINTF (2, 3);
const char *format, ...) G_GNUC_PRINTF (2, 3);
extern void
gnc_error_dialog(GtkWidget *parent,
const char *format, ...) G_GNUC_PRINTF (2, 3);
const char *format, ...) G_GNUC_PRINTF (2, 3);
extern void
gnc_gnome_help (const char *file_name, const char *target_link);
int gnc_choose_radio_option_dialog (gncUIWidget parent,
const char *title,
const char *msg,
const char *button_name,
int default_value,
GList *radio_list);
const char *title,
const char *msg,
const char *button_name,
int default_value,
GList *radio_list);
gboolean gnc_dup_trans_dialog (gncUIWidget parent, time_t *date_p,
const char *num, char **out_num);
@@ -108,12 +108,12 @@ void gnc_stock_split_dialog (gncUIWidget parent, Account * initial);
typedef enum
{
GNC_PRICE_EDIT,
GNC_PRICE_NEW,
GNC_PRICE_EDIT,
GNC_PRICE_NEW,
} GNCPriceEditType;
void gnc_price_edit_dialog (gncUIWidget parent, QofSession *session,
GNCPrice *price, GNCPriceEditType type);
GNCPrice *price, GNCPriceEditType type);
GNCPrice* gnc_price_edit_by_guid (GtkWidget * parent, const GUID * guid);
void gnc_prices_dialog (gncUIWidget parent);
void gnc_commodities_dialog (gncUIWidget parent);

View File

@@ -991,9 +991,9 @@ impl_webkit_export_to_file( GncHtml* self, const char *filepath )
static void
impl_webkit_print( GncHtml* self )
{
extern void webkit_web_frame_print( WebKitWebFrame* frame );
extern GtkPrintOperationResult webkit_web_frame_print_full( WebKitWebFrame* frame,
GtkPrintOperation* op, GtkPrintOperationAction action, GError** error );
extern void webkit_web_frame_print( WebKitWebFrame * frame );
extern GtkPrintOperationResult webkit_web_frame_print_full( WebKitWebFrame * frame,
GtkPrintOperation * op, GtkPrintOperationAction action, GError** error );
GncHtmlWebkitPrivate* priv;
WebKitWebFrame* frame;
@@ -1006,17 +1006,18 @@ impl_webkit_print( GncHtml* self )
frame = webkit_web_view_get_main_frame( priv->web_view );
#if PRINT_WITH_OP
gtk_print_operation_set_unit( op, GTK_UNIT_POINTS );
gtk_print_operation_set_unit( op, GTK_UNIT_POINTS );
webkit_web_frame_print_full( frame, op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, &error );
g_object_unref( op );
if( error != NULL ) {
if ( error != NULL )
{
GtkWidget* window = gtk_widget_get_toplevel( GTK_WIDGET(priv->web_view) );
GtkWidget* dialog = gtk_message_dialog_new( GTK_WIDGET_TOPLEVEL(window) ? GTK_WINDOW(window) : NULL,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message );
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_CLOSE,
"%s", error->message );
g_error_free( error );
g_signal_connect( dialog, "response", G_CALLBACK(gtk_widget_destroy), NULL);

View File

@@ -765,7 +765,8 @@ static gboolean trans_property_list_verify_essentials(TransPropertyList* list, g
int i;
/* possible_errors lists the ways in which a list can fail this test. */
enum PossibleErrorTypes {NO_DATE, NO_AMOUNT, NUM_OF_POSSIBLE_ERRORS};
gchar* possible_errors[NUM_OF_POSSIBLE_ERRORS] = {
gchar* possible_errors[NUM_OF_POSSIBLE_ERRORS] =
{
N_("No date column."),
N_("No balance, deposit, or withdrawal column.")
};
@@ -857,7 +858,7 @@ static GncCsvTransLine* trans_property_list_to_trans(TransPropertyList* list, gc
QofBook* book = gnc_account_get_book(list->account);
gnc_commodity* currency = xaccAccountGetCommodity(list->account);
gnc_numeric amount = double_to_gnc_numeric(0.0, xaccAccountGetCommoditySCU(list->account),
GNC_RND_ROUND);
GNC_RND_ROUND);
/* This flag is set to TRUE if we can use the "Deposit" or "Withdrawal" column. */
gboolean amount_set = FALSE;
@@ -905,9 +906,9 @@ static GncCsvTransLine* trans_property_list_to_trans(TransPropertyList* list, gc
if (prop->value != NULL)
{
amount = gnc_numeric_add(*((gnc_numeric*)(prop->value)),
amount,
xaccAccountGetCommoditySCU(list->account),
GNC_RND_ROUND);
amount,
xaccAccountGetCommoditySCU(list->account),
GNC_RND_ROUND);
amount_set = TRUE;
/* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
trans_line->balance_set = FALSE;
@@ -918,9 +919,9 @@ static GncCsvTransLine* trans_property_list_to_trans(TransPropertyList* list, gc
if (prop->value != NULL)
{
amount = gnc_numeric_add(gnc_numeric_neg(*((gnc_numeric*)(prop->value))),
amount,
xaccAccountGetCommoditySCU(list->account),
GNC_RND_ROUND);
amount,
xaccAccountGetCommoditySCU(list->account),
GNC_RND_ROUND);
amount_set = TRUE;
/* We will use the "Deposit" and "Withdrawal" columns in preference to "Balance". */
trans_line->balance_set = FALSE;
@@ -957,7 +958,7 @@ static GncCsvTransLine* trans_property_list_to_trans(TransPropertyList* list, gc
* @return 0 on success, 1 on failure
*/
int gnc_csv_parse_to_trans(GncCsvParseData* parse_data, Account* account,
gboolean redo_errors)
gboolean redo_errors)
{
gboolean hasBalanceColumn;
int i, j, max_cols = 0;
@@ -1041,7 +1042,7 @@ gboolean redo_errors)
{
errors = TRUE;
error_message = g_strdup_printf(_("%s column could not be understood."),
_(gnc_csv_column_type_strs[property->type]));
_(gnc_csv_column_type_strs[property->type]));
trans_property_free(property);
break;
}
@@ -1061,7 +1062,7 @@ gboolean redo_errors)
if (errors)
{
parse_data->error_lines = g_list_append(parse_data->error_lines,
GINT_TO_POINTER(i));
GINT_TO_POINTER(i));
/* If there's already an error message, we need to replace it. */
if (line->len > (int)(parse_data->orig_row_lengths->data[i]))
{
@@ -1086,7 +1087,7 @@ gboolean redo_errors)
/* If we can just put it at the end, do so and increment last_transaction. */
if (last_transaction == NULL ||
xaccTransGetDate(((GncCsvTransLine*)(last_transaction->data))->trans) <= xaccTransGetDate(trans_line->trans))
xaccTransGetDate(((GncCsvTransLine*)(last_transaction->data))->trans) <= xaccTransGetDate(trans_line->trans))
{
parse_data->transactions = g_list_append(parse_data->transactions, trans_line);
/* If this is the first transaction, we need to get last_transaction on track. */
@@ -1100,7 +1101,7 @@ gboolean redo_errors)
{
GList* insertion_spot = last_transaction;
while (insertion_spot != NULL &&
xaccTransGetDate(((GncCsvTransLine*)(insertion_spot->data))->trans) > xaccTransGetDate(trans_line->trans))
xaccTransGetDate(((GncCsvTransLine*)(insertion_spot->data))->trans) > xaccTransGetDate(trans_line->trans))
{
insertion_spot = g_list_previous(insertion_spot);
}
@@ -1151,8 +1152,8 @@ gboolean redo_errors)
* imported. This will be sum of all the previous transactions for
* any given transaction. */
gnc_numeric balance_offset = double_to_gnc_numeric(0.0,
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
while (transactions != NULL)
{
GncCsvTransLine* trans_line = (GncCsvTransLine*)transactions->data;
@@ -1161,15 +1162,15 @@ gboolean redo_errors)
time_t date = xaccTransGetDate(trans_line->trans);
/* Find what the balance should be by adding the offset to the actual balance. */
gnc_numeric existing_balance = gnc_numeric_add(balance_offset,
xaccAccountGetBalanceAsOfDate(account, date),
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
xaccAccountGetBalanceAsOfDate(account, date),
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
/* The amount of the transaction is the difference between the new and existing balance. */
gnc_numeric amount = gnc_numeric_sub(trans_line->balance,
existing_balance,
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
existing_balance,
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
SplitList* splits = xaccTransGetSplitList(trans_line->trans);
while (splits)
@@ -1183,9 +1184,9 @@ gboolean redo_errors)
/* This new transaction needs to be added to the balance offset. */
balance_offset = gnc_numeric_add(balance_offset,
amount,
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
amount,
xaccAccountGetCommoditySCU(account),
GNC_RND_ROUND);
}
transactions = g_list_next(transactions);
}

View File

@@ -762,10 +762,10 @@ static void split_find_match (GNCImportTransInfo * trans_info,
/* Append that to the list. Do not use g_list_append because
it is slow. The list is sorted afterwards anyway. */
it is slow. The list is sorted afterwards anyway. */
trans_info->match_list =
g_list_prepend(trans_info->match_list,
match_info);
match_info);
}
}/* end split_find_match */

View File

@@ -449,7 +449,7 @@ qof_print_date_dmy_buff (char * buff, size_t len, int day, int month, int year)
tm_str.tm_mday = day;
tm_str.tm_mon = month - 1; /* tm_mon = 0 through 11 */
tm_str.tm_year = year - 1900; /* this is what the standard
* says, it's not a Y2K thing */
says, it's not a Y2K thing */
gnc_tm_set_day_start (&tm_str);
t = mktime (&tm_str);

View File

@@ -258,7 +258,7 @@ init_from_dir(const char *dirname, unsigned int max_files)
total += strlen(de);
result = g_snprintf(filename, sizeof(filename),
"%s/%s", dirname, de);
"%s/%s", dirname, de);
if ((result < 0) || (result >= (int)sizeof(filename)))
continue;
@@ -378,7 +378,7 @@ guid_init(void)
/* process and parent ids */
{
#ifdef HAVE_UNISTD_H
pid_t pid;
pid_t pid;
pid = getpid();
md5_process_bytes(&pid, sizeof(pid), &guid_context);
@@ -390,7 +390,7 @@ guid_init(void)
bytes += sizeof(pid);
#endif
#endif
}
}
/* user info */
{

View File

@@ -43,9 +43,10 @@
# include <sys/time.h>
#else
/* We simply define the struct timeval on our own here. */
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
struct timeval
{
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
/* include <Winsock2.h> */
#endif

View File

@@ -161,10 +161,10 @@ main(int argc, char ** argv)
gnc_module_system_init();
qof_backend_module_init();
qof_backend_module_init();
/* gnc_gnome_init (argc, argv, VERSION); */
/* gnc_gui_init(); */
/* scm_boot_guile(argc, argv, inner_main, 0); */
/* gnc_gnome_init (argc, argv, VERSION); */
/* gnc_gui_init(); */
/* scm_boot_guile(argc, argv, inner_main, 0); */
exit(0); /* never reached */
}