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
5fecc71d
Commit
5fecc71d
authored
Sep 17, 2012
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 17, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Get rid of no longer needed VARIANT helpers.
parent
a3f7f0f7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
35 deletions
+12
-35
jscript.h
dlls/jscript/jscript.h
+0
-33
jsutils.c
dlls/jscript/jsutils.c
+12
-2
No files found.
dlls/jscript/jscript.h
View file @
5fecc71d
...
...
@@ -387,16 +387,6 @@ static inline BOOL is_vclass(vdisp_t *vdisp, jsclass_t class)
return
is_jsdisp
(
vdisp
)
&&
is_class
(
vdisp
->
u
.
jsdisp
,
class
);
}
static
inline
BOOL
is_num_vt
(
enum
VARENUM
vt
)
{
return
vt
==
VT_I4
||
vt
==
VT_R8
;
}
static
inline
DOUBLE
num_val
(
const
VARIANT
*
v
)
{
return
V_VT
(
v
)
==
VT_I4
?
V_I4
(
v
)
:
V_R8
(
v
);
}
#ifndef INT32_MIN
#define INT32_MIN (-2147483647-1)
#endif
...
...
@@ -410,29 +400,6 @@ static inline BOOL is_int32(double d)
return
INT32_MIN
<=
d
&&
d
<=
INT32_MAX
&&
(
double
)(
int
)
d
==
d
;
}
static
inline
void
num_set_int
(
VARIANT
*
v
,
INT
i
)
{
V_VT
(
v
)
=
VT_I4
;
V_I4
(
v
)
=
i
;
}
static
inline
void
num_set_val
(
VARIANT
*
v
,
DOUBLE
d
)
{
if
(
is_int32
(
d
))
{
V_VT
(
v
)
=
VT_I4
;
V_I4
(
v
)
=
d
;
}
else
{
V_VT
(
v
)
=
VT_R8
;
V_R8
(
v
)
=
d
;
}
}
static
inline
void
var_set_jsdisp
(
VARIANT
*
v
,
jsdisp_t
*
jsdisp
)
{
V_VT
(
v
)
=
VT_DISPATCH
;
V_DISPATCH
(
v
)
=
to_disp
(
jsdisp
);
}
static
inline
DWORD
make_grfdex
(
script_ctx_t
*
ctx
,
DWORD
flags
)
{
return
(
ctx
->
version
<<
28
)
|
flags
;
...
...
dlls/jscript/jsutils.c
View file @
5fecc71d
...
...
@@ -352,9 +352,19 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
V_BSTR
(
retv
)
=
NULL
;
}
return
S_OK
;
case
JSV_NUMBER
:
num_set_val
(
retv
,
val
.
u
.
n
);
case
JSV_NUMBER
:
{
double
n
=
get_number
(
val
);
if
(
is_int32
(
n
))
{
V_VT
(
retv
)
=
VT_I4
;
V_I4
(
retv
)
=
n
;
}
else
{
V_VT
(
retv
)
=
VT_R8
;
V_R8
(
retv
)
=
n
;
}
return
S_OK
;
}
case
JSV_BOOL
:
V_VT
(
retv
)
=
VT_BOOL
;
V_BOOL
(
retv
)
=
val
.
u
.
b
?
VARIANT_TRUE
:
VARIANT_FALSE
;
...
...
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