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
a638c663
Commit
a638c663
authored
Oct 16, 2010
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add a separate function to write the proc format string for a function.
parent
63d5217f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
36 deletions
+24
-36
typegen.c
tools/widl/typegen.c
+24
-36
No files found.
tools/widl/typegen.c
View file @
a638c663
...
@@ -879,21 +879,9 @@ static unsigned int write_procformatstring_type(FILE *file, int indent,
...
@@ -879,21 +879,9 @@ static unsigned int write_procformatstring_type(FILE *file, int indent,
return
size
;
return
size
;
}
}
static
void
write_procformatstring_
stmts
(
FILE
*
file
,
int
indent
,
const
statement_list_t
*
stmts
,
static
void
write_procformatstring_
func
(
FILE
*
file
,
int
indent
,
type_pred_t
pred
,
unsigned
int
*
offset
)
const
var_t
*
func
,
unsigned
int
*
offset
)
{
{
const
statement_t
*
stmt
;
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
;
if
(
!
pred
(
stmt
->
u
.
type
))
continue
;
STATEMENTS_FOR_EACH_FUNC
(
stmt_func
,
type_iface_get_stmts
(
stmt
->
u
.
type
))
{
const
var_t
*
func
=
stmt_func
->
u
.
var
;
if
(
is_local
(
func
->
attrs
))
continue
;
/* emit argument data */
/* emit argument data */
if
(
type_get_function_args
(
func
->
type
))
if
(
type_get_function_args
(
func
->
type
))
{
{
...
@@ -908,7 +896,7 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement
...
@@ -908,7 +896,7 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement
/* emit return value data */
/* emit return value data */
if
(
is_void
(
type_function_get_rettype
(
func
->
type
)))
if
(
is_void
(
type_function_get_rettype
(
func
->
type
)))
{
{
print_file
(
file
,
0
,
"/* %u (void) */
\n
"
,
*
offset
);
print_file
(
file
,
0
,
"/* %u (void) */
\n
"
,
*
offset
);
print_file
(
file
,
indent
,
"0x5b, /* FC_END */
\n
"
);
print_file
(
file
,
indent
,
"0x5b, /* FC_END */
\n
"
);
print_file
(
file
,
indent
,
"0x5c, /* FC_PAD */
\n
"
);
print_file
(
file
,
indent
,
"0x5c, /* FC_PAD */
\n
"
);
*
offset
+=
2
;
*
offset
+=
2
;
...
@@ -918,6 +906,24 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement
...
@@ -918,6 +906,24 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
*
offset
+=
write_procformatstring_type
(
file
,
indent
,
type_function_get_rettype
(
func
->
type
),
NULL
,
TRUE
);
*
offset
+=
write_procformatstring_type
(
file
,
indent
,
type_function_get_rettype
(
func
->
type
),
NULL
,
TRUE
);
}
}
}
static
void
write_procformatstring_stmts
(
FILE
*
file
,
int
indent
,
const
statement_list_t
*
stmts
,
type_pred_t
pred
,
unsigned
int
*
offset
)
{
const
statement_t
*
stmt
;
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
;
if
(
!
pred
(
stmt
->
u
.
type
))
continue
;
STATEMENTS_FOR_EACH_FUNC
(
stmt_func
,
type_iface_get_stmts
(
stmt
->
u
.
type
))
{
const
var_t
*
func
=
stmt_func
->
u
.
var
;
if
(
is_local
(
func
->
attrs
))
continue
;
write_procformatstring_func
(
file
,
indent
,
func
,
offset
);
}
}
}
}
else
if
(
stmt
->
type
==
STMT_LIBRARY
)
else
if
(
stmt
->
type
==
STMT_LIBRARY
)
...
@@ -3867,29 +3873,11 @@ void write_remoting_arguments(FILE *file, int indent, const var_t *func, const c
...
@@ -3867,29 +3873,11 @@ void write_remoting_arguments(FILE *file, int indent, const var_t *func, const c
}
}
static
unsigned
int
get_size_procformatstring_type
(
const
type_t
*
type
,
const
attr_list_t
*
attrs
)
{
return
write_procformatstring_type
(
NULL
,
0
,
type
,
attrs
,
FALSE
);
}
unsigned
int
get_size_procformatstring_func
(
const
var_t
*
func
)
unsigned
int
get_size_procformatstring_func
(
const
var_t
*
func
)
{
{
const
var_t
*
var
;
unsigned
int
offset
=
0
;
unsigned
int
size
=
0
;
write_procformatstring_func
(
NULL
,
0
,
func
,
&
offset
);
return
offset
;
/* argument list size */
if
(
type_get_function_args
(
func
->
type
))
LIST_FOR_EACH_ENTRY
(
var
,
type_get_function_args
(
func
->
type
),
const
var_t
,
entry
)
size
+=
get_size_procformatstring_type
(
var
->
type
,
var
->
attrs
);
/* return value size */
if
(
is_void
(
type_function_get_rettype
(
func
->
type
)))
size
+=
2
;
/* FC_END and FC_PAD */
else
size
+=
get_size_procformatstring_type
(
type_function_get_rettype
(
func
->
type
),
NULL
);
return
size
;
}
}
unsigned
int
get_size_procformatstring
(
const
statement_list_t
*
stmts
,
type_pred_t
pred
)
unsigned
int
get_size_procformatstring
(
const
statement_list_t
*
stmts
,
type_pred_t
pred
)
...
...
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