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
e4679b0c
Commit
e4679b0c
authored
Jun 14, 2007
by
Dan Hipschman
Committed by
Alexandre Julliard
Jun 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Handle encapsulated unions.
parent
8709a060
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
+26
-3
parser.y
tools/widl/parser.y
+1
-1
typegen.c
tools/widl/typegen.c
+25
-2
No files found.
tools/widl/parser.y
View file @
e4679b0c
...
...
@@ -509,7 +509,7 @@ cases: { $$ = NULL; }
| cases case { $$ = append_var( $1, $2 ); }
;
case: tCASE expr ':' field { attr_t *a = make_attrp(ATTR_CASE,
$2
);
case: tCASE expr ':' field { attr_t *a = make_attrp(ATTR_CASE,
append_expr( NULL, $2 )
);
$$ = $4; if (!$$) $$ = make_var(NULL);
$$->attrs = append_attr( $$->attrs, a );
}
...
...
tools/widl/typegen.c
View file @
e4679b0c
...
...
@@ -1327,7 +1327,11 @@ static size_t write_pointer_only_tfs(FILE *file, const attr_list_t *attrs, int p
static
void
write_branch_type
(
FILE
*
file
,
const
type_t
*
t
,
unsigned
int
*
tfsoff
)
{
if
(
is_base_type
(
t
->
type
))
if
(
t
==
NULL
)
{
print_file
(
file
,
2
,
"NdrFcShort(0x0),
\t
/* No type */
\n
"
);
}
else
if
(
is_base_type
(
t
->
type
))
{
print_file
(
file
,
2
,
"NdrFcShort(0x80%02x),
\t
/* Simple arm type: %s */
\n
"
,
t
->
type
,
string_of_type
(
t
->
type
));
...
...
@@ -1349,7 +1353,7 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
unsigned
int
align
=
0
;
unsigned
int
start_offset
;
size_t
size
=
type_memsize
(
type
,
&
align
);
var_list_t
*
fields
=
type
->
fields
;
var_list_t
*
fields
;
size_t
nbranch
=
0
;
type_t
*
deftype
=
NULL
;
short
nodeftype
=
0xffff
;
...
...
@@ -1357,6 +1361,14 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
guard_rec
(
type
);
if
(
type
->
type
==
RPC_FC_ENCAPSULATED_UNION
)
{
const
var_t
*
uv
=
LIST_ENTRY
(
list_tail
(
type
->
fields
),
const
var_t
,
entry
);
fields
=
uv
->
type
->
fields
;
}
else
fields
=
type
->
fields
;
if
(
fields
)
LIST_FOR_EACH_ENTRY
(
f
,
fields
,
var_t
,
entry
)
{
expr_list_t
*
cases
=
get_attrp
(
f
->
attrs
,
ATTR_CASE
);
...
...
@@ -1369,6 +1381,17 @@ static size_t write_union_tfs(FILE *file, type_t *type, unsigned int *tfsoff)
start_offset
=
*
tfsoff
;
update_tfsoff
(
type
,
start_offset
,
file
);
print_file
(
file
,
0
,
"/* %d */
\n
"
,
start_offset
);
if
(
type
->
type
==
RPC_FC_ENCAPSULATED_UNION
)
{
const
var_t
*
sv
=
LIST_ENTRY
(
list_head
(
type
->
fields
),
const
var_t
,
entry
);
const
type_t
*
st
=
sv
->
type
;
size_t
ss
=
type_memsize
(
st
,
&
align
);
print_file
(
file
,
2
,
"0x%x,
\t
/* %s */
\n
"
,
type
->
type
,
string_of_type
(
type
->
type
));
print_file
(
file
,
2
,
"0x%x,
\t
/* Switch type= %s */
\n
"
,
(
ss
<<
4
)
|
st
->
type
,
string_of_type
(
st
->
type
));
*
tfsoff
+=
2
;
}
print_file
(
file
,
2
,
"NdrFcShort(0x%x),
\t
/* %d */
\n
"
,
size
,
size
);
print_file
(
file
,
2
,
"NdrFcShort(0x%x),
\t
/* %d */
\n
"
,
nbranch
,
nbranch
);
*
tfsoff
+=
4
;
...
...
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