[vlc-devel] commit: Remove unused i18n_atof ( Rémi Denis-Courmont )

git version control git at videolan.org
Wed May 21 20:57:47 CEST 2008


vlc | branch: master | Rémi Denis-Courmont <rem at videolan.org> | Wed May 21 21:59:03 2008 +0300| [71f0e10dee124f93351697f8c1fec7236b724e02]

Remove unused i18n_atof

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=71f0e10dee124f93351697f8c1fec7236b724e02
---

 include/vlc_charset.h |    1 -
 src/test/i18n_atof.c  |   12 +-----------
 src/text/charset.c    |   35 -----------------------------------
 3 files changed, 1 insertions(+), 47 deletions(-)

diff --git a/include/vlc_charset.h b/include/vlc_charset.h
index 7899ccf..dad47de 100644
--- a/include/vlc_charset.h
+++ b/include/vlc_charset.h
@@ -81,7 +81,6 @@ VLC_INTERNAL( bool, vlc_current_charset, ( char ** ) );
 
 VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) );
 
-VLC_INTERNAL( double, i18n_atof, ( const char * ) );
 VLC_EXPORT( double, us_strtod, ( const char *, char ** ) );
 VLC_EXPORT( double, us_atof, ( const char * ) );
 
diff --git a/src/test/i18n_atof.c b/src/test/i18n_atof.c
index 7b8f7f6..c62619c 100644
--- a/src/test/i18n_atof.c
+++ b/src/test/i18n_atof.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * i18n_atof.c: Test for i18n_atof
+ * i18n_atof.c: Test for us_atof
  *****************************************************************************
  * Copyright (C) 2006 Rémi Denis-Courmont
  * $Id$
@@ -36,16 +36,6 @@ int main (void)
     const char sharp9[] = "999999#999999";
     char *end;
 
-    assert (i18n_atof("0") == 0.);
-    assert (i18n_atof("1") == 1.);
-    assert (i18n_atof("1.") == 1.);
-    assert (i18n_atof("1,") == 1.);
-    assert (i18n_atof("1#") == 1.);
-    assert (i18n_atof(dot9) == 999999.999999);
-    assert (i18n_atof(comma9) == 999999.999999);
-    assert (i18n_atof(sharp9) == 999999.);
-    assert (i18n_atof("invalid") == 0.);
-
     assert (us_atof("0") == 0.);
     assert (us_atof("1") == 1.);
     assert (us_atof("1.") == 1.);
diff --git a/src/text/charset.c b/src/text/charset.c
index f7de34c..a16d61c 100644
--- a/src/text/charset.c
+++ b/src/text/charset.c
@@ -377,41 +377,6 @@ char *vlc_fix_readdir( const char *psz_string )
 }
 
 
-static double i18n_strtod( const char *str, char **end )
-{
-    char *end_buf, e;
-    double d;
-
-    if( end == NULL )
-        end = &end_buf;
-    d = strtod( str, end );
-
-    e = **end;
-    if(( e == ',' ) || ( e == '.' ))
-    {
-        char dup[strlen( str ) + 1];
-        strcpy( dup, str );
-
-        if( dup == NULL )
-            return d;
-
-        dup[*end - str] = ( e == ',' ) ? '.' : ',';
-        d = strtod( dup, end );
-    }
-    return d;
-}
-
-/**
- * i18n_atof() has the same prototype as ANSI C atof() but it accepts
- * either decimal separator when deserializing the string to a float number,
- * independant of the local computer setting.
- */
-double i18n_atof( const char *str )
-{
-    return i18n_strtod( str, NULL );
-}
-
-
 /**
  * us_strtod() has the same prototype as ANSI C strtod() but it expects
  * a dot as decimal separator regardless of the system locale.




More information about the vlc-devel mailing list