#include <precomp.h>
Go to the source code of this file.
◆ wcstol()
Definition at line 17 of file wcstol.c.
18{
19 const wchar_t *
s = nptr;
20 long acc;
22 unsigned long cutoff;
23 int neg = 0, any, cutlim;
24
25
26
27
28
29
30 do {
34 {
35 neg = 1;
37 }
41 c ==
L'0' && (*
s ==
L'x' || *
s ==
L'X'))
42 {
46 }
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
68 cutlim = cutoff % (
unsigned long)
base;
70 for (acc = 0, any = 0;;
c = *
s++)
71 {
76 else
77 break;
79 break;
80 if (any < 0 || (
unsigned long)acc > cutoff || (acc == cutoff &&
c > cutlim))
81 any = -1;
82 else
83 {
84 any = 1;
87 }
88 }
89 if (any < 0)
90 {
92 }
93 else if (neg)
94 acc = 0-acc;
95 if (endptr != 0)
96 *endptr = any ? (
wchar_t *)((
size_t)(
s - 1)) : (
wchar_t *)((
size_t)nptr);
97 return acc;
98}
int __cdecl iswctype(wint_t wc, wctype_t wctypeFlags)