ReactOS 0.4.16-dev-927-g467dec4
strtod.cpp File Reference
#include <corecrt_internal_strtox.h>
#include <stdlib.h>
Include dependency graph for strtod.cpp:

Go to the source code of this file.

Macros

#define _ALLOW_OLD_VALIDATE_MACROS
 

Functions

template<typename FloatingType , typename Character >
static FloatingType __cdecl common_strtod_l (_In_z_ Character const *const string, _Out_opt_ _Deref_post_z_ Character **const end_ptr, _locale_t const locale) throw ()
 
float __cdecl strtof (char const *const string, char **const end_ptr)
 
float __cdecl _strtof_l (char const *const string, char **const end_ptr, _locale_t const locale)
 
double __cdecl strtod (char const *const string, char **const end_ptr)
 
double __cdecl _strtod_l (char const *const string, char **const end_ptr, _locale_t const locale)
 
long double __cdecl strtold (char const *const string, char **const end_ptr)
 
long double __cdecl _strtold_l (char const *const string, char **const end_ptr, _locale_t const locale)
 
float __cdecl wcstof (wchar_t const *const string, wchar_t **const end_ptr)
 
float __cdecl _wcstof_l (wchar_t const *const string, wchar_t **const end_ptr, _locale_t const locale)
 
double __cdecl wcstod (wchar_t const *const string, wchar_t **const end_ptr)
 
double __cdecl _wcstod_l (wchar_t const *const string, wchar_t **const end_ptr, _locale_t const locale)
 
long double __cdecl wcstold (wchar_t const *const string, wchar_t **const end_ptr)
 
long double __cdecl _wcstold_l (wchar_t const *const string, wchar_t **const end_ptr, _locale_t const locale)
 

Macro Definition Documentation

◆ _ALLOW_OLD_VALIDATE_MACROS

#define _ALLOW_OLD_VALIDATE_MACROS

Definition at line 14 of file strtod.cpp.

Function Documentation

◆ _strtod_l()

double __cdecl _strtod_l ( char const *const  string,
char **const  end_ptr,
_locale_t const  locale 
)

Definition at line 80 of file strtod.cpp.

85{
86 return common_strtod_l<double>(string, end_ptr, locale);
87}
Definition: _locale.h:75

◆ _strtof_l()

float __cdecl _strtof_l ( char const *const  string,
char **const  end_ptr,
_locale_t const  locale 
)

Definition at line 63 of file strtod.cpp.

68{
69 return common_strtod_l<float>(string, end_ptr, locale);
70}

◆ _strtold_l()

long double __cdecl _strtold_l ( char const *const  string,
char **const  end_ptr,
_locale_t const  locale 
)

Definition at line 98 of file strtod.cpp.

103{
104 return common_strtod_l<double>(string, end_ptr, locale);
105}

◆ _wcstod_l()

double __cdecl _wcstod_l ( wchar_t const *const  string,
wchar_t **const  end_ptr,
_locale_t const  locale 
)

Definition at line 139 of file strtod.cpp.

144{
145 return common_strtod_l<double>(string, end_ptr, locale);
146}

◆ _wcstof_l()

float __cdecl _wcstof_l ( wchar_t const *const  string,
wchar_t **const  end_ptr,
_locale_t const  locale 
)

Definition at line 122 of file strtod.cpp.

127{
128 return common_strtod_l<float>(string, end_ptr, locale);
129}

◆ _wcstold_l()

long double __cdecl _wcstold_l ( wchar_t const *const  string,
wchar_t **const  end_ptr,
_locale_t const  locale 
)

Definition at line 157 of file strtod.cpp.

162{
163 return common_strtod_l<double>(string, end_ptr, locale);
164}

◆ common_strtod_l()

template<typename FloatingType , typename Character >
static FloatingType __cdecl common_strtod_l ( _In_z_ Character const *const  string,
_Out_opt_ _Deref_post_z_ Character **const  end_ptr,
_locale_t const  locale 
)
throw (
)
static

Definition at line 21 of file strtod.cpp.

26{
27 if (end_ptr)
28 {
29 *end_ptr = const_cast<Character*>(string);
30 }
31
32 _VALIDATE_RETURN(string != nullptr, EINVAL, 0.0);
33
34 _LocaleUpdate locale_update(locale);
35
36 FloatingType result{};
38 locale_update.GetLocaleT(),
40 &result);
41
43 {
44 errno = ERANGE;
45 }
46
47 return result;
48}
#define EINVAL
Definition: acclib.h:90
#define ERANGE
Definition: acclib.h:92
#define _VALIDATE_RETURN(expr, errorcode, retexpr)
GLuint64EXT * result
Definition: glext.h:11304
char string[160]
Definition: util.h:11
c_string_character_source< Character > __cdecl make_c_string_character_source(Character const *const string, EndPointer const end)
SLD_STATUS __cdecl parse_floating_point(_locale_t const locale, CharacterSource source, FloatingType *const result)
#define errno
Definition: errno.h:18
Definition: ps.c:97

◆ strtod()

double __cdecl strtod ( char const *const  string,
char **const  end_ptr 
)

Definition at line 72 of file strtod.cpp.

76{
77 return common_strtod_l<double>(string, end_ptr, nullptr);
78}

◆ strtof()

float __cdecl strtof ( char const *const  string,
char **const  end_ptr 
)

Definition at line 55 of file strtod.cpp.

59{
60 return common_strtod_l<float>(string, end_ptr, nullptr);
61}

Referenced by test_strtof().

◆ strtold()

long double __cdecl strtold ( char const *const  string,
char **const  end_ptr 
)

Definition at line 89 of file strtod.cpp.

93{
94 return common_strtod_l<double>(string, end_ptr, nullptr);
95}

Referenced by _atoldbl(), and TRIO_ARGS2().

◆ wcstod()

double __cdecl wcstod ( wchar_t const *const  string,
wchar_t **const  end_ptr 
)

Definition at line 131 of file strtod.cpp.

135{
136 return common_strtod_l<double>(string, end_ptr, nullptr);
137}

◆ wcstof()

float __cdecl wcstof ( wchar_t const *const  string,
wchar_t **const  end_ptr 
)

Definition at line 114 of file strtod.cpp.

118{
119 return common_strtod_l<float>(string, end_ptr, nullptr);
120}

◆ wcstold()

long double __cdecl wcstold ( wchar_t const *const  string,
wchar_t **const  end_ptr 
)

Definition at line 148 of file strtod.cpp.

152{
153 return common_strtod_l<double>(string, end_ptr, nullptr);
154}