@@ -9,7 +9,7 @@ __int64 CDECL _wtoi64_l(const wchar_t *str, _locale_t locale)
9
9
ULONGLONG RunningTotal = 0 ;
10
10
BOOL bMinus = FALSE;
11
11
12
- while (isspaceW ( * str )) {
12
+ while (iswctype (( int ) * str , _SPACE )) {
13
13
str ++ ;
14
14
} /* while */
15
15
@@ -48,21 +48,23 @@ __int64 CDECL _wcstoi64_l(const wchar_t *nptr,
48
48
BOOL negative = FALSE;
49
49
__int64 ret = 0 ;
50
50
51
+ #ifndef _LIBCNT_
51
52
TRACE ("(%s %p %d %p)\n" , debugstr_w (nptr ), endptr , base , locale );
53
+ #endif
52
54
53
55
if (!MSVCRT_CHECK_PMT (nptr != NULL )) return 0 ;
54
56
if (!MSVCRT_CHECK_PMT (base == 0 || base >= 2 )) return 0 ;
55
57
if (!MSVCRT_CHECK_PMT (base <= 36 )) return 0 ;
56
58
57
- while ( isspaceW ( * nptr )) nptr ++ ;
59
+ while ( iswctype (( int ) * nptr , _SPACE )) nptr ++ ;
58
60
59
61
if (* nptr == '-' ) {
60
62
negative = TRUE;
61
63
nptr ++ ;
62
64
} else if (* nptr == '+' )
63
65
nptr ++ ;
64
66
65
- if ((base == 0 || base == 16 ) && * nptr == '0' && tolowerW (* (nptr + 1 ))== 'x' ) {
67
+ if ((base == 0 || base == 16 ) && * nptr == '0' && towlower (* (nptr + 1 ))== 'x' ) {
66
68
base = 16 ;
67
69
nptr += 2 ;
68
70
}
@@ -75,7 +77,7 @@ __int64 CDECL _wcstoi64_l(const wchar_t *nptr,
75
77
}
76
78
77
79
while (* nptr ) {
78
- wchar_t cur = tolowerW (* nptr );
80
+ wchar_t cur = towlower (* nptr );
79
81
int v ;
80
82
81
83
if (cur >='0' && cur <='9' ) {
@@ -95,10 +97,14 @@ __int64 CDECL _wcstoi64_l(const wchar_t *nptr,
95
97
96
98
if (!negative && (ret > _I64_MAX /base || ret * base > _I64_MAX - v )) {
97
99
ret = _I64_MAX ;
100
+ #ifndef _LIBCNT_
98
101
* _errno () = ERANGE ;
102
+ #endif
99
103
} else if (negative && (ret < _I64_MIN /base || ret * base < _I64_MIN - v )) {
100
104
ret = _I64_MIN ;
105
+ #ifndef _LIBCNT_
101
106
* _errno () = ERANGE ;
107
+ #endif
102
108
} else
103
109
ret = ret * base + v ;
104
110
}
@@ -129,21 +135,23 @@ unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr,
129
135
BOOL negative = FALSE;
130
136
unsigned __int64 ret = 0 ;
131
137
138
+ #ifndef _LIBCNT_
132
139
TRACE ("(%s %p %d %p)\n" , debugstr_w (nptr ), endptr , base , locale );
140
+ #endif
133
141
134
142
if (!MSVCRT_CHECK_PMT (nptr != NULL )) return 0 ;
135
143
if (!MSVCRT_CHECK_PMT (base == 0 || base >= 2 )) return 0 ;
136
144
if (!MSVCRT_CHECK_PMT (base <= 36 )) return 0 ;
137
145
138
- while ( isspaceW ( * nptr )) nptr ++ ;
146
+ while ( iswctype (( int ) * nptr , _SPACE )) nptr ++ ;
139
147
140
148
if (* nptr == '-' ) {
141
149
negative = TRUE;
142
150
nptr ++ ;
143
151
} else if (* nptr == '+' )
144
152
nptr ++ ;
145
153
146
- if ((base == 0 || base == 16 ) && * nptr == '0' && tolowerW (* (nptr + 1 ))== 'x' ) {
154
+ if ((base == 0 || base == 16 ) && * nptr == '0' && towlower (* (nptr + 1 ))== 'x' ) {
147
155
base = 16 ;
148
156
nptr += 2 ;
149
157
}
@@ -156,7 +164,7 @@ unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr,
156
164
}
157
165
158
166
while (* nptr ) {
159
- wchar_t cur = tolowerW (* nptr );
167
+ wchar_t cur = towlower (* nptr );
160
168
int v ;
161
169
162
170
if (cur >='0' && cur <='9' ) {
@@ -173,8 +181,10 @@ unsigned __int64 CDECL _wcstoui64_l(const wchar_t *nptr,
173
181
174
182
if (ret > _UI64_MAX /base || ret * base > _UI64_MAX - v ) {
175
183
ret = _UI64_MAX ;
184
+ #ifndef _LIBCNT_
176
185
* _errno () = ERANGE ;
177
- } else
186
+ #endif
187
+ } else
178
188
ret = ret * base + v ;
179
189
}
180
190
0 commit comments