Piotr Caban : msvcrt: Added _wtoi_l implementation.

Alexandre Julliard julliard at winehq.org
Wed Dec 12 15:14:54 CST 2012


Module: wine
Branch: master
Commit: 3acb238f1584256468bf592843bb55206d656a56
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3acb238f1584256468bf592843bb55206d656a56

Author: Piotr Caban <piotr at codeweavers.com>
Date:   Wed Dec 12 11:16:05 2012 +0100

msvcrt: Added _wtoi_l implementation.

---

 dlls/msvcr100/msvcr100.spec |    2 +-
 dlls/msvcr80/msvcr80.spec   |    2 +-
 dlls/msvcr90/msvcr90.spec   |    2 +-
 dlls/msvcrt/msvcrt.spec     |    2 +-
 dlls/msvcrt/wcs.c           |   17 +++++++++++++++++
 5 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/dlls/msvcr100/msvcr100.spec b/dlls/msvcr100/msvcr100.spec
index 0729f30..c57b43d 100644
--- a/dlls/msvcr100/msvcr100.spec
+++ b/dlls/msvcr100/msvcr100.spec
@@ -1604,7 +1604,7 @@
 @ cdecl _wtoi(wstr) msvcrt._wtoi
 @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64
 @ stub _wtoi64_l
-@ stub _wtoi_l
+@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l
 @ cdecl _wtol(wstr) msvcrt._wtol
 @ stub _wtol_l
 @ cdecl _wunlink(wstr) msvcrt._wunlink
diff --git a/dlls/msvcr80/msvcr80.spec b/dlls/msvcr80/msvcr80.spec
index bd1e86a..8c53751 100644
--- a/dlls/msvcr80/msvcr80.spec
+++ b/dlls/msvcr80/msvcr80.spec
@@ -1268,7 +1268,7 @@
 @ cdecl _wtoi(wstr) msvcrt._wtoi
 @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64
 @ stub _wtoi64_l
-@ stub _wtoi_l
+@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l
 @ cdecl _wtol(wstr) msvcrt._wtol
 @ stub _wtol_l
 @ cdecl _wunlink(wstr) msvcrt._wunlink
diff --git a/dlls/msvcr90/msvcr90.spec b/dlls/msvcr90/msvcr90.spec
index 2453e6f..500ed27 100644
--- a/dlls/msvcr90/msvcr90.spec
+++ b/dlls/msvcr90/msvcr90.spec
@@ -1259,7 +1259,7 @@
 @ cdecl _wtoi(wstr) msvcrt._wtoi
 @ cdecl -ret64 _wtoi64(wstr) msvcrt._wtoi64
 @ stub _wtoi64_l
-@ stub _wtoi_l
+@ cdecl _wtoi_l(wstr ptr) msvcrt._wtoi_l
 @ cdecl _wtol(wstr) msvcrt._wtol
 @ stub _wtol_l
 @ cdecl _wunlink(wstr) msvcrt._wunlink
diff --git a/dlls/msvcrt/msvcrt.spec b/dlls/msvcrt/msvcrt.spec
index ecf44fd..239e820 100644
--- a/dlls/msvcrt/msvcrt.spec
+++ b/dlls/msvcrt/msvcrt.spec
@@ -1199,7 +1199,7 @@
 @ cdecl _wtoi(wstr) ntdll._wtoi
 @ cdecl -ret64 _wtoi64(wstr) ntdll._wtoi64
 # stub -ret64 _wtoi64_l(wstr ptr)
-# stub _wtoi_l(wstr ptr)
+@ cdecl _wtoi_l(wstr ptr) MSVCRT__wtoi_l
 @ cdecl _wtol(wstr) ntdll._wtol
 # stub _wtol_l(wstr ptr)
 @ cdecl _wunlink(wstr) MSVCRT__wunlink
diff --git a/dlls/msvcrt/wcs.c b/dlls/msvcrt/wcs.c
index 555e63a..cc48968 100644
--- a/dlls/msvcrt/wcs.c
+++ b/dlls/msvcrt/wcs.c
@@ -1438,6 +1438,23 @@ __int64 CDECL MSVCRT__wcstoi64(const MSVCRT_wchar_t *nptr,
 }
 
 /*********************************************************************
+ *  _wtoi_l (MSVCRT.@)
+ */
+int MSVCRT__wtoi_l(const MSVCRT_wchar_t *str, MSVCRT__locale_t locale)
+{
+    __int64 ret = MSVCRT__wcstoi64_l(str, NULL, 10, locale);
+
+    if(ret > INT_MAX) {
+        ret = INT_MAX;
+        *MSVCRT__errno() = MSVCRT_ERANGE;
+    } else if(ret < INT_MIN) {
+        ret = INT_MIN;
+        *MSVCRT__errno() = MSVCRT_ERANGE;
+    }
+    return ret;
+}
+
+/*********************************************************************
  *  _wcstoui64_l (MSVCRT.@)
  *
  * FIXME: locale parameter is ignored




More information about the wine-cvs mailing list