Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
71587594
Commit
71587594
authored
Apr 14, 2009
by
Cyril Mathé
Committed by
Rémi Denis-Courmont
Apr 17, 2009
Browse files
Add a us_strtof function to prevent some problem
Signed-off-by:
Rémi Denis-Courmont
<
remi@remlab.net
>
parent
d385b8dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/vlc_charset.h
View file @
71587594
...
...
@@ -111,6 +111,7 @@ static inline char *FromLatin1 (const char *latin)
VLC_EXPORT
(
const
char
*
,
GetFallbackEncoding
,
(
void
)
LIBVLC_USED
);
VLC_EXPORT
(
double
,
us_strtod
,
(
const
char
*
,
char
**
)
LIBVLC_USED
);
VLC_EXPORT
(
float
,
us_strtof
,
(
const
char
*
,
char
**
)
LIBVLC_USED
);
VLC_EXPORT
(
double
,
us_atof
,
(
const
char
*
)
LIBVLC_USED
);
VLC_EXPORT
(
int
,
us_asprintf
,
(
char
**
,
const
char
*
,
...
)
LIBVLC_USED
);
...
...
src/libvlccore.sym
View file @
71587594
...
...
@@ -385,6 +385,7 @@ update_WaitDownload
us_asprintf
us_atof
us_strtod
us_strtof
utf8_fopen
utf8_fprintf
utf8_loaddir
...
...
src/text/charset.c
View file @
71587594
...
...
@@ -91,6 +91,26 @@ double us_strtod( const char *str, char **end )
return
res
;
}
/**
* us_strtof() has the same prototype as ANSI C strtof() but it uses the
* POSIX/C decimal format, regardless of the current numeric locale.
*/
float
us_strtof
(
const
char
*
str
,
char
**
end
)
{
locale_t
loc
=
newlocale
(
LC_NUMERIC_MASK
,
"C"
,
NULL
);
locale_t
oldloc
=
uselocale
(
loc
);
float
res
=
strtof
(
str
,
end
);
if
(
loc
!=
(
locale_t
)
0
)
{
uselocale
(
oldloc
);
freelocale
(
loc
);
}
return
res
;
}
/**
* us_atof() has the same prototype as ANSI C atof() but it expects a dot
* as decimal separator, regardless of the system locale.
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment