From 28884a8faacc2cd832e7db86abc1c072ef51e97d Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 15 Nov 2010 21:59:55 +0100 Subject: [PATCH] msvcrt: Implemented _ltoa_s. --- dlls/msvcr100/msvcr100.spec | 4 ++-- dlls/msvcr80/msvcr80.spec | 4 ++-- dlls/msvcr90/msvcr90.spec | 4 ++-- dlls/msvcrt/msvcrt.spec | 4 ++-- dlls/msvcrt/string.c | 30 ++++++++++++++++++++++++------ 5 files changed, 32 insertions(+), 14 deletions(-) diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec index 08942ae265..4d26904c12 100644 --- a/dlls/msvcr100/msvcr100.spec +++ b/dlls/msvcr100/msvcr100.spec @@ -862,9 +862,9 @@ @ cdecl _lseek(long long long) msvcrt._lseek @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64 @ cdecl _ltoa(long ptr long) msvcrt._ltoa -@ stub _ltoa_s +@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s @ cdecl _ltow(long ptr long) msvcrt._ltow -@ stub _ltow_s +@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s @ cdecl _makepath(ptr str str str str) msvcrt._makepath @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s @ cdecl _malloc_crt(long) msvcrt.malloc diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec index 2052fde4a3..a65a89dd61 100644 --- a/dlls/msvcr80/msvcr80.spec +++ b/dlls/msvcr80/msvcr80.spec @@ -708,9 +708,9 @@ @ cdecl _lseek(long long long) msvcrt._lseek @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64 @ cdecl _ltoa(long ptr long) msvcrt._ltoa -@ stub _ltoa_s +@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s @ cdecl _ltow(long ptr long) msvcrt._ltow -@ stub _ltow_s +@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s @ cdecl _makepath(ptr str str str str) msvcrt._makepath @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s @ cdecl _malloc_crt(long) msvcrt.malloc diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec index 2fde5eba67..64332f57b0 100644 --- a/dlls/msvcr90/msvcr90.spec +++ b/dlls/msvcr90/msvcr90.spec @@ -696,9 +696,9 @@ @ cdecl _lseek(long long long) msvcrt._lseek @ cdecl -ret64 _lseeki64(long int64 long) msvcrt._lseeki64 @ cdecl _ltoa(long ptr long) msvcrt._ltoa -@ stub _ltoa_s +@ cdecl _ltoa_s(long ptr long long) msvcrt._ltoa_s @ cdecl _ltow(long ptr long) msvcrt._ltow -@ stub _ltow_s +@ cdecl _ltow_s(long ptr long long) msvcrt._ltow_s @ cdecl _makepath(ptr str str str str) msvcrt._makepath @ cdecl _makepath_s(ptr long str str str str) msvcrt._makepath_s @ cdecl _malloc_crt(long) msvcrt.malloc diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec index 9602f3d537..00ba5ea88b 100644 --- a/dlls/msvcrt/msvcrt.spec +++ b/dlls/msvcrt/msvcrt.spec @@ -639,9 +639,9 @@ @ cdecl _lseek(long long long) MSVCRT__lseek @ cdecl -ret64 _lseeki64(long int64 long) MSVCRT__lseeki64 @ cdecl _ltoa(long ptr long) ntdll._ltoa -# stub _ltoa_s +@ cdecl _ltoa_s(long ptr long long) ntdll._ltoa_s @ cdecl _ltow(long ptr long) ntdll._ltow -# stub _ltow_s +@ cdecl _ltow_s(long ptr long long) ntdll._ltow_s @ cdecl _makepath(ptr str str str str) @ cdecl _makepath_s(ptr long str str str str) # stub _malloc_dbg diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c index d657fc33f7..d807c14306 100644 --- a/dlls/msvcrt/string.c +++ b/dlls/msvcrt/string.c @@ -709,11 +709,12 @@ unsigned __int64 CDECL MSVCRT_strtoui64(const char *nptr, char **endptr, int bas } /********************************************************************* - * _itoa_s (MSVCRT.@) + * _ltoa_s (MSVCRT.@) */ -int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix) +int CDECL _ltoa_s(MSVCRT_long value, char *str, MSVCRT_size_t size, int radix) { - unsigned int val, digit; + MSVCRT_ulong val; + unsigned int digit; int is_negative; char buffer[33], *pos; size_t len; @@ -786,11 +787,12 @@ int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix) } /********************************************************************* - * _itow_s (MSVCRT.@) + * _ltow_s (MSVCRT.@) */ -int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +int CDECL _ltow_s(MSVCRT_long value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) { - unsigned int val, digit; + MSVCRT_ulong val; + unsigned int digit; int is_negative; MSVCRT_wchar_t buffer[33], *pos; size_t len; @@ -862,6 +864,22 @@ int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) return 0; } +/********************************************************************* + * _itoa_s (MSVCRT.@) + */ +int CDECL _itoa_s(int value, char *str, MSVCRT_size_t size, int radix) +{ + return _ltoa_s(value, str, size, radix); +} + +/********************************************************************* + * _itow_s (MSVCRT.@) + */ +int CDECL _itow_s(int value, MSVCRT_wchar_t *str, MSVCRT_size_t size, int radix) +{ + return _ltow_s(value, str, size, radix); +} + /********************************************************************* * _ui64toa_s (MSVCRT.@) */ -- 2.32.0.93.g670b81a890