- Don't include <windows.h> if it's not needed.

- Fix strange usage of TABs.

svn path=/trunk/; revision=30247
This commit is contained in:
Aleksey Bragin 2007-11-07 22:34:05 +00:00
parent 9a0cb042b7
commit f5ccdfc8e8

View file

@ -1,6 +1,8 @@
#include <string.h> #include <string.h>
#include <stdlib.h> #include <ctype.h>
#include <windows.h> #include <basetsd.h>
/* Implementation comes from wine/dlls/ntdll/wcstring.c */
/* /*
* @implemented * @implemented
@ -8,23 +10,23 @@
long long
_wtol(const wchar_t *str) _wtol(const wchar_t *str)
{ {
ULONG RunningTotal = 0; unsigned long RunningTotal = 0;
char bMinus = 0; char bMinus = 0;
while (iswctype(*str, _SPACE) ) { while (iswctype(*str, _SPACE) ) {
str++; str++;
} /* while */ } /* while */
if (*str == L'+') { if (*str == L'+') {
str++; str++;
} else if (*str == L'-') { } else if (*str == L'-') {
bMinus = 1; bMinus = 1;
str++; str++;
} /* if */ } /* if */
while (*str >= L'0' && *str <= L'9') { while (*str >= L'0' && *str <= L'9') {
RunningTotal = RunningTotal * 10 + *str - L'0'; RunningTotal = RunningTotal * 10 + *str - L'0';
str++; str++;
} /* while */ } /* while */
return bMinus ? -RunningTotal : RunningTotal; return bMinus ? -RunningTotal : RunningTotal;