Commit 71f0e10d authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Remove unused i18n_atof

parent bb1fb263
......@@ -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 * ) );
......
/*****************************************************************************
* 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.);
......
......@@ -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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment