[grisbi-cvs] [SCM] grisbi branch, grisbi-gtk3, updated. grisbi_gtk3_1_3_0-7-gba09254
Pierre Biava
nobody at users.sourceforge.net
Sat Jan 7 21:16:26 CET 2012
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".
The branch, grisbi-gtk3 has been updated
via ba09254bd7c40593f6e5e07e64fc84b162f60822 (commit)
via 4c1a0be922a3cbdd6052c82cc0cb03d4c9eab864 (commit)
via 6b28992acb80332d739f298ec63f511d246d77f5 (commit)
from eaac2c1b9313c0ec741de2aff40d88721d139134 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ba09254bd7c40593f6e5e07e64fc84b162f60822
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 21:13:47 2012 +0100
main.c: deleting a compilation warning
commit 4c1a0be922a3cbdd6052c82cc0cb03d4c9eab864
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 09:58:44 2012 +0100
csv_parse.c: formatting code
commit 6b28992acb80332d739f298ec63f511d246d77f5
Author: pbiava <pierre.biava at nerim.net>
Date: Sat Jan 7 08:34:48 2012 +0100
bet_graph.c: cleaning code
-----------------------------------------------------------------------
Changes:
diff --git a/src/bet_graph.c b/src/bet_graph.c
index 44e2fc0..f8e8263 100644
--- a/src/bet_graph.c
+++ b/src/bet_graph.c
@@ -581,7 +581,6 @@ gboolean bet_graph_affiche_camemberts ( struct_bet_graph_data *self )
gog_series_set_dim ( series, 0, data, &error );
if ( error != NULL )
{
- printf ("tab_vue_libelle_division : erreur = %s\n", error -> message);
g_error_free ( error );
error = NULL;
return FALSE;
@@ -591,7 +590,6 @@ gboolean bet_graph_affiche_camemberts ( struct_bet_graph_data *self )
gog_series_set_dim (series, 1, data, &error);
if ( error != NULL )
{
- printf ("tab_montant_division : erreur = %s\n", error -> message);
g_error_free ( error );
error = NULL;
return FALSE;
@@ -928,12 +926,26 @@ gboolean bet_graph_affiche_XY_line ( struct_bet_graph_data *self )
}
/* on met à jour les données à afficher */
+ gog_plot_clear_series ( GOG_PLOT ( cur_plot ) );
series = GOG_SERIES ( gog_plot_new_series ( GOG_PLOT ( cur_plot ) ) );
data = go_data_vector_str_new ( (const char * const*) self -> tab_vue_libelle, self -> nbre_elemnts, NULL );
gog_series_set_dim (series, 0, data, &error);
+ if ( error != NULL )
+ {
+ g_error_free ( error );
+ error = NULL;
+ return FALSE;
+ }
+
data = go_data_vector_val_new ( self->tab_Y, self->nbre_elemnts, NULL);
gog_series_set_dim (series, 1, data, &error);
+ if ( error != NULL )
+ {
+ g_error_free ( error );
+ error = NULL;
+ return FALSE;
+ }
return TRUE;
}
diff --git a/src/csv_parse.c b/src/csv_parse.c
index 00b57da..e582cfc 100644
--- a/src/csv_parse.c
+++ b/src/csv_parse.c
@@ -43,7 +43,7 @@
/*END_EXTERN*/
/*START_STATIC*/
-static gchar * sanitize_field ( gchar * begin, gchar * end );
+static gchar * sanitize_field ( gchar *begin, gchar *end );
/*END_STATIC*/
@@ -52,68 +52,72 @@ static gchar * sanitize_field ( gchar * begin, gchar * end );
*
*
*/
-GSList * csv_parse_line ( gchar ** contents, gchar * separator )
+GSList * csv_parse_line ( gchar **contents, gchar *separator )
{
- gchar * tmp = (* contents), * begin = tmp;
- gint is_unquoted = FALSE, len = strlen ( separator );
- GSList * list = NULL;
+ gchar *tmp = (*contents);
+ gchar *begin = tmp;
+ gint is_unquoted = FALSE;
+ gint len;
+ GSList *list = NULL;
+
+ len = strlen ( separator );
if ( *tmp == '\n' )
{
- *contents = tmp+1;
- return GINT_TO_POINTER(-1);
+ *contents = tmp + 1;
+ return GINT_TO_POINTER ( -1 );
}
if ( *tmp == '!' || *tmp == '#' || *tmp == ';' )
{
- *contents = strchr ( tmp, '\n' ) + 1;
- return GINT_TO_POINTER(-1);
+ *contents = strchr ( tmp, '\n' ) + 1;
+ return GINT_TO_POINTER(-1);
}
while ( *tmp )
{
- switch ( *tmp )
- {
- case '\n':
- list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
- *contents = tmp+1;
- return list;
-
- case '"':
- if ( ! is_unquoted )
- {
- tmp++;
- while ( *tmp )
- {
- /* This is lame escaping but we need to
- * support it. */
- if ( *tmp == '\\' && *(tmp+1) == '"' )
- {
- tmp += 2;
- }
-
- /* End of quoted string. */
- if ( *tmp == '"' && *(tmp+1) != '"' )
- {
- break;
- }
-
- tmp++;
- }
- }
-
- default:
- is_unquoted = TRUE;
- if ( !strncmp ( tmp, separator, len ) )
- {
- list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
- begin = tmp + len;
- is_unquoted = FALSE;
- }
- break;
- }
-
- tmp++;
+ switch ( *tmp )
+ {
+ case '\n':
+ list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
+ *contents = tmp+1;
+ return list;
+
+ case '"':
+ if ( ! is_unquoted )
+ {
+ tmp++;
+ while ( *tmp )
+ {
+ /* This is lame escaping but we need to
+ * support it. */
+ if ( *tmp == '\\' && *(tmp+1) == '"' )
+ {
+ tmp += 2;
+ }
+
+ /* End of quoted string. */
+ if ( *tmp == '"' && *(tmp+1) != '"' )
+ {
+ break;
+ }
+
+ tmp++;
+ }
+ }
+
+ default:
+ is_unquoted = TRUE;
+ if ( !strncmp ( tmp, separator, len ) )
+ {
+ list = g_slist_append ( list, sanitize_field ( begin, tmp ) );
+ begin = tmp + len;
+ is_unquoted = FALSE;
+ }
+ break;
+ }
+
+ tmp++;
}
return NULL;
@@ -125,42 +129,43 @@ GSList * csv_parse_line ( gchar ** contents, gchar * separator )
* TODO
*
*/
-gchar * sanitize_field ( gchar * begin, gchar * end )
+gchar *sanitize_field ( gchar *begin, gchar *end )
{
- gchar * field, * iter;
+ gchar *field;
+ gchar *iter;
g_return_val_if_fail ( begin <= end, NULL );
if ( end <= begin )
- return "";
+ return "";
iter = field = g_malloc0 ( end - begin + 1 );
/* Strip out intial white spaces. */
while ( *begin == ' ' )
- begin++;
+ begin++;
if ( *begin == '"' )
{
- begin++;
- while ( *end != '"' && end >= begin )
- end--;
+ begin++;
+ while ( *end != '"' && end >= begin )
+ end--;
}
while ( begin < end )
{
- if ( *begin == '"' && *(begin+1) == '"' )
- begin++;
+ if ( *begin == '"' && *(begin+1) == '"' )
+ begin++;
- if ( *begin == '\\' && *(begin+1) == '"' )
- begin++;
-
- *iter++ = *begin++;
+ if ( *begin == '\\' && *(begin+1) == '"' )
+ begin++;
+
+ *iter++ = *begin++;
}
/* Strip out remaining white spaces. */
while ( *(iter-1) == ' ' || *(iter-1) == '\n' )
- iter--;
+ iter--;
*iter = '\0';
@@ -168,10 +173,6 @@ gchar * sanitize_field ( gchar * begin, gchar * end )
}
-
-
-
-
/**
*
*
@@ -256,7 +257,6 @@ gboolean csv_import_validate_amount ( gchar * string )
}
-
/**
*
*
@@ -444,14 +444,13 @@ gboolean csv_import_parse_credit ( struct struct_ope_importation * ope, gchar *
g_return_val_if_fail ( string, FALSE );
if ( strlen ( string ) > 0 )
{
- ope -> montant = gsb_real_add ( ope -> montant,
- utils_real_get_from_string (string));
+ ope -> montant = gsb_real_add ( ope -> montant,
+ utils_real_get_from_string (string));
}
return TRUE;
}
-
/**
*
*
@@ -462,14 +461,13 @@ gboolean csv_import_parse_debit ( struct struct_ope_importation * ope, gchar * s
if ( strlen ( string ) > 0 )
{
- ope -> montant = gsb_real_sub ( ope -> montant,
- utils_real_get_from_string (string));
+ ope -> montant = gsb_real_sub ( ope -> montant,
+ utils_real_get_from_string (string));
}
return TRUE;
}
-
/**
*
*
diff --git a/src/main.c b/src/main.c
index 8e05e9b..d1e7e07 100644
--- a/src/main.c
+++ b/src/main.c
@@ -304,10 +304,6 @@ void main_mac_osx ( int argc, char **argv )
/* on commence par détourner le signal SIGSEGV */
gsb_main_trappe_signal_sigsegv ( );
- /* parse command line parameter, exit with correct error code when needed */
- if ( !parse_options (argc, argv, &opt, &status ) )
- exit ( status );
-
/* initialise les données de l'application */
first_use = gsb_main_init_app ( );
hooks/post-receive
--
grisbi
More information about the cvs
mailing list