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
c0cd0d17
Commit
c0cd0d17
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: Avoid direct access to jsval_t struct.
parent
9e782982
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
jsutils.c
dlls/jscript/jsutils.c
+18
-17
No files found.
dlls/jscript/jsutils.c
View file @
c0cd0d17
...
@@ -219,15 +219,15 @@ void jsval_release(jsval_t val)
...
@@ -219,15 +219,15 @@ void jsval_release(jsval_t val)
{
{
switch
(
jsval_type
(
val
))
{
switch
(
jsval_type
(
val
))
{
case
JSV_OBJECT
:
case
JSV_OBJECT
:
if
(
val
.
u
.
obj
)
if
(
get_object
(
val
)
)
IDispatch_Release
(
val
.
u
.
obj
);
IDispatch_Release
(
get_object
(
val
)
);
break
;
break
;
case
JSV_STRING
:
case
JSV_STRING
:
SysFreeString
(
val
.
u
.
str
);
SysFreeString
(
get_string
(
val
)
);
break
;
break
;
case
JSV_VARIANT
:
case
JSV_VARIANT
:
VariantClear
(
val
.
u
.
v
);
VariantClear
(
get_variant
(
val
)
);
heap_free
(
val
.
u
.
v
);
heap_free
(
get_variant
(
val
)
);
break
;
break
;
default:
default:
break
;
break
;
...
@@ -236,17 +236,18 @@ void jsval_release(jsval_t val)
...
@@ -236,17 +236,18 @@ void jsval_release(jsval_t val)
HRESULT
jsval_variant
(
jsval_t
*
val
,
VARIANT
*
var
)
HRESULT
jsval_variant
(
jsval_t
*
val
,
VARIANT
*
var
)
{
{
VARIANT
*
v
;
HRESULT
hres
;
HRESULT
hres
;
val
->
type
=
JSV_VARIANT
;
val
->
type
=
JSV_VARIANT
;
val
->
u
.
v
=
heap_alloc
(
sizeof
(
VARIANT
));
val
->
u
.
v
=
v
=
heap_alloc
(
sizeof
(
VARIANT
));
if
(
!
v
al
->
u
.
v
)
if
(
!
v
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
V_VT
(
v
al
->
u
.
v
)
=
VT_EMPTY
;
V_VT
(
v
)
=
VT_EMPTY
;
hres
=
VariantCopy
(
v
al
->
u
.
v
,
var
);
hres
=
VariantCopy
(
v
,
var
);
if
(
FAILED
(
hres
))
if
(
FAILED
(
hres
))
heap_free
(
v
al
->
u
.
v
);
heap_free
(
v
);
return
hres
;
return
hres
;
}
}
...
@@ -338,14 +339,14 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
...
@@ -338,14 +339,14 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
return
S_OK
;
return
S_OK
;
case
JSV_OBJECT
:
case
JSV_OBJECT
:
V_VT
(
retv
)
=
VT_DISPATCH
;
V_VT
(
retv
)
=
VT_DISPATCH
;
if
(
val
.
u
.
obj
)
if
(
get_object
(
val
)
)
IDispatch_AddRef
(
val
.
u
.
obj
);
IDispatch_AddRef
(
get_object
(
val
)
);
V_DISPATCH
(
retv
)
=
val
.
u
.
obj
;
V_DISPATCH
(
retv
)
=
get_object
(
val
)
;
return
S_OK
;
return
S_OK
;
case
JSV_STRING
:
case
JSV_STRING
:
V_VT
(
retv
)
=
VT_BSTR
;
V_VT
(
retv
)
=
VT_BSTR
;
if
(
val
.
u
.
str
)
{
if
(
get_string
(
val
)
)
{
V_BSTR
(
retv
)
=
clone_bstr
(
val
.
u
.
str
);
V_BSTR
(
retv
)
=
clone_bstr
(
get_string
(
val
)
);
if
(
!
V_BSTR
(
retv
))
if
(
!
V_BSTR
(
retv
))
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
else
{
}
else
{
...
@@ -367,11 +368,11 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
...
@@ -367,11 +368,11 @@ HRESULT jsval_to_variant(jsval_t val, VARIANT *retv)
}
}
case
JSV_BOOL
:
case
JSV_BOOL
:
V_VT
(
retv
)
=
VT_BOOL
;
V_VT
(
retv
)
=
VT_BOOL
;
V_BOOL
(
retv
)
=
val
.
u
.
b
?
VARIANT_TRUE
:
VARIANT_FALSE
;
V_BOOL
(
retv
)
=
get_bool
(
val
)
?
VARIANT_TRUE
:
VARIANT_FALSE
;
return
S_OK
;
return
S_OK
;
case
JSV_VARIANT
:
case
JSV_VARIANT
:
V_VT
(
retv
)
=
VT_EMPTY
;
V_VT
(
retv
)
=
VT_EMPTY
;
return
VariantCopy
(
retv
,
val
.
u
.
v
);
return
VariantCopy
(
retv
,
get_variant
(
val
)
);
}
}
assert
(
0
);
assert
(
0
);
...
...
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