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
bae77953
Commit
bae77953
authored
Jun 06, 2022
by
Gabriel Ivăncescu
Committed by
Alexandre Julliard
Jun 07, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
jscript: Use LIST_FOR_EACH_ENTRY_SAFE to clear Map and Set objects.
Signed-off-by:
Gabriel Ivăncescu
<
gabrielopcode@gmail.com
>
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
parent
34aeef62
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
set.c
dlls/jscript/set.c
+4
-6
No files found.
dlls/jscript/set.c
View file @
bae77953
...
@@ -223,6 +223,7 @@ static HRESULT iterate_map(MapInstance *map, script_ctx_t *ctx, unsigned argc, j
...
@@ -223,6 +223,7 @@ static HRESULT iterate_map(MapInstance *map, script_ctx_t *ctx, unsigned argc, j
static
HRESULT
Map_clear
(
script_ctx_t
*
ctx
,
jsval_t
vthis
,
WORD
flags
,
unsigned
argc
,
jsval_t
*
argv
,
static
HRESULT
Map_clear
(
script_ctx_t
*
ctx
,
jsval_t
vthis
,
WORD
flags
,
unsigned
argc
,
jsval_t
*
argv
,
jsval_t
*
r
)
jsval_t
*
r
)
{
{
struct
jsval_map_entry
*
entry
,
*
entry2
;
MapInstance
*
map
;
MapInstance
*
map
;
HRESULT
hres
;
HRESULT
hres
;
...
@@ -232,10 +233,8 @@ static HRESULT Map_clear(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned
...
@@ -232,10 +233,8 @@ static HRESULT Map_clear(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned
TRACE
(
"%p
\n
"
,
map
);
TRACE
(
"%p
\n
"
,
map
);
while
(
!
list_empty
(
&
map
->
entries
))
{
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
map
->
entries
,
struct
jsval_map_entry
,
list_entry
)
struct
jsval_map_entry
*
entry
=
LIST_ENTRY
(
list_head
(
&
map
->
entries
),
struct
jsval_map_entry
,
list_entry
);
delete_map_entry
(
map
,
entry
);
delete_map_entry
(
map
,
entry
);
}
if
(
r
)
*
r
=
jsval_undefined
();
if
(
r
)
*
r
=
jsval_undefined
();
return
S_OK
;
return
S_OK
;
...
@@ -443,6 +442,7 @@ static HRESULT Set_add(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned ar
...
@@ -443,6 +442,7 @@ static HRESULT Set_add(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned ar
static
HRESULT
Set_clear
(
script_ctx_t
*
ctx
,
jsval_t
vthis
,
WORD
flags
,
unsigned
argc
,
jsval_t
*
argv
,
static
HRESULT
Set_clear
(
script_ctx_t
*
ctx
,
jsval_t
vthis
,
WORD
flags
,
unsigned
argc
,
jsval_t
*
argv
,
jsval_t
*
r
)
jsval_t
*
r
)
{
{
struct
jsval_map_entry
*
entry
,
*
entry2
;
MapInstance
*
set
;
MapInstance
*
set
;
HRESULT
hres
;
HRESULT
hres
;
...
@@ -452,10 +452,8 @@ static HRESULT Set_clear(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned
...
@@ -452,10 +452,8 @@ static HRESULT Set_clear(script_ctx_t *ctx, jsval_t vthis, WORD flags, unsigned
TRACE
(
"%p
\n
"
,
set
);
TRACE
(
"%p
\n
"
,
set
);
while
(
!
list_empty
(
&
set
->
entries
))
{
LIST_FOR_EACH_ENTRY_SAFE
(
entry
,
entry2
,
&
set
->
entries
,
struct
jsval_map_entry
,
list_entry
)
struct
jsval_map_entry
*
entry
=
LIST_ENTRY
(
list_head
(
&
set
->
entries
),
struct
jsval_map_entry
,
list_entry
);
delete_map_entry
(
set
,
entry
);
delete_map_entry
(
set
,
entry
);
}
if
(
r
)
*
r
=
jsval_undefined
();
if
(
r
)
*
r
=
jsval_undefined
();
return
S_OK
;
return
S_OK
;
...
...
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