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
7ff6c631
Commit
7ff6c631
authored
Mar 28, 2024
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Merge interpreted stubs header and parameters output into a single function.
parent
e01cb2b9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
22 deletions
+54
-22
typegen.c
tools/widl/typegen.c
+54
-22
No files found.
tools/widl/typegen.c
View file @
7ff6c631
...
@@ -1357,7 +1357,7 @@ int is_interpreted_func( const type_t *iface, const var_t *func )
...
@@ -1357,7 +1357,7 @@ int is_interpreted_func( const type_t *iface, const var_t *func )
return
(
get_stub_mode
()
!=
MODE_Os
);
return
(
get_stub_mode
()
!=
MODE_Os
);
}
}
static
void
write_proc_func_
header
(
FILE
*
file
,
int
indent
,
const
type_t
*
iface
,
static
void
write_proc_func_
interp
(
FILE
*
file
,
int
indent
,
const
type_t
*
iface
,
const
var_t
*
func
,
unsigned
int
*
offset
,
const
var_t
*
func
,
unsigned
int
*
offset
,
unsigned
short
num_proc
)
unsigned
short
num_proc
)
{
{
...
@@ -1365,6 +1365,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
...
@@ -1365,6 +1365,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
var_list_t
*
args
=
type_function_get_args
(
func
->
declspec
.
type
);
var_list_t
*
args
=
type_function_get_args
(
func
->
declspec
.
type
);
unsigned
char
explicit_fc
,
implicit_fc
;
unsigned
char
explicit_fc
,
implicit_fc
;
unsigned
char
handle_flags
;
unsigned
char
handle_flags
;
var_t
*
retval
=
type_function_get_retval
(
func
->
declspec
.
type
);
const
var_t
*
handle_var
=
get_func_handle_var
(
iface
,
func
,
&
explicit_fc
,
&
implicit_fc
);
const
var_t
*
handle_var
=
get_func_handle_var
(
iface
,
func
,
&
explicit_fc
,
&
implicit_fc
);
unsigned
char
oi_flags
=
Oi_HAS_RPCFLAGS
|
Oi_USE_NEW_INIT_ROUTINES
;
unsigned
char
oi_flags
=
Oi_HAS_RPCFLAGS
|
Oi_USE_NEW_INIT_ROUTINES
;
unsigned
int
rpc_flags
=
get_rpc_flags
(
func
->
attrs
);
unsigned
int
rpc_flags
=
get_rpc_flags
(
func
->
attrs
);
...
@@ -1393,7 +1394,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
...
@@ -1393,7 +1394,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
param_num
++
;
param_num
++
;
nb_args
++
;
nb_args
++
;
}
}
if
(
!
is_void
(
type_function_get_rettype
(
func
->
declspec
.
type
)
))
if
(
!
is_void
(
retval
->
declspec
.
type
))
{
{
stack_size
+=
pointer_size
;
stack_size
+=
pointer_size
;
nb_args
++
;
nb_args
++
;
...
@@ -1445,6 +1446,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
...
@@ -1445,6 +1446,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
if
(
get_stub_mode
()
==
MODE_Oif
)
if
(
get_stub_mode
()
==
MODE_Oif
)
{
{
unsigned
int
stack_offset
=
is_object
(
iface
)
?
pointer_size
:
0
;
unsigned
char
oi2_flags
=
get_func_oi2_flags
(
func
);
unsigned
char
oi2_flags
=
get_func_oi2_flags
(
func
);
unsigned
char
ext_flags
=
0
;
unsigned
char
ext_flags
=
0
;
unsigned
int
size
;
unsigned
int
size
;
...
@@ -1487,6 +1489,43 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
...
@@ -1487,6 +1489,43 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
print_file
(
file
,
indent
,
"NdrFcShort(0x%x),
\n
"
,
fpu_mask
);
/* floating point mask */
print_file
(
file
,
indent
,
"NdrFcShort(0x%x),
\n
"
,
fpu_mask
);
/* floating point mask */
*
offset
+=
2
;
*
offset
+=
2
;
}
}
/* emit argument data */
if
(
args
)
LIST_FOR_EACH_ENTRY
(
var
,
args
,
var_t
,
entry
)
{
print_file
(
file
,
0
,
"/* %u (parameter %s) */
\n
"
,
*
offset
,
var
->
name
);
*
offset
+=
write_new_procformatstring_type
(
file
,
indent
,
var
,
FALSE
,
&
stack_offset
);
}
/* emit return value data */
if
(
!
is_void
(
retval
->
declspec
.
type
))
{
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
*
offset
+=
write_new_procformatstring_type
(
file
,
indent
,
retval
,
TRUE
,
&
stack_offset
);
}
}
else
/* old style */
{
/* emit argument data */
if
(
args
)
LIST_FOR_EACH_ENTRY
(
var
,
args
,
var_t
,
entry
)
{
print_file
(
file
,
0
,
"/* %u (parameter %s) */
\n
"
,
*
offset
,
var
->
name
);
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
var
,
FALSE
,
TRUE
);
}
/* emit return value data */
if
(
is_void
(
retval
->
declspec
.
type
))
{
print_file
(
file
,
0
,
"/* %u (void) */
\n
"
,
*
offset
);
print_file
(
file
,
indent
,
"0x5b,
\t
/* FC_END */
\n
"
);
print_file
(
file
,
indent
,
"0x5c,
\t
/* FC_PAD */
\n
"
);
*
offset
+=
2
;
}
else
{
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
retval
,
TRUE
,
TRUE
);
}
}
}
}
}
...
@@ -1494,12 +1533,13 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
...
@@ -1494,12 +1533,13 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
const
var_t
*
func
,
unsigned
int
*
offset
,
const
var_t
*
func
,
unsigned
int
*
offset
,
unsigned
short
num_proc
)
unsigned
short
num_proc
)
{
{
unsigned
int
stack_offset
=
is_object
(
iface
)
?
pointer_size
:
0
;
var_t
*
retval
;
int
is_interpreted
=
is_interpreted_func
(
iface
,
func
);
int
is_new_style
=
is_interpreted
&&
(
get_stub_mode
()
==
MODE_Oif
);
var_t
*
retval
=
type_function_get_retval
(
func
->
declspec
.
type
);
if
(
is_interpreted
)
write_proc_func_header
(
file
,
indent
,
iface
,
func
,
offset
,
num_proc
);
if
(
is_interpreted_func
(
iface
,
func
))
{
write_proc_func_interp
(
file
,
indent
,
iface
,
func
,
offset
,
num_proc
);
return
;
}
/* emit argument data */
/* emit argument data */
if
(
type_function_get_args
(
func
->
declspec
.
type
))
if
(
type_function_get_args
(
func
->
declspec
.
type
))
...
@@ -1508,31 +1548,23 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
...
@@ -1508,31 +1548,23 @@ static void write_procformatstring_func( FILE *file, int indent, const type_t *i
LIST_FOR_EACH_ENTRY
(
var
,
type_function_get_args
(
func
->
declspec
.
type
),
const
var_t
,
entry
)
LIST_FOR_EACH_ENTRY
(
var
,
type_function_get_args
(
func
->
declspec
.
type
),
const
var_t
,
entry
)
{
{
print_file
(
file
,
0
,
"/* %u (parameter %s) */
\n
"
,
*
offset
,
var
->
name
);
print_file
(
file
,
0
,
"/* %u (parameter %s) */
\n
"
,
*
offset
,
var
->
name
);
if
(
is_new_style
)
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
var
,
FALSE
,
FALSE
);
*
offset
+=
write_new_procformatstring_type
(
file
,
indent
,
var
,
FALSE
,
&
stack_offset
);
else
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
var
,
FALSE
,
is_interpreted
);
}
}
}
}
/* emit return value data */
/* emit return value data */
retval
=
type_function_get_retval
(
func
->
declspec
.
type
);
if
(
is_void
(
retval
->
declspec
.
type
))
if
(
is_void
(
retval
->
declspec
.
type
))
{
{
if
(
!
is_new_style
)
print_file
(
file
,
0
,
"/* %u (void) */
\n
"
,
*
offset
);
{
print_file
(
file
,
indent
,
"0x5b,
\t
/* FC_END */
\n
"
);
print_file
(
file
,
0
,
"/* %u (void) */
\n
"
,
*
offset
);
print_file
(
file
,
indent
,
"0x5c,
\t
/* FC_PAD */
\n
"
);
print_file
(
file
,
indent
,
"0x5b,
\t
/* FC_END */
\n
"
);
*
offset
+=
2
;
print_file
(
file
,
indent
,
"0x5c,
\t
/* FC_PAD */
\n
"
);
*
offset
+=
2
;
}
}
}
else
else
{
{
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
print_file
(
file
,
0
,
"/* %u (return value) */
\n
"
,
*
offset
);
if
(
is_new_style
)
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
retval
,
TRUE
,
FALSE
);
*
offset
+=
write_new_procformatstring_type
(
file
,
indent
,
retval
,
TRUE
,
&
stack_offset
);
else
*
offset
+=
write_old_procformatstring_type
(
file
,
indent
,
retval
,
TRUE
,
is_interpreted
);
}
}
}
}
...
...
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