Rob Shearman : widl: Use type_get_type to determine the types during statement enumeration.
Alexandre Julliard
julliard at winehq.org
Mon Feb 23 10:00:47 CST 2009
Module: wine
Branch: master
Commit: fb934347b44c9a16c897c09042bbb871265e2d93
URL: http://source.winehq.org/git/wine.git/?a=commit;h=fb934347b44c9a16c897c09042bbb871265e2d93
Author: Rob Shearman <robertshearman at gmail.com>
Date: Mon Feb 23 13:48:05 2009 +0000
widl: Use type_get_type to determine the types during statement enumeration.
---
tools/widl/client.c | 2 +-
tools/widl/header.c | 16 ++++++++--------
tools/widl/parser.y | 4 ++--
tools/widl/proxy.c | 6 +++---
tools/widl/server.c | 2 +-
tools/widl/typegen.c | 6 +++---
tools/widl/widl.c | 4 ++--
7 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/tools/widl/client.c b/tools/widl/client.c
index 559d8c8..b683a14 100644
--- a/tools/widl/client.c
+++ b/tools/widl/client.c
@@ -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;
diff --git a/tools/widl/header.c b/tools/widl/header.c
index f86d2b0..031e7dd 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -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)
{
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 168f555..ee9e465 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -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;
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 615b2a1..d4f5c03 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -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))
diff --git a/tools/widl/server.c b/tools/widl/server.c
index ff61a8a..6f79cdb 100644
--- a/tools/widl/server.c
+++ b/tools/widl/server.c
@@ -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))
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 6e55d11..de9cd67 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -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;
diff --git a/tools/widl/widl.c b/tools/widl/widl.c
index ab15726..62b7ff5 100644
--- a/tools/widl/widl.c
+++ b/tools/widl/widl.c
@@ -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);
More information about the wine-cvs
mailing list