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
53e54833
Commit
53e54833
authored
Nov 07, 2018
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Introduce for_each_iface helper and use it in write_procformatstring.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
069d7b02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
17 deletions
+24
-17
typegen.c
tools/widl/typegen.c
+24
-17
No files found.
tools/widl/typegen.c
View file @
53e54833
...
...
@@ -1465,27 +1465,34 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
}
}
static
void
write_procformatstring_stmts
(
FILE
*
file
,
int
indent
,
const
statement_list_t
*
stmts
,
type_pred_t
pred
,
unsigned
int
*
offset
)
static
void
for_each_iface
(
const
statement_list_t
*
stmts
,
void
(
*
proc
)(
type_t
*
iface
,
FILE
*
file
,
int
indent
,
unsigned
int
*
offset
),
type_pred_t
pred
,
FILE
*
file
,
int
indent
,
unsigned
int
*
offset
)
{
const
statement_t
*
stmt
;
type_t
*
iface
;
if
(
stmts
)
LIST_FOR_EACH_ENTRY
(
stmt
,
stmts
,
const
statement_t
,
entry
)
{
if
(
stmt
->
type
==
STMT_TYPE
&&
type_get_type
(
stmt
->
u
.
type
)
==
TYPE_INTERFACE
)
{
const
statement_t
*
stmt_func
;
const
type_t
*
iface
=
stmt
->
u
.
type
;
const
type_t
*
parent
=
type_iface_get_inherit
(
iface
);
int
count
=
parent
?
count_methods
(
parent
)
:
0
;
if
(
stmt
->
type
!=
STMT_TYPE
||
type_get_type
(
stmt
->
u
.
type
)
!=
TYPE_INTERFACE
)
continue
;
iface
=
stmt
->
u
.
type
;
if
(
!
pred
(
iface
))
continue
;
proc
(
iface
,
file
,
indent
,
offset
);
}
}
if
(
!
pred
(
iface
))
continue
;
STATEMENTS_FOR_EACH_FUNC
(
stmt_func
,
type_iface_get_stmts
(
iface
))
{
var_t
*
func
=
stmt_func
->
u
.
var
;
if
(
is_local
(
func
->
attrs
))
continue
;
write_procformatstring_func
(
file
,
indent
,
iface
,
func
,
offset
,
count
++
);
}
}
static
void
write_iface_procformatstring
(
type_t
*
iface
,
FILE
*
file
,
int
indent
,
unsigned
int
*
offset
)
{
const
statement_t
*
stmt
;
const
type_t
*
parent
=
type_iface_get_inherit
(
iface
);
int
count
=
parent
?
count_methods
(
parent
)
:
0
;
STATEMENTS_FOR_EACH_FUNC
(
stmt
,
type_iface_get_stmts
(
iface
))
{
var_t
*
func
=
stmt
->
u
.
var
;
if
(
is_local
(
func
->
attrs
))
continue
;
write_procformatstring_func
(
file
,
indent
,
iface
,
func
,
offset
,
count
++
);
}
}
...
...
@@ -1501,7 +1508,7 @@ void write_procformatstring(FILE *file, const statement_list_t *stmts, type_pred
print_file
(
file
,
indent
,
"{
\n
"
);
indent
++
;
write_procformatstring_stmts
(
file
,
indent
,
stmts
,
pred
,
&
offset
);
for_each_iface
(
stmts
,
write_iface_procformatstring
,
pred
,
file
,
indent
,
&
offset
);
print_file
(
file
,
indent
,
"0x0
\n
"
);
indent
--
;
...
...
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