Signed-off-by: Zebediah Figura z.figura12@gmail.com --- tools/widl/header.c | 6 +++--- tools/widl/parser.y | 2 +- tools/widl/proxy.c | 12 ++++++------ tools/widl/typegen.c | 6 +++--- tools/widl/typetree.h | 7 +++++++ tools/widl/widl.c | 6 +++--- 6 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/tools/widl/header.c b/tools/widl/header.c index a862a72b52..f4bf13aca8 100644 --- a/tools/widl/header.c +++ b/tools/widl/header.c @@ -1651,8 +1651,8 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts) if (is_object(iface) || is_attr(iface->attrs, ATTR_DISPINTERFACE)) { write_forward(header, iface); - if (iface->details.iface->async_iface) - write_forward(header, iface->details.iface->async_iface); + if (type_iface_get_async_iface(iface)) + write_forward(header, type_iface_get_async_iface(iface)); } } else if (type_get_type(stmt->u.type) == TYPE_COCLASS) @@ -1688,7 +1688,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons if (type_get_type(stmt->u.type) == TYPE_INTERFACE) { type_t *iface = stmt->u.type; - type_t *async_iface = iface->details.iface->async_iface; + type_t *async_iface = type_iface_get_async_iface(iface); if (is_object(iface)) is_object_interface++; if (is_attr(stmt->u.type->attrs, ATTR_DISPINTERFACE) || is_object(stmt->u.type)) { diff --git a/tools/widl/parser.y b/tools/widl/parser.y index daff825771..e39d801464 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -2809,7 +2809,7 @@ static void check_async_uuid(type_t *iface)
inherit = iface->details.iface->inherit; if (inherit && strcmp(inherit->name, "IUnknown")) - inherit = inherit->details.iface->async_iface; + inherit = type_iface_get_async_iface(inherit); if (!inherit) error_loc("async_uuid applied to an interface with incompatible parent\n");
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 466c46219f..22c045d788 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -739,7 +739,7 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset) print_proxy( "{\n"); indent++; print_proxy( "%s_%s\n", - iface->details.iface->async_iface == iface ? "CStdAsyncStubBuffer" : "CStdStubBuffer", + type_iface_get_async_iface(iface) == iface ? "CStdAsyncStubBuffer" : "CStdStubBuffer", need_delegation_indirect(iface) ? "DELEGATING_METHODS" : "METHODS"); indent--; print_proxy( "}\n"); @@ -840,8 +840,8 @@ static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_ if (need_proxy(iface)) { write_proxy(iface, proc_offset); - if (iface->details.iface->async_iface) - write_proxy(iface->details.iface->async_iface, proc_offset); + if (type_iface_get_async_iface(iface)) + write_proxy(type_iface_get_async_iface(iface), proc_offset); } } } @@ -870,9 +870,9 @@ static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[], { *ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(**ifaces) ); (*ifaces)[(*count)++] = iface; - if (iface->details.iface->async_iface) + if (type_iface_get_async_iface(iface)) { - iface = iface->details.iface->async_iface; + iface = type_iface_get_async_iface(iface); *ifaces = xrealloc( *ifaces, (*count + 1) * sizeof(**ifaces) ); (*ifaces)[(*count)++] = iface; } @@ -1012,7 +1012,7 @@ static void write_proxy_routines(const statement_list_t *stmts) table_version = get_stub_mode() == MODE_Oif ? 2 : 1; for (i = 0; i < count; i++) { - if (interfaces[i]->details.iface->async_iface != interfaces[i]) continue; + if (type_iface_get_async_iface(interfaces[i]) != interfaces[i]) continue; if (table_version != 6) { fprintf(proxy, "static const IID *_AsyncInterfaceTable[] =\n"); diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 86611aed68..47d12f59d1 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1394,7 +1394,7 @@ static void write_proc_func_header( FILE *file, int indent, const type_t *iface,
if (is_attr( func->attrs, ATTR_NOTIFY )) ext_flags |= 0x08; /* HasNotify */ if (is_attr( func->attrs, ATTR_NOTIFYFLAG )) ext_flags |= 0x10; /* HasNotify2 */ - if (iface == iface->details.iface->async_iface) oi2_flags |= 0x20; + if (iface == type_iface_get_async_iface(iface)) oi2_flags |= 0x20;
size = get_function_buffer_size( func, PASS_IN ); print_file( file, indent, "NdrFcShort(0x%x),\t/* client buffer = %u */\n", size, size ); @@ -1493,8 +1493,8 @@ static void for_each_iface(const statement_list_t *stmts, iface = stmt->u.type; if (!pred(iface)) continue; proc(iface, file, indent, offset); - if (iface->details.iface->async_iface) - proc(iface->details.iface->async_iface, file, indent, offset); + if (type_iface_get_async_iface(iface)) + proc(type_iface_get_async_iface(iface), file, indent, offset); } }
diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h index 22232fc0a7..4eb0a0a57f 100644 --- a/tools/widl/typetree.h +++ b/tools/widl/typetree.h @@ -162,6 +162,13 @@ static inline type_t *type_iface_get_inherit(const type_t *type) return type->details.iface->inherit; }
+static inline type_t *type_iface_get_async_iface(const type_t *type) +{ + type = type_get_real_type(type); + assert(type_get_type(type) == TYPE_INTERFACE); + return type->details.iface->async_iface; +} + static inline var_list_t *type_dispiface_get_props(const type_t *type) { type = type_get_real_type(type); diff --git a/tools/widl/widl.c b/tools/widl/widl.c index 0bcf67ba73..1620dfdb3a 100644 --- a/tools/widl/widl.c +++ b/tools/widl/widl.c @@ -494,10 +494,10 @@ static void write_id_data_stmts(const statement_list_t *stmts) uuid = get_attrp(type->attrs, ATTR_UUID); write_id_guid(idfile, "IID", is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID", type->name, uuid); - if (type->details.iface->async_iface) + if (type_iface_get_async_iface(type)) { - uuid = get_attrp(type->details.iface->async_iface->attrs, ATTR_UUID); - write_id_guid(idfile, "IID", "IID", type->details.iface->async_iface->name, uuid); + uuid = get_attrp(type_iface_get_async_iface(type)->attrs, ATTR_UUID); + write_id_guid(idfile, "IID", "IID", type_iface_get_async_iface(type)->name, uuid); } } else if (type_get_type(type) == TYPE_COCLASS)