msvcrt: Added _ui64tow_s.
This commit is contained in:
parent
74ce3e53d4
commit
01b9fd3679
|
@ -1197,7 +1197,7 @@
|
|||
@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa
|
||||
@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s
|
||||
@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow
|
||||
@ stub _ui64tow_s
|
||||
@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s
|
||||
@ cdecl _ultoa(long ptr long) msvcrt._ultoa
|
||||
@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s
|
||||
@ cdecl _ultow(long ptr long) msvcrt._ultow
|
||||
|
|
|
@ -1050,7 +1050,7 @@
|
|||
@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa
|
||||
@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s
|
||||
@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow
|
||||
@ stub _ui64tow_s
|
||||
@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s
|
||||
@ cdecl _ultoa(long ptr long) msvcrt._ultoa
|
||||
@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s
|
||||
@ cdecl _ultow(long ptr long) msvcrt._ultow
|
||||
|
|
|
@ -1037,7 +1037,7 @@
|
|||
@ cdecl _ui64toa(int64 ptr long) msvcrt._ui64toa
|
||||
@ cdecl _ui64toa_s(int64 ptr long long) msvcrt._ui64toa_s
|
||||
@ cdecl _ui64tow(int64 ptr long) msvcrt._ui64tow
|
||||
@ stub _ui64tow_s
|
||||
@ cdecl _ui64tow_s(int64 ptr long long) msvcrt._ui64tow_s
|
||||
@ cdecl _ultoa(long ptr long) msvcrt._ultoa
|
||||
@ cdecl _ultoa_s(long ptr long long) msvcrt._ultoa_s
|
||||
@ cdecl _ultow(long ptr long) msvcrt._ultow
|
||||
|
|
|
@ -976,7 +976,7 @@
|
|||
@ cdecl _ui64toa(int64 ptr long) ntdll._ui64toa
|
||||
@ cdecl _ui64toa_s(int64 ptr long long) MSVCRT__ui64toa_s
|
||||
@ cdecl _ui64tow(int64 ptr long) ntdll._ui64tow
|
||||
# stub _ui64tow_s
|
||||
@ cdecl _ui64tow_s(int64 ptr long long) MSVCRT__ui64tow_s
|
||||
@ cdecl _ultoa(long ptr long) ntdll._ultoa
|
||||
@ cdecl _ultoa_s(long ptr long long)
|
||||
@ cdecl _ultow(long ptr long) ntdll._ultow
|
||||
|
|
|
@ -918,6 +918,43 @@ int CDECL MSVCRT__ui64toa_s(unsigned __int64 value, char *str,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _ui64tow_s (MSVCRT.@)
|
||||
*/
|
||||
int CDECL MSVCRT__ui64tow_s( unsigned __int64 value, MSVCRT_wchar_t *str,
|
||||
MSVCRT_size_t size, int radix )
|
||||
{
|
||||
MSVCRT_wchar_t buffer[65], *pos;
|
||||
int digit;
|
||||
|
||||
if (!MSVCRT_CHECK_PMT(str != NULL) || !MSVCRT_CHECK_PMT(size > 0) ||
|
||||
!MSVCRT_CHECK_PMT(radix>=2) || !MSVCRT_CHECK_PMT(radix<=36)) {
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return MSVCRT_EINVAL;
|
||||
}
|
||||
|
||||
pos = &buffer[64];
|
||||
*pos = '\0';
|
||||
|
||||
do {
|
||||
digit = value % radix;
|
||||
value = value / radix;
|
||||
if (digit < 10)
|
||||
*--pos = '0' + digit;
|
||||
else
|
||||
*--pos = 'a' + digit - 10;
|
||||
} while (value != 0);
|
||||
|
||||
if(buffer-pos+65 > size) {
|
||||
MSVCRT_INVALID_PMT("str[size] is too small");
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return MSVCRT_EINVAL;
|
||||
}
|
||||
|
||||
memcpy(str, pos, buffer-pos+65);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*********************************************************************
|
||||
* _ultoa_s (MSVCRT.@)
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue