Changeset 71f0e10dee124f93351697f8c1fec7236b724e02

Show
Ignore:
Timestamp:
05/21/08 20:59:16 (3 months ago)
Author:
Rémi Denis-Courmont <rem@videolan.org>
git-committer:
Rémi Denis-Courmont <rem@videolan.org> 1211396356 +0300
git-parent:

[bb1fb263758ffb26e0d2887bb309d274972687c2]

git-author:
Rémi Denis-Courmont <rem@videolan.org> 1211396343 +0300
Message:

Remove unused i18n_atof

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_charset.h

    r6bc9799 r71f0e10  
    8282VLC_EXPORT( const char *, GetFallbackEncoding, ( void ) ); 
    8383 
    84 VLC_INTERNAL( double, i18n_atof, ( const char * ) ); 
    8584VLC_EXPORT( double, us_strtod, ( const char *, char ** ) ); 
    8685VLC_EXPORT( double, us_atof, ( const char * ) ); 
  • src/test/i18n_atof.c

    r6bc9799 r71f0e10  
    11/***************************************************************************** 
    2  * i18n_atof.c: Test for i18n_atof 
     2 * i18n_atof.c: Test for us_atof 
    33 ***************************************************************************** 
    44 * Copyright (C) 2006 Rémi Denis-Courmont 
     
    3737    char *end; 
    3838 
    39     assert (i18n_atof("0") == 0.); 
    40     assert (i18n_atof("1") == 1.); 
    41     assert (i18n_atof("1.") == 1.); 
    42     assert (i18n_atof("1,") == 1.); 
    43     assert (i18n_atof("1#") == 1.); 
    44     assert (i18n_atof(dot9) == 999999.999999); 
    45     assert (i18n_atof(comma9) == 999999.999999); 
    46     assert (i18n_atof(sharp9) == 999999.); 
    47     assert (i18n_atof("invalid") == 0.); 
    48  
    4939    assert (us_atof("0") == 0.); 
    5040    assert (us_atof("1") == 1.); 
  • src/text/charset.c

    r6bc9799 r71f0e10  
    378378 
    379379 
    380 static double i18n_strtod( const char *str, char **end ) 
    381 { 
    382     char *end_buf, e; 
    383     double d; 
    384  
    385     if( end == NULL ) 
    386         end = &end_buf; 
    387     d = strtod( str, end ); 
    388  
    389     e = **end; 
    390     if(( e == ',' ) || ( e == '.' )) 
    391     { 
    392         char dup[strlen( str ) + 1]; 
    393         strcpy( dup, str ); 
    394  
    395         if( dup == NULL ) 
    396             return d; 
    397  
    398         dup[*end - str] = ( e == ',' ) ? '.' : ','; 
    399         d = strtod( dup, end ); 
    400     } 
    401     return d; 
    402 } 
    403  
    404 /** 
    405  * i18n_atof() has the same prototype as ANSI C atof() but it accepts 
    406  * either decimal separator when deserializing the string to a float number, 
    407  * independant of the local computer setting. 
    408  */ 
    409 double i18n_atof( const char *str ) 
    410 { 
    411     return i18n_strtod( str, NULL ); 
    412 } 
    413  
    414  
    415380/** 
    416381 * us_strtod() has the same prototype as ANSI C strtod() but it expects