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
ee60c49d
Commit
ee60c49d
authored
Jul 21, 2008
by
Lei Zhang
Committed by
Alexandre Julliard
Jul 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Use our own implementation of atoi and atol.
parent
960ae6fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
19 deletions
+48
-19
string.c
dlls/ntdll/string.c
+19
-19
string.c
dlls/ntdll/tests/string.c
+29
-0
No files found.
dlls/ntdll/string.c
View file @
ee60c49d
...
...
@@ -465,24 +465,6 @@ ULONG __cdecl NTDLL_strtoul( const char *nptr, char **endptr, int base )
/*********************************************************************
* atoi (NTDLL.@)
*/
int
__cdecl
NTDLL_atoi
(
const
char
*
nptr
)
{
return
atoi
(
nptr
);
}
/*********************************************************************
* atol (NTDLL.@)
*/
LONG
__cdecl
NTDLL_atol
(
const
char
*
nptr
)
{
return
atol
(
nptr
);
}
/*********************************************************************
* _ultoa (NTDLL.@)
*
* Convert an unsigned long integer to a string.
...
...
@@ -727,7 +709,7 @@ char * __cdecl _i64toa(
* - No check is made for value overflow, only the lower 64 bits are assigned.
* - If str is NULL it crashes, as the native function does.
*/
LONGLONG
__cdecl
_atoi64
(
char
*
str
)
LONGLONG
__cdecl
_atoi64
(
c
onst
c
har
*
str
)
{
ULONGLONG
RunningTotal
=
0
;
char
bMinus
=
0
;
...
...
@@ -753,6 +735,24 @@ LONGLONG __cdecl _atoi64( char *str )
/*********************************************************************
* atoi (NTDLL.@)
*/
int
__cdecl
NTDLL_atoi
(
const
char
*
nptr
)
{
return
_atoi64
(
nptr
);
}
/*********************************************************************
* atol (NTDLL.@)
*/
LONG
__cdecl
NTDLL_atol
(
const
char
*
nptr
)
{
return
_atoi64
(
nptr
);
}
/*********************************************************************
* sprintf (NTDLL.@)
*/
int
__cdecl
NTDLL_sprintf
(
char
*
str
,
const
char
*
format
,
...
)
...
...
dlls/ntdll/tests/string.c
View file @
ee60c49d
...
...
@@ -893,6 +893,31 @@ static void test_wtoi(void)
}
/* for */
}
static
void
test_atoi
(
void
)
{
int
test_num
;
int
result
;
for
(
test_num
=
0
;
test_num
<
NB_STR2LONG
;
test_num
++
)
{
result
=
patoi
(
str2long
[
test_num
].
str
);
ok
(
result
==
str2long
[
test_num
].
value
,
"(test %d): call failed: _atoi(
\"
%s
\"
) has result %d, expected: %d
\n
"
,
test_num
,
str2long
[
test_num
].
str
,
result
,
str2long
[
test_num
].
value
);
}
}
static
void
test_atol
(
void
)
{
int
test_num
;
int
result
;
for
(
test_num
=
0
;
test_num
<
NB_STR2LONG
;
test_num
++
)
{
result
=
patol
(
str2long
[
test_num
].
str
);
ok
(
result
==
str2long
[
test_num
].
value
,
"(test %d): call failed: _atol(
\"
%s
\"
) has result %d, expected: %d
\n
"
,
test_num
,
str2long
[
test_num
].
str
,
result
,
str2long
[
test_num
].
value
);
}
}
static
void
test_wtol
(
void
)
{
...
...
@@ -1095,4 +1120,8 @@ START_TEST(string)
test_wtoi64
();
if
(
p_wcschr
&&
p_wcsrchr
)
test_wcsfuncs
();
if
(
patoi
)
test_atoi
();
if
(
patol
)
test_atol
();
}
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