diff --git a/reactos/lib/crtdll/direct/chdir.c b/reactos/lib/crtdll/direct/chdir.c index 8c195e57a82..19a4a9fecfc 100644 --- a/reactos/lib/crtdll/direct/chdir.c +++ b/reactos/lib/crtdll/direct/chdir.c @@ -8,7 +8,7 @@ int _chdir( const char *_path ) { if ( _path[1] == ':') _chdrive(tolower(_path[0] - 'a')+1); - if ( !SetCurrentDirectory((char *)_path) ) + if ( !SetCurrentDirectoryA((char *)_path) ) return -1; return 0; diff --git a/reactos/lib/crtdll/direct/chdrive.c b/reactos/lib/crtdll/direct/chdrive.c index 62ba41e0811..84d04c6d521 100644 --- a/reactos/lib/crtdll/direct/chdrive.c +++ b/reactos/lib/crtdll/direct/chdrive.c @@ -18,7 +18,7 @@ int _chdrive( int drive ) d[0] = toupper(cur_drive + '@'); d[1] = ':'; d[2] = 0; - SetCurrentDirectory(d); + SetCurrentDirectoryA(d); } diff --git a/reactos/lib/crtdll/direct/getcwd.c b/reactos/lib/crtdll/direct/getcwd.c index 6da0b8cadc3..65f8985d89c 100644 --- a/reactos/lib/crtdll/direct/getcwd.c +++ b/reactos/lib/crtdll/direct/getcwd.c @@ -16,12 +16,10 @@ char *_getcwd( char *buffer, int maxlen ) cwd = buffer; len = maxlen; } - - if ( GetCurrentDirectory(len,cwd) == 0 ) + if ( GetCurrentDirectoryA(len,cwd) == 0 ) return NULL; - return cwd; } diff --git a/reactos/lib/crtdll/direct/getdcwd.c b/reactos/lib/crtdll/direct/getdcwd.c index 5e7132412f8..0b2a8b5f178 100644 --- a/reactos/lib/crtdll/direct/getdcwd.c +++ b/reactos/lib/crtdll/direct/getdcwd.c @@ -1,7 +1,7 @@ #include #include -char* _getdcwd (int nDrive, char* caBuffer, int nBufLen) +char* _getdcwd (int nDrive, char* caBuffer, int nBufLen) { int i =0; int dr = _getdrive(); diff --git a/reactos/lib/crtdll/direct/getdrive.c b/reactos/lib/crtdll/direct/getdrive.c index 97f674b2346..2aa5463f1e1 100644 --- a/reactos/lib/crtdll/direct/getdrive.c +++ b/reactos/lib/crtdll/direct/getdrive.c @@ -11,7 +11,7 @@ int _getdrive( void ) char Buffer[MAX_PATH]; if ( cur_drive == 0 ) { - GetCurrentDirectory(MAX_PATH,Buffer); + GetCurrentDirectoryA(MAX_PATH,Buffer); cur_drive = toupper(Buffer[0] - '@'); } diff --git a/reactos/lib/crtdll/wchar/wcstod.c b/reactos/lib/crtdll/wchar/wcstod.c index b55c392cce0..ffef827e260 100644 --- a/reactos/lib/crtdll/wchar/wcstod.c +++ b/reactos/lib/crtdll/wchar/wcstod.c @@ -1,6 +1,95 @@ -#include +/* Copyright (C) 1996 DJ Delorie, see COPYING.DJ for details */ +/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ +#include -double wcstod(const wchar_t *nptr, wchar_t **endptr) + +double wcstod(const wchar_t *s, wchar_t **sret) { - return 0.0; -} \ No newline at end of file + long double r; /* result */ + int e; /* exponent */ + long double d; /* scale */ + int sign; /* +- 1.0 */ + int esign; + int i; + int flags=0; + + r = 0.0; + sign = 1; + e = 0; + esign = 1; + + while ((*s == L' ') || (*s == L'\t')) + s++; + + if (*s == L'+') + s++; + else if (*s == L'-') + { + sign = -1; + s++; + } + + while ((*s >= L'0') && (*s <= L'9')) + { + flags |= 1; + r *= 10.0; + r += *s - L'0'; + s++; + } + + if (*s == L'.') + { + d = 0.1L; + s++; + while ((*s >= L'0') && (*s <= L'9')) + { + flags |= 2; + r += d * (*s - L'0'); + s++; + d *= 0.1L; + } + } + + if (flags == 0) + { + if (sret) + *sret = (wchar_t *)s; + return 0; + } + + if ((*s == L'e') || (*s == L'E')) + { + s++; + if (*s == L'+') + s++; + else if (*s == L'-') + { + s++; + esign = -1; + } + if ((*s < L'0') || (*s > L'9')) + { + if (sret) + *sret = (wchar_t *)s; + return r; + } + + while ((*s >= L'0') && (*s <= L'9')) + { + e *= 10; + e += *s - L'0'; + s++; + } + } + + if (esign < 0) + for (i = 1; i <= e; i++) + r *= 0.1L; + else + for (i = 1; i <= e; i++) + r *= 10.0; + + if (sret) + *sret = (wchar_t *)s; + return r * sign; +}