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
a20555ea
Commit
a20555ea
authored
Oct 31, 2019
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 31, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use _ltow_s instead of int_to_string.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
f11a7402
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
31 deletions
+3
-31
jsutils.c
dlls/jscript/jsutils.c
+3
-31
No files found.
dlls/jscript/jsutils.c
View file @
a20555ea
...
...
@@ -690,36 +690,6 @@ HRESULT to_uint32(script_ctx_t *ctx, jsval_t val, UINT32 *ret)
return
hres
;
}
static
jsstr_t
*
int_to_string
(
int
i
)
{
WCHAR
buf
[
12
],
*
p
;
BOOL
neg
=
FALSE
;
if
(
!
i
)
{
static
const
WCHAR
zeroW
[]
=
{
'0'
,
0
};
return
jsstr_alloc
(
zeroW
);
}
if
(
i
<
0
)
{
neg
=
TRUE
;
i
=
-
i
;
}
p
=
buf
+
ARRAY_SIZE
(
buf
)
-
1
;
*
p
--
=
0
;
while
(
i
)
{
*
p
--
=
i
%
10
+
'0'
;
i
/=
10
;
}
if
(
neg
)
*
p
=
'-'
;
else
p
++
;
return
jsstr_alloc
(
p
);
}
HRESULT
double_to_string
(
double
n
,
jsstr_t
**
str
)
{
static
const
WCHAR
InfinityW
[]
=
{
'-'
,
'I'
,
'n'
,
'f'
,
'i'
,
'n'
,
'i'
,
't'
,
'y'
,
0
};
...
...
@@ -729,7 +699,9 @@ HRESULT double_to_string(double n, jsstr_t **str)
}
else
if
(
isinf
(
n
))
{
*
str
=
jsstr_alloc
(
n
<
0
?
InfinityW
:
InfinityW
+
1
);
}
else
if
(
is_int32
(
n
))
{
*
str
=
int_to_string
(
n
);
WCHAR
buf
[
12
];
_ltow_s
(
n
,
buf
,
ARRAY_SIZE
(
buf
),
10
);
*
str
=
jsstr_alloc
(
buf
);
}
else
{
VARIANT
strv
,
v
;
HRESULT
hres
;
...
...
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