Zebediah Figura : widl: Use the type_type field to track whether the type is an alias.
Alexandre Julliard
julliard at winehq.org
Thu Aug 15 14:50:47 CDT 2019
Module: wine
Branch: master
Commit: 2babcd6c1cd62e6d055cea4b3026d8769fc24aca
URL: https://source.winehq.org/git/wine.git/?a=commit;h=2babcd6c1cd62e6d055cea4b3026d8769fc24aca
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Wed Aug 14 21:45:49 2019 -0500
widl: Use the type_type field to track whether the type is an alias.
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/widl/typetree.c | 4 +---
tools/widl/typetree.h | 4 ++--
tools/widl/widltypes.h | 3 ---
3 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index e727d8c..d823a46 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -59,7 +59,6 @@ type_t *make_type(enum type_type type)
t->user_types_registered = FALSE;
t->tfswrite = FALSE;
t->checked = FALSE;
- t->is_alias = FALSE;
t->typelib_idx = -1;
init_loc_info(&t->loc_info);
return t;
@@ -188,12 +187,11 @@ type_t *type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t
type_t *type_new_alias(type_t *t, const char *name)
{
- type_t *a = duptype(t, 0);
+ type_t *a = make_type(TYPE_ALIAS);
a->name = xstrdup(name);
a->attrs = NULL;
a->orig = t;
- a->is_alias = TRUE;
/* for pointer types */
a->details = t->details;
init_loc_info(&a->loc_info);
diff --git a/tools/widl/typetree.h b/tools/widl/typetree.h
index 07179a0..db8c1fc 100644
--- a/tools/widl/typetree.h
+++ b/tools/widl/typetree.h
@@ -59,7 +59,7 @@ type_t *duptype(type_t *t, int dupname);
/* un-alias the type until finding the non-alias type */
static inline type_t *type_get_real_type(const type_t *type)
{
- if (type->is_alias)
+ if (type->type_type == TYPE_ALIAS)
return type_get_real_type(type->orig);
else
return (type_t *)type;
@@ -299,7 +299,7 @@ static inline unsigned char type_array_get_ptr_default_fc(const type_t *type)
static inline int type_is_alias(const type_t *type)
{
- return type->is_alias;
+ return type->type_type == TYPE_ALIAS;
}
static inline type_t *type_alias_get_aliasee(const type_t *type)
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 5e0f34d..29ff266 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -451,7 +451,6 @@ struct _type_t {
unsigned int user_types_registered : 1;
unsigned int tfswrite : 1; /* if the type needs to be written to the TFS */
unsigned int checked : 1;
- unsigned int is_alias : 1; /* is the type an alias? */
};
struct _var_t {
@@ -593,8 +592,6 @@ char *format_namespace(struct namespace *namespace, const char *prefix, const ch
static inline enum type_type type_get_type_detect_alias(const type_t *type)
{
- if (type->is_alias)
- return TYPE_ALIAS;
return type->type_type;
}
More information about the wine-cvs
mailing list