widl: Use type_get_type to determine the types during statement enumeration.

This commit is contained in:
Rob Shearman 2009-02-23 13:48:05 +00:00 committed by Alexandre Julliard
parent ba91ee607c
commit fb934347b4
7 changed files with 20 additions and 20 deletions

View File

@ -469,7 +469,7 @@ static void write_client_ifaces(const statement_list_t *stmts, int expr_eval_rou
const statement_t *stmt;
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
{
if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
int has_func = 0;
const statement_t *stmt2;

View File

@ -824,7 +824,7 @@ static void write_local_stubs_stmts(FILE *local_stubs, const statement_list_t *s
const statement_t *stmt;
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
{
if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
write_locals(local_stubs, stmt->u.type, TRUE);
else if (stmt->type == STMT_LIBRARY)
write_local_stubs_stmts(local_stubs, stmt->u.lib->stmts);
@ -1047,7 +1047,7 @@ static void write_imports(FILE *header, const statement_list_t *stmts)
switch (stmt->type)
{
case STMT_TYPE:
if (stmt->u.type->type == RPC_FC_IP)
if (type_get_type(stmt->u.type) == TYPE_INTERFACE)
write_imports(header, type_iface_get_stmts(stmt->u.type));
break;
case STMT_TYPEREF:
@ -1078,12 +1078,12 @@ static void write_forward_decls(FILE *header, const statement_list_t *stmts)
switch (stmt->type)
{
case STMT_TYPE:
if (stmt->u.type->type == RPC_FC_IP)
if (type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
if (is_object(stmt->u.type->attrs) || is_attr(stmt->u.type->attrs, ATTR_DISPINTERFACE))
write_forward(header, stmt->u.type);
}
else if (stmt->u.type->type == RPC_FC_COCLASS)
else if (type_get_type(stmt->u.type) == TYPE_COCLASS)
write_coclass_forward(header, stmt->u.type);
break;
case STMT_TYPEREF:
@ -1112,7 +1112,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
switch (stmt->type)
{
case STMT_TYPE:
if (stmt->u.type->type == RPC_FC_IP)
if (type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
type_t *iface = stmt->u.type;
if (is_attr(stmt->u.type->attrs, ATTR_DISPINTERFACE) || is_object(stmt->u.type->attrs))
@ -1128,7 +1128,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
write_rpc_interface_end(header, iface);
}
}
else if (stmt->u.type->type == RPC_FC_COCLASS)
else if (type_get_type(stmt->u.type) == TYPE_COCLASS)
write_coclass(header, stmt->u.type);
else
{
@ -1139,7 +1139,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
case STMT_TYPEREF:
/* FIXME: shouldn't write out forward declarations for undefined
* interfaces but a number of our IDL files depend on this */
if (stmt->u.type->type == RPC_FC_IP && !stmt->u.type->written)
if (type_get_type(stmt->u.type) == TYPE_INTERFACE && !stmt->u.type->written)
write_forward(header, stmt->u.type);
break;
case STMT_IMPORTLIB:
@ -1164,7 +1164,7 @@ static void write_header_stmts(FILE *header, const statement_list_t *stmts, cons
fprintf(header, "%s\n", stmt->u.str);
break;
case STMT_DECLARATION:
if (iface && stmt->u.var->type->type == RPC_FC_FUNCTION)
if (iface && type_get_type(stmt->u.var->type) == TYPE_FUNCTION)
{
if (!ignore_funcs)
{

View File

@ -2533,7 +2533,7 @@ static void check_statements(const statement_list_t *stmts, int is_inside_librar
{
if (stmt->type == STMT_LIBRARY)
check_statements(stmt->u.lib->stmts, TRUE);
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
check_functions(stmt->u.type, is_inside_library);
}
}
@ -2546,7 +2546,7 @@ static void check_all_user_types(const statement_list_t *stmts)
{
if (stmt->type == STMT_LIBRARY)
check_all_user_types(stmt->u.lib->stmts);
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP &&
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE &&
!is_local(stmt->u.type->attrs))
{
const statement_t *stmt_func;

View File

@ -709,7 +709,7 @@ static int does_any_iface(const statement_list_t *stmts, type_pred_t pred)
if (does_any_iface(stmt->u.lib->stmts, pred))
return TRUE;
}
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
if (pred(stmt->u.type))
return TRUE;
@ -746,7 +746,7 @@ static void write_proxy_stmts(const statement_list_t *stmts, unsigned int *proc_
{
if (stmt->type == STMT_LIBRARY)
write_proxy_stmts(stmt->u.lib->stmts, proc_offset);
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
if (need_proxy(stmt->u.type))
write_proxy(stmt->u.type, proc_offset);
@ -772,7 +772,7 @@ static void build_iface_list( const statement_list_t *stmts, type_t **ifaces[],
{
if (stmt->type == STMT_LIBRARY)
build_iface_list(stmt->u.lib->stmts, ifaces, count);
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
type_t *iface = stmt->u.type;
if (type_iface_get_inherit(iface) && need_proxy(iface))

View File

@ -407,7 +407,7 @@ static void write_server_stmts(const statement_list_t *stmts, int expr_eval_rout
{
if (stmt->type == STMT_LIBRARY)
write_server_stmts(stmt->u.lib->stmts, expr_eval_routines, proc_offset);
else if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
else if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
type_t *iface = stmt->u.type;
if (!need_stub(iface))

View File

@ -724,7 +724,7 @@ static void write_procformatstring_stmts(FILE *file, int indent, const statement
const statement_t *stmt;
if (stmts) LIST_FOR_EACH_ENTRY( stmt, stmts, const statement_t, entry )
{
if (stmt->type == STMT_TYPE && stmt->u.type->type == RPC_FC_IP)
if (stmt->type == STMT_TYPE && type_get_type(stmt->u.type) == TYPE_INTERFACE)
{
const statement_t *stmt_func;
if (!pred(stmt->u.type))
@ -2655,7 +2655,7 @@ static unsigned int process_tfs_stmts(FILE *file, const statement_list_t *stmts,
process_tfs_stmts(file, stmt->u.lib->stmts, pred, typeformat_offset);
continue;
}
else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP)
else if (stmt->type != STMT_TYPE || type_get_type(stmt->u.type) != TYPE_INTERFACE)
continue;
iface = stmt->u.type;
@ -3420,7 +3420,7 @@ unsigned int get_size_procformatstring(const statement_list_t *stmts, type_pred_
size += get_size_procformatstring(stmt->u.lib->stmts, pred) - 1;
continue;
}
else if (stmt->type != STMT_TYPE || stmt->u.type->type != RPC_FC_IP)
else if (stmt->type != STMT_TYPE || type_get_type(stmt->u.type) != TYPE_INTERFACE)
continue;
iface = stmt->u.type;

View File

@ -349,7 +349,7 @@ static void write_id_data_stmts(const statement_list_t *stmts)
if (stmt->type == STMT_TYPE)
{
const type_t *type = stmt->u.type;
if (type->type == RPC_FC_IP)
if (type_get_type(type) == TYPE_INTERFACE)
{
const UUID *uuid;
if (!is_object(type->attrs) && !is_attr(type->attrs, ATTR_DISPINTERFACE))
@ -358,7 +358,7 @@ static void write_id_data_stmts(const statement_list_t *stmts)
write_guid(idfile, is_attr(type->attrs, ATTR_DISPINTERFACE) ? "DIID" : "IID",
type->name, uuid);
}
else if (type->type == RPC_FC_COCLASS)
else if (type_get_type(type) == TYPE_COCLASS)
{
const UUID *uuid = get_attrp(type->attrs, ATTR_UUID);
write_guid(idfile, "CLSID", type->name, uuid);