mirror of
https://github.com/reactos/reactos.git
synced 2025-08-04 23:45:42 +00:00
Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys.
This commit is contained in:
parent
b94e2d8ca0
commit
c2c66aff7d
24198 changed files with 0 additions and 37285 deletions
38
sdk/lib/crt/string/wtol.c
Normal file
38
sdk/lib/crt/string/wtol.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <basetsd.h>
|
||||
|
||||
/* Implementation comes from wine/dlls/ntdll/wcstring.c */
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
long
|
||||
_wtol(const wchar_t *str)
|
||||
{
|
||||
unsigned long RunningTotal = 0;
|
||||
char bMinus = 0;
|
||||
|
||||
if (str == NULL)
|
||||
return 0;
|
||||
|
||||
while (iswctype(*str, _SPACE) ) {
|
||||
str++;
|
||||
} /* while */
|
||||
|
||||
if (*str == L'+') {
|
||||
str++;
|
||||
} else if (*str == L'-') {
|
||||
bMinus = 1;
|
||||
str++;
|
||||
} /* if */
|
||||
|
||||
while (*str >= L'0' && *str <= L'9') {
|
||||
RunningTotal = RunningTotal * 10 + *str - L'0';
|
||||
str++;
|
||||
} /* while */
|
||||
|
||||
return bMinus ? 0-RunningTotal : RunningTotal;
|
||||
}
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue