Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
0ec16351
Commit
0ec16351
authored
Apr 27, 2010
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 27, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msvcrt: Added _wcstoi64 and _wcstoui64 implementation.
parent
c4d68778
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
173 additions
and
15 deletions
+173
-15
msvcr80.spec
dlls/msvcr80/msvcr80.spec
+4
-4
msvcr90.spec
dlls/msvcr90/msvcr90.spec
+4
-4
msvcrt.spec
dlls/msvcrt/msvcrt.spec
+4
-4
string.c
dlls/msvcrt/string.c
+3
-3
wcs.c
dlls/msvcrt/wcs.c
+158
-0
No files found.
dlls/msvcr80/msvcr80.spec
View file @
0ec16351
...
...
@@ -1106,13 +1106,13 @@
@ cdecl _wcsset(wstr long) msvcrt._wcsset
@ stub _wcsset_s
@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l
@
stub
_wcstoi64
@
stub
_wcstoi64_l
@
cdecl _wcstoi64(wstr ptr long) msvcrt.
_wcstoi64
@
cdecl _wcstoi64_l(wstr ptr long ptr) msvcrt.
_wcstoi64_l
@ stub _wcstol_l
@ stub _wcstombs_l
@ stub _wcstombs_s_l
@
stub
_wcstoui64
@
stub
_wcstoui64_l
@
cdecl _wcstoui64(wstr ptr long) msvcrt.
_wcstoui64
@
cdecl _wcstoui64_l(wstr ptr long ptr) msvcrt.
_wcstoui64_l
@ stub _wcstoul_l
@ cdecl _wcsupr(wstr) msvcrt._wcsupr
@ stub _wcsupr_l
...
...
dlls/msvcr90/msvcr90.spec
View file @
0ec16351
...
...
@@ -1093,13 +1093,13 @@
@ cdecl _wcsset(wstr long) msvcrt._wcsset
@ stub _wcsset_s
@ cdecl _wcstod_l(wstr ptr) msvcrt._wcstod_l
@
stub
_wcstoi64
@
stub
_wcstoi64_l
@
cdecl _wcstoi64(wstr ptr long) msvcrt.
_wcstoi64
@
cdecl _wcstoi64_l(wstr ptr long ptr) msvcrt.
_wcstoi64_l
@ stub _wcstol_l
@ stub _wcstombs_l
@ stub _wcstombs_s_l
@
stub
_wcstoui64
@
stub
_wcstoui64_l
@
cdecl _wcstoui64(wstr ptr long) msvcrt.
_wcstoui64
@
cdecl _wcstoui64_l(wstr ptr long ptr) msvcrt.
_wcstoui64_l
@ stub _wcstoul_l
@ cdecl _wcsupr(wstr) msvcrt._wcsupr
@ stub _wcsupr_l
...
...
dlls/msvcrt/msvcrt.spec
View file @
0ec16351
...
...
@@ -1035,13 +1035,13 @@
@ cdecl _wcsrev(wstr)
@ cdecl _wcsset(wstr long)
# stub _wcsset_s
# stub
_wcstoi64
# stub
_wcstoi64_l
@ cdecl _wcstoi64(wstr ptr long) MSVCRT_
_wcstoi64
@ cdecl _wcstoi64_l(wstr ptr long ptr) MSVCRT_
_wcstoi64_l
# stub _wcstol_l
# stub _wcstombs_l
# stub _wcstombs_s_l
# stub
_wcstoui64
# stub
_wcstoui64_l
@ cdecl _wcstoui64(wstr ptr long) MSVCRT_
_wcstoui64
@ cdecl _wcstoui64_l(wstr ptr long ptr) MSVCRT_
_wcstoui64_l
# stub _wcstoul_l
@ cdecl _wcsupr(wstr) ntdll._wcsupr
# stub _wcsupr_l
...
...
dlls/msvcrt/string.c
View file @
0ec16351
...
...
@@ -529,10 +529,10 @@ __int64 CDECL MSVCRT_strtoi64_l(const char *nptr, char **endptr, int base, MSVCR
if
(
!
negative
&&
(
ret
>
MSVCRT_I64_MAX
/
base
||
ret
*
base
>
MSVCRT_I64_MAX
-
v
))
{
ret
=
MSVCRT_I64_MAX
;
*
MSVCRT__errno
()
=
ERANGE
;
*
MSVCRT__errno
()
=
MSVCRT_
ERANGE
;
}
else
if
(
negative
&&
(
ret
<
MSVCRT_I64_MIN
/
base
||
ret
*
base
<
MSVCRT_I64_MIN
-
v
))
{
ret
=
MSVCRT_I64_MIN
;
*
MSVCRT__errno
()
=
ERANGE
;
*
MSVCRT__errno
()
=
MSVCRT_
ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
}
...
...
@@ -606,7 +606,7 @@ unsigned __int64 CDECL MSVCRT_strtoui64_l(const char *nptr, char **endptr, int b
if
(
ret
>
MSVCRT_UI64_MAX
/
base
||
ret
*
base
>
MSVCRT_UI64_MAX
-
v
)
{
ret
=
MSVCRT_UI64_MAX
;
*
MSVCRT__errno
()
=
ERANGE
;
*
MSVCRT__errno
()
=
MSVCRT_
ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
}
...
...
dlls/msvcrt/wcs.c
View file @
0ec16351
...
...
@@ -1408,3 +1408,161 @@ INT CDECL MSVCRT_wcscat_s(MSVCRT_wchar_t* dst, MSVCRT_size_t elem, const MSVCRT_
dst
[
0
]
=
'\0'
;
return
MSVCRT_ERANGE
;
}
/*********************************************************************
* _wctoi64_l (MSVCR90.@)
*
* FIXME: locale parameter is ignored
*/
__int64
CDECL
MSVCRT__wcstoi64_l
(
const
MSVCRT_wchar_t
*
nptr
,
MSVCRT_wchar_t
**
endptr
,
int
base
,
MSVCRT__locale_t
locale
)
{
BOOL
negative
=
FALSE
;
__int64
ret
=
0
;
TRACE
(
"(%s %p %d %p)
\n
"
,
debugstr_w
(
nptr
),
endptr
,
base
,
locale
);
if
(
!
nptr
||
base
<
0
||
base
>
36
||
base
==
1
)
{
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
return
0
;
}
while
(
isspaceW
(
*
nptr
))
nptr
++
;
if
(
*
nptr
==
'-'
)
{
negative
=
TRUE
;
nptr
++
;
}
else
if
(
*
nptr
==
'+'
)
nptr
++
;
if
((
base
==
0
||
base
==
16
)
&&
*
nptr
==
'0'
&&
tolowerW
(
*
(
nptr
+
1
))
==
'x'
)
{
base
=
16
;
nptr
+=
2
;
}
if
(
base
==
0
)
{
if
(
*
nptr
==
'0'
)
base
=
8
;
else
base
=
10
;
}
while
(
*
nptr
)
{
char
cur
=
tolowerW
(
*
nptr
);
int
v
;
if
(
isdigitW
(
cur
))
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
cur
-
'0'
;
}
else
{
if
(
cur
<
'a'
||
cur
>=
'a'
+
base
-
10
)
break
;
v
=
cur
-
'a'
+
10
;
}
if
(
negative
)
v
=
-
v
;
nptr
++
;
if
(
!
negative
&&
(
ret
>
MSVCRT_I64_MAX
/
base
||
ret
*
base
>
MSVCRT_I64_MAX
-
v
))
{
ret
=
MSVCRT_I64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
if
(
negative
&&
(
ret
<
MSVCRT_I64_MIN
/
base
||
ret
*
base
<
MSVCRT_I64_MIN
-
v
))
{
ret
=
MSVCRT_I64_MIN
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
}
if
(
endptr
)
*
endptr
=
(
MSVCRT_wchar_t
*
)
nptr
;
return
ret
;
}
/*********************************************************************
* _wcstoi64 (MSVCR90.@)
*/
__int64
CDECL
MSVCRT__wcstoi64
(
const
MSVCRT_wchar_t
*
nptr
,
MSVCRT_wchar_t
**
endptr
,
int
base
)
{
return
MSVCRT__wcstoi64_l
(
nptr
,
endptr
,
base
,
NULL
);
}
/*********************************************************************
* _wcstoui64_l (MSVCR90.@)
*
* FIXME: locale parameter is ignored
*/
unsigned
__int64
CDECL
MSVCRT__wcstoui64_l
(
const
MSVCRT_wchar_t
*
nptr
,
MSVCRT_wchar_t
**
endptr
,
int
base
,
MSVCRT__locale_t
locale
)
{
BOOL
negative
=
FALSE
;
unsigned
__int64
ret
=
0
;
TRACE
(
"(%s %p %d %p)
\n
"
,
debugstr_w
(
nptr
),
endptr
,
base
,
locale
);
if
(
!
nptr
||
base
<
0
||
base
>
36
||
base
==
1
)
{
MSVCRT__invalid_parameter
(
NULL
,
NULL
,
NULL
,
0
,
0
);
return
0
;
}
while
(
isspaceW
(
*
nptr
))
nptr
++
;
if
(
*
nptr
==
'-'
)
{
negative
=
TRUE
;
nptr
++
;
}
else
if
(
*
nptr
==
'+'
)
nptr
++
;
if
((
base
==
0
||
base
==
16
)
&&
*
nptr
==
'0'
&&
tolowerW
(
*
(
nptr
+
1
))
==
'x'
)
{
base
=
16
;
nptr
+=
2
;
}
if
(
base
==
0
)
{
if
(
*
nptr
==
'0'
)
base
=
8
;
else
base
=
10
;
}
while
(
*
nptr
)
{
char
cur
=
tolowerW
(
*
nptr
);
int
v
;
if
(
isdigit
(
cur
))
{
if
(
cur
>=
'0'
+
base
)
break
;
v
=
*
nptr
-
'0'
;
}
else
{
if
(
cur
<
'a'
||
cur
>=
'a'
+
base
-
10
)
break
;
v
=
cur
-
'a'
+
10
;
}
nptr
++
;
if
(
ret
>
MSVCRT_UI64_MAX
/
base
||
ret
*
base
>
MSVCRT_UI64_MAX
-
v
)
{
ret
=
MSVCRT_UI64_MAX
;
*
MSVCRT__errno
()
=
MSVCRT_ERANGE
;
}
else
ret
=
ret
*
base
+
v
;
}
if
(
endptr
)
*
endptr
=
(
MSVCRT_wchar_t
*
)
nptr
;
return
negative
?
-
ret
:
ret
;
}
/*********************************************************************
* _wcstoui64 (MSVCR90.@)
*/
unsigned
__int64
CDECL
MSVCRT__wcstoui64
(
const
MSVCRT_wchar_t
*
nptr
,
MSVCRT_wchar_t
**
endptr
,
int
base
)
{
return
MSVCRT__wcstoui64_l
(
nptr
,
endptr
,
base
,
NULL
);
}
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