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
bdb13215
Commit
bdb13215
authored
Jan 19, 2009
by
Rob Shearman
Committed by
Alexandre Julliard
Jan 19, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
widl: Add a new function, type_alias_get_aliasee to wrap the retrieval of the…
widl: Add a new function, type_alias_get_aliasee to wrap the retrieval of the type that the alias aliases.
parent
4de19cff
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
14 deletions
+23
-14
header.c
tools/widl/header.c
+4
-4
parser.y
tools/widl/parser.y
+5
-5
typegen.c
tools/widl/typegen.c
+2
-2
typetree.h
tools/widl/typetree.h
+6
-0
write_msft.c
tools/widl/write_msft.c
+6
-3
No files found.
tools/widl/header.c
View file @
bdb13215
...
...
@@ -63,7 +63,7 @@ int is_ptrchain_attr(const var_t *var, enum attr_type t)
if
(
is_attr
(
type
->
attrs
,
t
))
return
1
;
else
if
(
type_is_alias
(
type
))
type
=
type
->
orig
;
type
=
type
_alias_get_aliasee
(
type
)
;
else
if
(
is_ptr
(
type
))
type
=
type_pointer_get_ref
(
type
);
else
return
0
;
...
...
@@ -79,7 +79,7 @@ int is_aliaschain_attr(const type_t *type, enum attr_type attr)
if
(
is_attr
(
t
->
attrs
,
attr
))
return
1
;
else
if
(
type_is_alias
(
t
))
t
=
t
->
orig
;
t
=
t
ype_alias_get_aliasee
(
t
)
;
else
return
0
;
}
}
...
...
@@ -424,7 +424,7 @@ void check_for_additional_prototype_types(const var_list_t *list)
}
if
(
type_is_alias
(
type
))
type
=
type
->
orig
;
type
=
type
_alias_get_aliasee
(
type
)
;
else
if
(
is_ptr
(
type
))
type
=
type_pointer_get_ref
(
type
);
else
if
(
is_array
(
type
))
...
...
@@ -472,7 +472,7 @@ static void write_generic_handle_routines(FILE *header)
static
void
write_typedef
(
FILE
*
header
,
type_t
*
type
)
{
fprintf
(
header
,
"typedef "
);
write_type_def_or_decl
(
header
,
type
->
orig
,
FALSE
,
"%s"
,
type
->
name
);
write_type_def_or_decl
(
header
,
type
_alias_get_aliasee
(
type
)
,
FALSE
,
"%s"
,
type
->
name
);
fprintf
(
header
,
";
\n
"
);
}
...
...
tools/widl/parser.y
View file @
bdb13215
...
...
@@ -1443,7 +1443,7 @@ static void set_type(var_t *v, decl_spec_t *decl_spec, const declarator_t *decl,
{
ptr_attr = get_attrv(ptr->attrs, ATTR_POINTERTYPE);
if (!ptr_attr && type_is_alias(ptr))
ptr =
ptr->orig
;
ptr =
type_alias_get_aliasee(ptr)
;
else
break;
}
...
...
@@ -1777,7 +1777,7 @@ static void add_incomplete(type_t *t)
static void fix_type(type_t *t)
{
if (type_is_alias(t) && is_incomplete(t)) {
type_t *ot = t
->orig
;
type_t *ot = t
ype_alias_get_aliasee(t)
;
fix_type(ot);
if (is_struct(ot->type) || is_union(ot->type))
t->details.structure = ot->details.structure;
...
...
@@ -2380,9 +2380,9 @@ static void check_field_common(const type_t *container_type,
break;
}
if (type_is_alias(type))
type = type
->orig
;
type = type
_alias_get_aliasee(type)
;
else if (is_ptr(type))
type = type
->ref
;
type = type
_pointer_get_ref(type)
;
else if (is_array(type))
type = type_array_get_element(type);
else
...
...
@@ -2442,7 +2442,7 @@ static void check_remoting_args(const var_t *func)
if (is_attr(type->attrs, ATTR_CONTEXTHANDLE))
break;
if (type_is_alias(type))
type = type
->orig
;
type = type
_alias_get_aliasee(type)
;
else if (is_ptr(type))
{
ptr_level++;
...
...
tools/widl/typegen.c
View file @
bdb13215
...
...
@@ -515,7 +515,7 @@ static type_t *get_user_type(const type_t *t, const char **pname)
}
if
(
type_is_alias
(
t
))
t
=
t
->
orig
;
t
=
t
ype_alias_get_aliasee
(
t
)
;
else
return
0
;
}
...
...
@@ -1053,7 +1053,7 @@ size_t type_memsize(const type_t *t, unsigned int *align)
size_t
size
=
0
;
if
(
type_is_alias
(
t
))
size
=
type_memsize
(
t
->
orig
,
align
);
size
=
type_memsize
(
t
ype_alias_get_aliasee
(
t
)
,
align
);
else
if
(
t
->
declarray
&&
is_conformant_array
(
t
))
{
type_memsize
(
type_array_get_element
(
t
),
align
);
...
...
tools/widl/typetree.h
View file @
bdb13215
...
...
@@ -180,6 +180,12 @@ static inline int type_is_alias(const type_t *type)
return
type
->
is_alias
;
}
static
inline
type_t
*
type_alias_get_aliasee
(
const
type_t
*
type
)
{
assert
(
type_is_alias
(
type
));
return
type
->
orig
;
}
static
inline
ifref_list_t
*
type_coclass_get_ifaces
(
const
type_t
*
type
)
{
assert
(
type
->
type
==
RPC_FC_COCLASS
);
...
...
tools/widl/write_msft.c
View file @
bdb13215
...
...
@@ -981,7 +981,7 @@ static int encode_type(
/* typedef'd types without public attribute aren't included in the typelib */
while
(
type
->
typelib_idx
<
0
&&
type_is_alias
(
type
)
&&
!
is_attr
(
type
->
attrs
,
ATTR_PUBLIC
))
type
=
type
->
orig
;
type
=
type
_alias_get_aliasee
(
type
)
;
chat
(
"encode_type: VT_USERDEFINED - type %p name = %s type->type %d idx %d
\n
"
,
type
,
type
->
name
,
type
->
type
,
type
->
typelib_idx
);
...
...
@@ -2095,7 +2095,10 @@ static void add_typedef_typeinfo(msft_typelib_t *typelib, type_t *tdef)
tdef
->
typelib_idx
=
typelib
->
typelib_header
.
nrtypeinfos
;
msft_typeinfo
=
create_msft_typeinfo
(
typelib
,
TKIND_ALIAS
,
tdef
->
name
,
tdef
->
attrs
);
encode_type
(
typelib
,
get_type_vt
(
tdef
->
orig
),
tdef
->
orig
,
&
msft_typeinfo
->
typeinfo
->
datatype1
,
&
msft_typeinfo
->
typeinfo
->
size
,
encode_type
(
typelib
,
get_type_vt
(
type_alias_get_aliasee
(
tdef
)),
type_alias_get_aliasee
(
tdef
),
&
msft_typeinfo
->
typeinfo
->
datatype1
,
&
msft_typeinfo
->
typeinfo
->
size
,
&
alignment
,
&
msft_typeinfo
->
typeinfo
->
datatype2
);
msft_typeinfo
->
typeinfo
->
typekind
|=
(
alignment
<<
11
|
alignment
<<
6
);
}
...
...
@@ -2269,7 +2272,7 @@ static void add_entry(msft_typelib_t *typelib, const statement_t *stmt)
if
(
is_attr
(
type_entry
->
type
->
attrs
,
ATTR_PUBLIC
))
add_typedef_typeinfo
(
typelib
,
type_entry
->
type
);
else
add_type_typeinfo
(
typelib
,
type_
entry
->
type
->
orig
);
add_type_typeinfo
(
typelib
,
type_
alias_get_aliasee
(
type_entry
->
type
)
);
}
break
;
}
...
...
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