[PATCH 1/2] Added forwards in msvcr100, 80 to _ui64tow_s (resend)

Arno Teigseth arnotixe at gmail.com
Wed Dec 29 01:13:53 CST 2010


---
 dlls/msvcr100/msvcr100.spec |    2 +-
 dlls/msvcr80/msvcr80.spec   |    2 +-
 dlls/msvcr90/msvcr90.spec   |    2 +-
 dlls/msvcrt/msvcrt.spec     |    2 +-
 dlls/msvcrt/string.c        |   43 +++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 82606e2..64dc69a 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -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
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index e54eea6..e28079a 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -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
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 5baee98..94e32ff 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -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
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index ba8c9ea..a12941e 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -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
diff --git a/dlls/msvcrt/string.c b/dlls/msvcrt/string.c
index 11ad5a0..bd8ad3f 100644
--- a/dlls/msvcrt/string.c
+++ b/dlls/msvcrt/string.c
@@ -919,6 +919,49 @@ int CDECL MSVCRT__ui64toa_s(unsigned __int64 value, char *str,
 }
 
 /*********************************************************************
+ *      _ui64tow_s  (MSVCRT.@)
+ */
+int CDECL MSVCRT__ui64tow_s(
+    ULONGLONG value, /* [I] Value to be converted */
+    LPWSTR str,      /* [O] Destination for the converted value */
+    MSVCRT_size_t size,
+    INT radix)       /* [I] Number base for conversion */
+{
+    WCHAR buffer[65];
+    PWCHAR pos;
+    WCHAR 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;
+	} /* if */
+    } while (value != 0L);
+
+    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.@)
  */
 int CDECL _ultoa_s(MSVCRT_ulong value, char *str, MSVCRT_size_t size, int radix)
-- 
1.6.3.3


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://www.winehq.org/pipermail/wine-patches/attachments/20101229/3d399ed6/attachment.pgp>


More information about the wine-patches mailing list