#include <corecrt_internal.h>
#include <corecrt_internal_securecrt.h>
#include <limits.h>
#include <stdlib.h>
Go to the source code of this file.
|
template<typename UnsignedInteger , typename Character > |
| _Success_ (return==0) static errno_t __cdecl common_xtox(UnsignedInteger const original_value |
|
| _Out_writes_z_ (buffer_count) Character *const buffer |
|
| _When_ (is_negative==true, _In_range_(>=, 2)) _In_range_(> |
|
size_t const unsigned const bool const is_negative | throw () |
|
errno_t __cdecl | _itoa_s (int const value, char *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ltoa_s (long const value, char *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ultoa_s (unsigned long const value, char *const buffer, size_t const buffer_count, int const radix) |
|
char *__cdecl | _itoa (int const value, char *const buffer, int const radix) |
|
char *__cdecl | _ltoa (long const value, char *const buffer, int const radix) |
|
char *__cdecl | _ultoa (unsigned long const value, char *const buffer, int const radix) |
|
errno_t __cdecl | _i64toa_s (__int64 const value, char *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ui64toa_s (unsigned __int64 const value, char *const buffer, size_t const buffer_count, int const radix) |
|
char *__cdecl | _i64toa (__int64 const value, char *const buffer, int const radix) |
|
char *__cdecl | _ui64toa (unsigned __int64 const value, char *const buffer, int const radix) |
|
errno_t __cdecl | _itow_s (int const value, wchar_t *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ltow_s (long const value, wchar_t *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ultow_s (unsigned long const value, wchar_t *const buffer, size_t const buffer_count, int const radix) |
|
wchar_t *__cdecl | _itow (int const value, wchar_t *const buffer, int const radix) |
|
wchar_t *__cdecl | _ltow (long const value, wchar_t *const buffer, int const radix) |
|
wchar_t *__cdecl | _ultow (unsigned long const value, wchar_t *const buffer, int const radix) |
|
errno_t __cdecl | _i64tow_s (__int64 const value, wchar_t *const buffer, size_t const buffer_count, int const radix) |
|
errno_t __cdecl | _ui64tow_s (unsigned __int64 const value, wchar_t *const buffer, size_t const buffer_count, int const radix) |
|
wchar_t *__cdecl | _i64tow (__int64 const value, wchar_t *const buffer, int const radix) |
|
wchar_t *__cdecl | _ui64tow (unsigned __int64 const value, wchar_t *const buffer, int const radix) |
|
◆ _i64toa()
Definition at line 226 of file xtoa.cpp.
231{
232 bool const is_negative =
radix == 10 &&
value < 0;
235}
#define _CRT_UNBOUNDED_BUFFER_SIZE
size_t const unsigned const radix
◆ _i64toa_s()
Definition at line 203 of file xtoa.cpp.
209{
210 bool const is_negative =
radix == 10 &&
value < 0;
212}
size_t const buffer_count
◆ _i64tow()
Definition at line 350 of file xtoa.cpp.
355{
356 bool const is_negative =
radix == 10 &&
value < 0;
359}
◆ _i64tow_s()
Definition at line 327 of file xtoa.cpp.
333{
334 bool const is_negative =
radix == 10 &&
value < 0;
336}
◆ _itoa()
Definition at line 164 of file xtoa.cpp.
169{
170 bool const is_negative =
radix == 10 &&
value < 0;
173}
◆ _itoa_s()
Definition at line 130 of file xtoa.cpp.
136{
137 bool const is_negative =
radix == 10 &&
value < 0;
139}
◆ _itow()
Definition at line 288 of file xtoa.cpp.
293{
294 bool const is_negative =
radix == 10 &&
value < 0;
297}
◆ _itow_s()
Definition at line 254 of file xtoa.cpp.
260{
261 bool const is_negative =
radix == 10 &&
value < 0;
263}
◆ _ltoa()
Definition at line 175 of file xtoa.cpp.
180{
181 bool const is_negative =
radix == 10 &&
value < 0;
184}
◆ _ltoa_s()
Definition at line 141 of file xtoa.cpp.
147{
148 bool const is_negative =
radix == 10 &&
value < 0;
150}
◆ _ltow()
Definition at line 299 of file xtoa.cpp.
304{
305 bool const is_negative =
radix == 10 &&
value < 0;
308}
◆ _ltow_s()
Definition at line 265 of file xtoa.cpp.
271{
272 bool const is_negative =
radix == 10 &&
value < 0;
274}
◆ _Out_writes_z_()
◆ _Success_()
_Success_ |
( |
return |
= = 0 | ) |
const |
◆ _ui64toa()
◆ _ui64toa_s()
◆ _ui64tow()
◆ _ui64tow_s()
◆ _ultoa()
◆ _ultoa_s()
◆ _ultow()
◆ _ultow_s()
◆ _When_()
◆ throw()
Definition at line 39 of file xtoa.cpp.
40{
41
42#pragma warning(push)
43#pragma warning(disable:26014)
46
47 UnsignedInteger remaining_value = original_value;;
48
49 if (is_negative)
50 {
53
54 remaining_value = static_cast<UnsignedInteger>(
55 -
static_cast<typename make_signed<UnsignedInteger>::type
>(remaining_value)
56 );
57 }
58
59 Character* first_digit =
p;
60
61 do
62 {
63 unsigned const digit =
static_cast<unsigned>(remaining_value %
radix);
64 remaining_value /=
radix;
65
66
67 if (digit > 9)
68 {
69 *
p++ =
static_cast<Character
>(
digit - 10 +
'a');
70 }
71 else
72 {
73 *
p++ =
static_cast<Character
>(
digit +
'0');
74 }
75
77 }
79
81 {
84 }
85
86
87
89
90 do
91 {
92 Character
const t = *
p;
96 ++first_digit;
97 }
98 while (first_digit <
p);
99
100 return 0;
101#pragma warning(pop)
102}
GLuint GLsizei GLsizei * length
#define _VALIDATE_RETURN_ERRCODE(expr, errorcode)
◆ buffer_count
Initial value:
Definition at line 36 of file xtoa.cpp.
Referenced by __acrt_fp_strflt_to_string(), __acrt_GetDateFormatEx(), __acrt_GetTimeFormatEx(), __acrt_RtlGenRandom(), __stdio_common_vsscanf(), __stdio_common_vswscanf(), __wcserror_s(), _ecvt_s(), _ecvt_s_internal(), _fcvt_s(), _fcvt_s_internal(), _gcvt_s(), _gcvt_s_internal(), _i64toa_s(), _i64tow_s(), _isctype_l(), _itoa_s(), _itow_s(), _ltoa_s(), _ltow_s(), _strerror_s(), _Success_(), _ui64toa_s(), _ui64tow_s(), _ultoa_s(), _ultow_s(), append_message(), common_splitpath(), common_strerror_s(), common_vsscanf(), create_environment_string(), __crt_stdio_input::input_processor< Character, InputAdapter >::fill_buffer(), internal_to_string(), __crt_stdio_input::input_processor< Character, InputAdapter >::process_string_specifier_tchar(), __crt_stdio_input::input_processor< Character, InputAdapter >::reset_buffer(), set_variable_in_other_environment(), shift_bytes(), throw(), wined3d_swapchain_resize_buffers(), and __crt_stdio_input::input_processor< Character, InputAdapter >::write_character().
◆ radix
Definition at line 37 of file xtoa.cpp.
Referenced by _i64toa(), _i64toa_s(), _i64tow(), _i64tow_s(), _itoa(), _itoa_s(), _itow(), _itow_s(), _ltoa(), _ltoa_s(), _ltow(), _ltow_s(), _ui64toa(), _ui64toa_s(), _ui64tow(), _ui64tow_s(), _ultoa(), _ultoa_s(), _ultow(), _ultow_s(), ata_bblk(), debugcontrol_GetRadix(), debugcontrol_SetRadix(), DECLARE_INTERFACE_(), JSGlobal_parseInt(), Number_toString(), throw(), and UDFGetCfgParameter().