Zebediah Figura : widl: Move the "idx" parameter from struct func_details to var_t.
Alexandre Julliard
julliard at winehq.org
Wed Aug 14 20:17:22 CDT 2019
Module: wine
Branch: master
Commit: 8b2a065892b4010a2a31692d03c147e6fc2594c7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8b2a065892b4010a2a31692d03c147e6fc2594c7
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Tue Aug 13 21:08:07 2019 -0500
widl: Move the "idx" parameter from struct func_details to var_t.
It's not a part of the type; e.g. it doesn't make sense on a function pointer.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/widl/proxy.c | 4 ++--
tools/widl/typetree.c | 7 +++----
tools/widl/widltypes.h | 6 ++++--
3 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 6f19ff1..466c462 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -614,14 +614,14 @@ static void write_proxy(type_t *iface, unsigned int *proc_offset)
if (!is_local(func->attrs)) {
const var_t *cas = is_callas(func->attrs);
const char *cname = cas ? cas->name : NULL;
- int idx = func->declspec.type->details.function->idx;
+ int idx = func->func_idx;
if (cname) {
const statement_t *stmt2;
STATEMENTS_FOR_EACH_FUNC(stmt2, type_iface_get_stmts(iface)) {
const var_t *m = stmt2->u.var;
if (!strcmp(m->name, cname))
{
- idx = m->declspec.type->details.function->idx;
+ idx = m->func_idx;
break;
}
}
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index 0a8ae0f..e727d8c 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -174,7 +174,6 @@ type_t *type_new_function(var_list_t *args)
t = make_type(TYPE_FUNCTION);
t->details.function = xmalloc(sizeof(*t->details.function));
t->details.function->args = args;
- t->details.function->idx = -1;
return t;
}
@@ -413,9 +412,9 @@ type_t *type_new_bitfield(type_t *field, const expr_t *bits)
return t;
}
-static int compute_method_indexes(type_t *iface)
+static unsigned int compute_method_indexes(type_t *iface)
{
- int idx;
+ unsigned int idx;
statement_t *stmt;
if (!iface->details.iface)
@@ -430,7 +429,7 @@ static int compute_method_indexes(type_t *iface)
{
var_t *func = stmt->u.var;
if (!is_callas(func->attrs))
- func->declspec.type->details.function->idx = idx++;
+ func->func_idx = idx++;
}
return idx;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 729d712..5e0f34d 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -342,7 +342,6 @@ struct func_details
{
var_list_t *args;
struct _var_t *retval;
- int idx;
};
struct iface_details
@@ -460,9 +459,12 @@ struct _var_t {
decl_spec_t declspec;
attr_list_t *attrs;
expr_t *eval;
- unsigned int procstring_offset;
+
unsigned int typestring_offset;
+ /* fields specific to functions */
+ unsigned int procstring_offset, func_idx;
+
struct _loc_info_t loc_info;
/* parser-internal */
More information about the wine-cvs
mailing list