msvcrt.wcstod
Robert Shearman
R.J.Shearman at warwick.ac.uk
Tue Nov 12 18:06:40 CST 2002
Hi,
Implemented msvcrt.wcstod:
Changelog:
- implemented wcstod as a function converting the parameters to multibyte
and then calling strtod. There should be no loss of accuracy from the
conversion
-------------- next part --------------
? wine/programs/winetest/Makefile
Index: wine/dlls/msvcrt/msvcrt.spec
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/msvcrt.spec,v
retrieving revision 1.52
diff -u -r1.52 msvcrt.spec
--- wine/dlls/msvcrt/msvcrt.spec 12 Nov 2002 23:20:31 -0000 1.52
+++ wine/dlls/msvcrt/msvcrt.spec 12 Nov 2002 23:37:44 -0000
@@ -753,7 +753,7 @@
@ forward -noimport wcsrchr ntdll.wcsrchr
@ forward -noimport wcsspn ntdll.wcsspn
@ forward -noimport wcsstr ntdll.wcsstr
-@ stub wcstod #(wstr ptr)
+@ cdecl wcstod(wstr ptr) wcstod
@ forward -noimport wcstok ntdll.wcstok
@ forward -noimport wcstol ntdll.wcstol
@ forward -noimport wcstombs ntdll.wcstombs
Index: wine/dlls/msvcrt/wcs.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/wcs.c,v
retrieving revision 1.11
diff -u -r1.11 wcs.c
--- wine/dlls/msvcrt/wcs.c 20 May 2002 18:02:47 -0000 1.11
+++ wine/dlls/msvcrt/wcs.c 12 Nov 2002 23:37:44 -0000
@@ -386,3 +386,28 @@
return out;
}
+/*********************************************************************
+ * wcstod (MSVCRT.@)
+ *
+ * Should lose no accuracy by converting to normal string to do
+ * the conversion
+ */
+double wcstod( const WCHAR *nptr, WCHAR **endptr )
+{
+ const unsigned int len = strlenW(nptr);
+ char *nptra = MSVCRT_calloc(len + 1,1);
+ char *endptra;
+
+ if (nptra && WideCharToMultiByte(CP_ACP,0,nptr,len,nptra,len,NULL,NULL))
+ {
+ double retval = strtod(nptra,&endptra);
+ if (endptr != NULL)
+ *endptr = nptr + (int)(endptra - nptra);
+ MSVCRT_free(nptra);
+ return retval;
+ }
+
+ MSVCRT__set_errno(GetLastError());
+ return 0.0;
+}
+
More information about the wine-patches
mailing list