Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (5)
Showing
with 126 additions and 50 deletions
......@@ -349,11 +349,87 @@ static inline char *FromLatin1 (const char *latin)
* \defgroup c_locale C/POSIX locale functions
* @{
*/
VLC_API double us_strtod( const char *, char ** ) VLC_USED;
VLC_API float us_strtof( const char *, char ** ) VLC_USED;
VLC_API double us_atof( const char * ) VLC_USED;
VLC_API int us_vasprintf( char **, const char *, va_list );
VLC_API int us_asprintf( char **, const char *, ... ) VLC_USED;
/**
* Parses a double in C locale.
*
* This function parses a double-precision floating point number from a string
* just like the standard strtod() but it uses the C locale. In other words, it
* expects the POSIX/C/American decimal format regardless of the current
* numeric locale.
*
* \param str nul-terminated string to parse
* \param[out] end storage space for a pointer to the first unparsed byte
* (or NULL to discard it)
* \return the parsed double value (zero if no character could be parsed)
*/
VLC_API double vlc_strtod_c(const char *restrict str, char **restrict end)
VLC_USED;
/**
* Parses a float in C locale.
*
* This function parses a single-precision floating point number from a string
* just like the standard strtof() but it uses the C locale. In other words, it
* expects the POSIX/C/American decimal format regardless of the current
* numeric locale.
*
* \param str nul-terminated string to parse
* \param[out] end storage space for a pointer to the first unparsed byte
* (or NULL to discard it)
* \return the parsed double value (zero if no character could be parsed)
*/
VLC_API float vlc_strtof_c(const char *restrict str, char **restrict end)
VLC_USED;
/**
* Parses a double in C locale.
*
* This function parses a double-precision floating point number from a string
* just like the standard atof() but it uses the C locale. In other words, it
* expects the POSIX/C/American decimal format regardless of the current
* numeric locale.
*
* \param str nul-terminated string to parse
* \return the parsed double value (zero if no character could be parsed)
*/
VLC_USED static inline double vlc_atof_c(const char *str)
{
return vlc_strtod_c(str, NULL);
}
/**
* Formats a string using the C locale.
*
* This function formats a string from a format string and a variable argument
* list, just like the standard vasprintf() but using the C locale for the
* formatting of numerals.
*
* \param[out] p storage space for a pointer to the heap-allocated formatted
* string (undefined on error)
* \param fmt format string
* \param ap variable argument list
* \return number of bytes formatted (excluding the nul terminator)
* or -1 on error
*/
VLC_API int vlc_vasprintf_c(char **restrict p, const char *restrict fmt,
va_list ap) VLC_USED;
/**
* Formats a string using the C locale.
*
* This function formats a string from a format string and a variable argument
* list, just like the standard vasprintf() but using the C locale for the
* formatting of numerals.
*
* \param[out] p storage space for a pointer to the heap-allocated formatted
* string (undefined on error)
* \param fmt format string
* \return number of bytes formatted (excluding the nul terminator)
* or -1 on error
*/
VLC_API int vlc_asprintf_c( char **, const char *, ... ) VLC_USED;
/** @} */
/** @} */
......
......@@ -175,7 +175,7 @@ nop:
/* Check for a "vlc://pause:***" command */
if( !strncasecmp( psz_name, "pause:", 6 ) )
{
double f = us_atof( psz_name + 6 );
double f = vlc_atof_c( psz_name + 6 );
vlc_tick_t length = vlc_tick_from_sec( f );
msg_Info( p_demux, "command `pause %f'", f );
......
......@@ -729,7 +729,7 @@ static void closeCurrentSegment( sout_access_out_t *p_access, sout_access_out_sy
vlc_close( p_sys->i_handle );
p_sys->i_handle = -1;
if( us_asprintf( &segment->psz_duration, "%.2f", secf_from_vlc_tick( p_sys->current_segment_length ) ) == -1 )
if( vlc_asprintf_c( &segment->psz_duration, "%.2f", secf_from_vlc_tick( p_sys->current_segment_length ) ) == -1 )
{
msg_Err( p_access, "Couldn't set duration on closed segment");
return;
......
......@@ -547,7 +547,7 @@ static int BandsCallback( vlc_object_t *p_this, char const *psz_cmd,
{
char *next;
/* Read dB -20/20 */
float f = us_strtof( p, &next );
float f = vlc_strtof_c( p, &next );
if( next == p || isnan( f ) )
break; /* no conversion */
......
......@@ -277,7 +277,7 @@ static bool getRDFFloat(const char *psz_rdf, float *out, const char *psz_var)
if (unlikely(p_end == NULL || p_end == p_start + 1))
return false;
*out = us_strtof(p_start, NULL);
*out = vlc_strtof_c(p_start, NULL);
return true;
}
......
......@@ -223,7 +223,7 @@ static ttml_length_t ttml_read_length( const char *psz )
ttml_length_t len = { 0.0, TTML_UNIT_UNKNOWN };
char* psz_end = NULL;
float size = us_strtof( psz, &psz_end );
float size = vlc_strtof_c( psz, &psz_end );
len.i_value = size;
if( psz_end )
{
......
......@@ -106,7 +106,7 @@ static tt_time_t tt_ParseTime( const char *s )
else /* Offset Time */
{
char *psz_end = (char *) s;
double v = us_strtod( s, &psz_end );
double v = vlc_strtod_c( s, &psz_end );
if( psz_end != s && *psz_end )
{
if( *psz_end == 'm' )
......
......@@ -625,7 +625,7 @@ static void ParseVorbisComments( decoder_t *p_dec )
audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
r->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = true;
r->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = us_atof( psz_value );
r->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = vlc_atof_c( psz_value );
}
else if( !strcasecmp( psz_name, "REPLAYGAIN_TRACK_PEAK" ) ||
!strcasecmp( psz_name, "RG_PEAK" ) )
......@@ -633,7 +633,7 @@ static void ParseVorbisComments( decoder_t *p_dec )
audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
r->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = true;
r->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = us_atof( psz_value );
r->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = vlc_atof_c( psz_value );
}
else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_GAIN" ) ||
!strcasecmp( psz_name, "RG_AUDIOPHILE" ) )
......@@ -641,14 +641,14 @@ static void ParseVorbisComments( decoder_t *p_dec )
audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
r->pb_gain[AUDIO_REPLAY_GAIN_ALBUM] = true;
r->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = us_atof( psz_value );
r->pf_gain[AUDIO_REPLAY_GAIN_ALBUM] = vlc_atof_c( psz_value );
}
else if( !strcasecmp( psz_name, "REPLAYGAIN_ALBUM_PEAK" ) )
{
audio_replay_gain_t *r = &p_dec->fmt_out.audio_replay_gain;
r->pb_peak[AUDIO_REPLAY_GAIN_ALBUM] = true;
r->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = us_atof( psz_value );
r->pf_peak[AUDIO_REPLAY_GAIN_ALBUM] = vlc_atof_c( psz_value );
}
else if( !strcasecmp( psz_name, "METADATA_BLOCK_PICTURE" ) )
{ /* Do nothing, for now */ }
......
......@@ -32,10 +32,10 @@
# include "config.h"
#endif
#include <vlc_common.h>
#include <vlc_charset.h>
#include "css_parser.h"
#include "CSSGrammar.h"
#define VAL(a, b) { yylval->term.val = (a); yylval->term.type = TYPE_ ## b; }
#define us_strtof strtof
char *d;
%}
......@@ -79,24 +79,24 @@ range \?{1,6}|{h}(\?{0,5}|{h}(\?{0,4}|{h}(\?{0,3}|{h}(\?{0,2}|{h}(\??|{h})))))
"!{w}important" {return IMPORTANT_SYM;}
{num}em { VAL( us_strtof(yytext, &d), EMS ); return LENGTH;}
{num}em { VAL( vlc_strtof_c(yytext, &d), EMS ); return LENGTH;}
{num}ex { VAL( atoi(yytext), EXS ); return LENGTH;}
{num}px { VAL( atoi(yytext), PIXELS ); return LENGTH;}
{num}cm { VAL( us_strtof(yytext, &d) * 10, MILLIMETERS ); return LENGTH;}
{num}cm { VAL( vlc_strtof_c(yytext, &d) * 10, MILLIMETERS ); return LENGTH;}
{num}mm { VAL( atoi(yytext), MILLIMETERS ); return LENGTH;}
{num}in { VAL( us_strtof(yytext, &d) * 25.4, MILLIMETERS ); return LENGTH;}
{num}pt { VAL( us_strtof(yytext, &d), POINTS ); return LENGTH;}
{num}pc { VAL( us_strtof(yytext, &d), POINTS ); return LENGTH;}
{num}deg { VAL( us_strtof(yytext, &d), DEGREES ); return ANGLE;}
{num}rad { VAL( us_strtof(yytext, &d) * 0.0174533, DEGREES ); return ANGLE;}
{num}grad { VAL( us_strtof(yytext, &d) * 1.1111111, DEGREES ); return ANGLE;}
{num}in { VAL( vlc_strtof_c(yytext, &d) * 25.4, MILLIMETERS ); return LENGTH;}
{num}pt { VAL( vlc_strtof_c(yytext, &d), POINTS ); return LENGTH;}
{num}pc { VAL( vlc_strtof_c(yytext, &d), POINTS ); return LENGTH;}
{num}deg { VAL( vlc_strtof_c(yytext, &d), DEGREES ); return ANGLE;}
{num}rad { VAL( vlc_strtof_c(yytext, &d) * 0.0174533, DEGREES ); return ANGLE;}
{num}grad { VAL( vlc_strtof_c(yytext, &d) * 1.1111111, DEGREES ); return ANGLE;}
{num}ms { VAL( atoi(yytext), MILLISECONDS ); return TIME;}
{num}s { VAL( atoi(yytext) * 1000, MILLISECONDS ); return TIME;}
{num}Hz { VAL( atoi(yytext), HERTZ ); return FREQ;}
{num}kHz { VAL( atoi(yytext) * 1000, HERTZ ); return FREQ;}
{num}{ident} { VAL( 0, DIMENSION ); return DIMEN;}
{num}% { VAL( atoi(yytext), PERCENT ); return PERCENTAGE;}
{num} { VAL( us_strtof(yytext, &d), NONE ); return NUMBER;}
{num} { VAL( vlc_strtof_c(yytext, &d), NONE ); return NUMBER;}
"url("{w}{string}{w}")" { yylval->string = vlc_css_unquotedunescaped(yytext); return URI;}
"url("{w}{url}{w}")" { yylval->string = vlc_css_unquotedunescaped(yytext); return URI;}
......
......@@ -183,7 +183,7 @@ static block_t *Encode( encoder_t *p_enc, subpicture_t *p_spu )
if( bo_size( &box ) != i_start + 8 )
bo_add_8( &box, ' ' );
char *psz;
int i_printed = us_asprintf( &psz, "line:%2.2f%%", offset );
int i_printed = vlc_asprintf_c( &psz, "line:%2.2f%%", offset );
if( i_printed >= 0 )
{
if( i_printed > 0 )
......
......@@ -174,7 +174,7 @@ typedef struct
static bool parse_percent( const char *psz, float *value )
{
char *psz_end;
float d = us_strtof( psz, &psz_end );
float d = vlc_strtof_c( psz, &psz_end );
if( d >= 0.0 && d <= 100.0 && *psz_end == '%' )
*value = d / 100.0;
return psz_end != psz;
......@@ -183,14 +183,14 @@ static bool parse_percent( const char *psz, float *value )
static bool parse_percent_tuple( const char *psz, float *x, float *y )
{
char *psz_end;
float a = us_strtof( psz, &psz_end );
float a = vlc_strtof_c( psz, &psz_end );
if( psz_end != psz &&
a >= 0.0 && a <= 100.0 && psz_end && *psz_end == '%' )
{
psz = strchr( psz_end, ',' );
if( psz )
{
float b = us_strtof( ++psz, &psz_end );
float b = vlc_strtof_c( ++psz, &psz_end );
if( psz_end != psz &&
b >= 0.0 && b <= 100.0 && psz_end && *psz_end == '%' )
{
......@@ -307,7 +307,7 @@ static void webvtt_cue_settings_ParseTuple( webvtt_cue_settings_t *p_settings,
p_settings->b_snap_to_lines = false;
}
else
p_settings->line.value = us_strtof( psz_value, NULL );
p_settings->line.value = vlc_strtof_c( psz_value, NULL );
/* else auto */
const char *psz_align = strchr( psz_value, ',' );
......
......@@ -1008,11 +1008,11 @@ static int Open ( vlc_object_t *p_this )
psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "psy-rd" );
if( psz_val )
{
if( us_atof( psz_val ) != 1.0 )
if( vlc_atof_c( psz_val ) != 1.0 )
{
char *p = strchr( psz_val, ':' );
p_sys->param.analyse.f_psy_rd = us_atof( psz_val );
p_sys->param.analyse.f_psy_trellis = p ? us_atof( p+1 ) : 0;
p_sys->param.analyse.f_psy_rd = vlc_atof_c( psz_val );
p_sys->param.analyse.f_psy_trellis = p ? vlc_atof_c( p+1 ) : 0;
}
free( psz_val );
}
......@@ -1023,8 +1023,8 @@ static int Open ( vlc_object_t *p_this )
psz_val = var_GetString( p_enc, SOUT_CFG_PREFIX "level" );
if( psz_val )
{
if( us_atof (psz_val) < 6 && us_atof (psz_val) > 0 )
p_sys->param.i_level_idc = (int) (10 * us_atof (psz_val)
if( vlc_atof_c(psz_val) < 6 && vlc_atof_c(psz_val) > 0 )
p_sys->param.i_level_idc = (int) (10 * vlc_atof_c(psz_val)
+ .5);
else if( atoi(psz_val) >= 10 && atoi(psz_val) <= 51 )
p_sys->param.i_level_idc = atoi (psz_val);
......
......@@ -47,7 +47,7 @@ static vlc_tick_t str_duration( const char *psz_duration )
return -1;
do
{
double number = us_strtod( psz_duration, &end_ptr );
double number = vlc_strtod_c( psz_duration, &end_ptr );
double mul = 0;
if ( psz_duration != end_ptr )
psz_duration = end_ptr;
......
......@@ -3040,14 +3040,14 @@ static int TrackCreateES( demux_t *p_demux, mp4_track_t *p_track,
const char *psz_meta = vlc_meta_GetExtra( p_sys->p_meta, "replaygain_track_gain" );
if( psz_meta )
{
double f_gain = us_atof( psz_meta );
double f_gain = vlc_atof_c( psz_meta );
p_arg->pf_gain[AUDIO_REPLAY_GAIN_TRACK] = f_gain;
p_arg->pb_gain[AUDIO_REPLAY_GAIN_TRACK] = f_gain != 0;
}
psz_meta = vlc_meta_GetExtra( p_sys->p_meta, "replaygain_track_peak" );
if( psz_meta )
{
double f_gain = us_atof( psz_meta );
double f_gain = vlc_atof_c( psz_meta );
p_arg->pf_peak[AUDIO_REPLAY_GAIN_TRACK] = f_gain;
p_arg->pb_peak[AUDIO_REPLAY_GAIN_TRACK] = f_gain > 0;
}
......
......@@ -1095,7 +1095,7 @@ static int ID3TAG_Parse_Handler( uint32_t i_tag, const uint8_t *p_payload, size_
{
const char *psz_val = vlc_meta_GetExtra( p_meta, ppsz_keys[i] );
if( psz_val )
*pf = us_atof( psz_val );
*pf = vlc_atof_c( psz_val );
}
free( ppsz_keys[i] );
}
......
......@@ -532,7 +532,7 @@ static void parseEXTINF( char *psz_string,
/* Parse duration */
char *psz_end = NULL;
float i_parsed_duration = us_strtof( psz_string, &psz_end );
float i_parsed_duration = vlc_strtof_c( psz_string, &psz_end );
if( i_parsed_duration > 0 )
meta->i_duration = vlc_tick_from_sec( (double)i_parsed_duration );
......
......@@ -1013,7 +1013,7 @@ static int ParseMicroDvd( vlc_object_t *p_obj, subs_properties_t *p_props,
/* We found a possible setting of the framerate "{1}{1}23.976" */
/* Check if it's usable, and if the sub-original-fps is not set */
float f_fps = us_strtof( psz_text, NULL );
float f_fps = vlc_strtof_c( psz_text, NULL );
if( f_fps > 0.f && var_GetFloat( p_obj, "sub-original-fps" ) <= 0.f )
p_props->i_microsecperframe = llroundf((float)CLOCK_FREQ / f_fps);
}
......@@ -1740,7 +1740,7 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
if( sscanf( s, "FORMAT=%[^\r\n]", psz_temp ) )
{
float f_fps = us_strtof( psz_temp, NULL );
float f_fps = vlc_strtof_c( psz_temp, NULL );
if( f_fps > 0.f && var_GetFloat( p_obj, "sub-original-fps" ) <= 0.f )
var_SetFloat( p_obj, "sub-original-fps", f_fps );
......@@ -1753,10 +1753,10 @@ static int ParseMPSub( vlc_object_t *p_obj, subs_properties_t *p_props,
}
/* Data Lines */
float f1 = us_strtof( s, &psz_temp );
float f1 = vlc_strtof_c( s, &psz_temp );
if( *psz_temp )
{
float f2 = us_strtof( psz_temp, NULL );
float f2 = vlc_strtof_c( psz_temp, NULL );
p_props->mpsub.f_total += f1 * p_props->mpsub.i_factor;
p_subtitle->i_start = llroundf(10000.f * p_props->mpsub.f_total);
p_props->mpsub.f_total += f2 * p_props->mpsub.i_factor;
......
......@@ -494,19 +494,19 @@ void vorbis_ParseComment( es_format_t *p_fmt, vlc_meta_t **pp_meta,
if (!p) goto next_comment;
if ( !strncasecmp(psz_comment, "REPLAYGAIN_TRACK_GAIN=", 22) )
{
(*ppf_replay_gain)[AUDIO_REPLAY_GAIN_TRACK] = us_atof( ++p );
(*ppf_replay_gain)[AUDIO_REPLAY_GAIN_TRACK] = vlc_atof_c( ++p );
}
else if ( !strncasecmp(psz_comment, "REPLAYGAIN_ALBUM_GAIN=", 22) )
{
(*ppf_replay_gain)[AUDIO_REPLAY_GAIN_ALBUM] = us_atof( ++p );
(*ppf_replay_gain)[AUDIO_REPLAY_GAIN_ALBUM] = vlc_atof_c( ++p );
}
else if ( !strncasecmp(psz_comment, "REPLAYGAIN_ALBUM_PEAK=", 22) )
{
(*ppf_replay_peak)[AUDIO_REPLAY_GAIN_ALBUM] = us_atof( ++p );
(*ppf_replay_peak)[AUDIO_REPLAY_GAIN_ALBUM] = vlc_atof_c( ++p );
}
else if ( !strncasecmp(psz_comment, "REPLAYGAIN_TRACK_PEAK=", 22) )
{
(*ppf_replay_peak)[AUDIO_REPLAY_GAIN_TRACK] = us_atof( ++p );
(*ppf_replay_peak)[AUDIO_REPLAY_GAIN_TRACK] = vlc_atof_c( ++p );
}
}
else if( !strncasecmp(psz_comment, "CHAPTER", 7) )
......
......@@ -21,7 +21,7 @@ cat libvlccore.sym | grep -v \
-e '^net_' -e '^httpd_' \
-e '^config_' -e '^module_' -e '^var_' \
-e '^date_' -e '^plane_' \
-e '^us_' -e '^utf8_' -e '^xml_' \
-e '^utf8_' -e '^xml_' \
-e '^[A-Z][a-z]*Charset$' \
-e '^NTPtime64$' \
&& exit 1
......
......@@ -396,7 +396,7 @@ void config_ChainParse( vlc_object_t *p_this, const char *psz_prefix,
NULL, 0 );
break;
case CONFIG_ITEM_FLOAT:
val.f_float = us_atof( cfg->psz_value ? cfg->psz_value : "0" );
val.f_float = vlc_atof_c( cfg->psz_value ? cfg->psz_value : "0" );
break;
case CONFIG_ITEM_STRING:
val.psz_string = cfg->psz_value;
......