[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_7_4-50-ga231611

Pierre Biava nobody at users.sourceforge.net
Sun Oct 24 09:08:57 CEST 2010


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, master has been updated
       via  a231611506c6597645f693f9bc0df4b5855ad488 (commit)
      from  df486c2fa52c35628874682e4ad909eebf0c662e (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 a231611506c6597645f693f9bc0df4b5855ad488
Author: pbiava <pierre.biava at nerim.net>
Date:   Sun Oct 24 09:07:03 2010 +0200

    deleting of gsb_str_to_real ()

-----------------------------------------------------------------------

Changes:
diff --git a/src/gsb_real.c b/src/gsb_real.c
index e056fcb..f05ab52 100644
--- a/src/gsb_real.c
+++ b/src/gsb_real.c
@@ -948,81 +948,6 @@ gboolean gsb_real_raw_truncate_number ( gint64 *mantissa, gint *exponent )
 }
 
 
-/* Function to transform string into gsb_real */
-gsb_real gsb_str_to_real ( const gchar * str )
-{
-	gchar *str2, **numb, **ff, **ss, *err;
-	gchar *sss, *ttt, *f, *s, *a, *b;
-	static gchar *space_chars;
-    static gchar *decimal_chars;
-	int decimals;
-	gint64 nombre;
-	gsb_real resu;
-	struct lconv *loc;
-
-	loc = localeconv();
-	decimal_chars = g_locale_to_utf8 ( g_strconcat ( ".", loc->mon_decimal_point, NULL ), -1, NULL, NULL, NULL );
-	space_chars =  g_locale_to_utf8 ( g_strconcat ( " ", loc->mon_thousands_sep, NULL ), -1, NULL, NULL, NULL );
-
-	if ( !g_utf8_validate ( str, -1, NULL ) )
-		str2 = g_locale_to_utf8 ( str, -1, NULL, NULL, NULL );
-	else
-		str2 = g_strdup ( str ) ;
-
-	if(!str2 || !g_utf8_strlen( str2 , -1 ))
-		return null_real;
-	numb = g_strsplit_set(str2, decimal_chars, 2);
-	g_free(str2);
-	g_free(decimal_chars);
-	if( !numb[0] || !g_utf8_strlen( numb[0] , -1 ))
-		a = g_strdup ( "0" );
-	else
-		a = g_strdup(numb[0]);
-	if( !numb[1] || !g_utf8_strlen( numb[1], -1 ))
-		b = g_strdup ( "0" );
-	else
-		b = g_strdup(numb[1]);
-	g_strfreev(numb);
-	ff = g_strsplit_set ( a , space_chars, -1);
-	ss = g_strsplit_set ( b , space_chars, -1);
-	g_free(a);
-	g_free(b);
-	g_free(space_chars);
-	f = g_strjoinv ("", ff);
-	s = g_strjoinv ("", ss);
-	g_strfreev ( ff );
-	g_strfreev ( ss );
-	decimals = strlen(s);
-	sss = g_strconcat(f, s, NULL);
-	ttt = g_convert(sss, -1, "ASCII", "UTF8", NULL, NULL, NULL);
-	g_free(f);
-	g_free(s);
-	errno = 0;
-	nombre = strtol(ttt, &err, 10);
-	if(errno == ERANGE)
-	{
-		g_free(err);
-		g_free(sss);
-		return error_real;
-	}
-	g_free(sss);
-	if( *err != '\0' )
-	{
-		return error_real;
-	}
-	if( !nombre )
-	return null_real;
-	while( (! (nombre % 10)) )
-	{
-		nombre /= 10;
-		decimals --;
-	}
-	resu.mantissa = nombre;
-	resu.exponent = decimals;
-	return resu;
-}
-
-
 gchar *gsb_real_save_real_to_string ( gsb_real number, gint default_exponent )
 {
     gchar buffer[G_ASCII_DTOSTR_BUF_SIZE];
diff --git a/src/gsb_real.h b/src/gsb_real.h
index bcd893a..a150607 100644
--- a/src/gsb_real.h
+++ b/src/gsb_real.h
@@ -50,6 +50,5 @@ gdouble gsb_real_real_to_double ( gsb_real number );
 gchar *gsb_real_save_real_to_string ( gsb_real number, gint default_exponent );
 gsb_real gsb_real_sub ( gsb_real number_1,
                         gsb_real number_2 );
-gsb_real gsb_str_to_real ( const gchar * str );
 /* END_DECLARATION */
 #endif


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list