]> git.sesse.net Git - vlc/commitdiff
Remove unused i18n_atof
authorRémi Denis-Courmont <rem@videolan.org>
Wed, 21 May 2008 18:59:03 +0000 (21:59 +0300)
committerRémi Denis-Courmont <rem@videolan.org>
Wed, 21 May 2008 18:59:16 +0000 (21:59 +0300)
include/vlc_charset.h
src/test/i18n_atof.c
src/text/charset.c

index 7899ccfaeb86364b2dd1cc4e0b29cad9724f378b..dad47deb5fae9e8313a62213aca33d0ed633b80d 100644 (file)
@@ -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 * ) );
 
index 7b8f7f6c8f41bff6b1b085aeca7ef3e67eecbea4..c62619c001899affff2369cdcb0363ac66266744 100644 (file)
@@ -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.);
index f7de34c15901a384485053bd1c432ede3a985201..a16d61c94ac51e1fbe1ebe46aaaef71ef9b57047 100644 (file)
@@ -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.