Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
ae1202ce
Commit
ae1202ce
authored
Jun 30, 2022
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Add _wcstoi64.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
914b1246
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-0
wcstring.c
dlls/ntdll/wcstring.c
+48
-0
No files found.
dlls/ntdll/ntdll.spec
View file @
ae1202ce
...
...
@@ -1540,6 +1540,7 @@
@ cdecl _wcslwr(wstr)
@ cdecl _wcslwr_s(wstr long)
@ cdecl _wcsnicmp(wstr wstr long)
@ cdecl -ret64 _wcstoi64(wstr ptr long)
@ cdecl _wcsupr(wstr)
@ cdecl _wcsupr_s(wstr long)
@ cdecl _wtoi(wstr)
...
...
dlls/ntdll/wcstring.c
View file @
ae1202ce
...
...
@@ -22,6 +22,7 @@
#include <ctype.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
...
...
@@ -753,6 +754,53 @@ __msvcrt_ulong __cdecl wcstoul(LPCWSTR s, LPWSTR *end, INT base)
/*********************************************************************
* _wcstoi64 (NTDLL.@)
*/
__int64
__cdecl
_wcstoi64
(
const
wchar_t
*
s
,
wchar_t
**
end
,
int
base
)
{
BOOL
negative
=
FALSE
,
empty
=
TRUE
;
__int64
ret
=
0
;
if
(
base
<
0
||
base
==
1
||
base
>
36
)
return
0
;
if
(
end
)
*
end
=
(
wchar_t
*
)
s
;
while
(
iswspace
(
*
s
))
s
++
;
if
(
*
s
==
'-'
)
{
negative
=
TRUE
;
s
++
;
}
else
if
(
*
s
==
'+'
)
s
++
;
if
((
base
==
0
||
base
==
16
)
&&
!
wctoint
(
*
s
)
&&
(
s
[
1
]
==
'x'
||
s
[
1
]
==
'X'
))
{
base
=
16
;
s
+=
2
;
}
if
(
base
==
0
)
base
=
wctoint
(
*
s
)
?
10
:
8
;
while
(
*
s
)
{
int
v
=
wctoint
(
*
s
);
if
(
v
<
0
||
v
>=
base
)
break
;
if
(
negative
)
v
=
-
v
;
s
++
;
empty
=
FALSE
;
if
(
!
negative
&&
(
ret
>
I64_MAX
/
base
||
ret
*
base
>
I64_MAX
-
v
))
ret
=
I64_MAX
;
else
if
(
negative
&&
(
ret
<
I64_MIN
/
base
||
ret
*
base
<
I64_MIN
-
v
))
ret
=
I64_MIN
;
else
ret
=
ret
*
base
+
v
;
}
if
(
end
&&
!
empty
)
*
end
=
(
wchar_t
*
)
s
;
return
ret
;
}
/*********************************************************************
* _ultow (NTDLL.@)
*
* Converts an unsigned long integer to a unicode string.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment