Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47710 Signed-off-by: Zebediah Figura z.figura12@gmail.com --- tools/widl/parser.y | 2 +- tools/widl/typetree.c | 32 ++++++++------------------------ 2 files changed, 9 insertions(+), 25 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y index 59875a5b160..64293fbee75 100644 --- a/tools/widl/parser.y +++ b/tools/widl/parser.y @@ -779,7 +779,7 @@ m_ident: { $$ = NULL; } | ident ;
-t_ident: { $$ = NULL; } +t_ident: { $$ = gen_name(); } | aIDENTIFIER { $$ = $1; } | aKNOWNTYPE { $$ = $1; } ; diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c index e9afc6fdd28..2d110e757ba 100644 --- a/tools/widl/typetree.c +++ b/tools/widl/typetree.c @@ -265,18 +265,14 @@ type_t *type_new_void(void)
type_t *type_new_enum(const char *name, struct namespace *namespace, int defined, var_list_t *enums) { - type_t *t = NULL; - - if (name) - t = find_type(name, namespace,tsENUM); + type_t *t = find_type(name, namespace,tsENUM);
if (!t) { t = make_type(TYPE_ENUM); t->name = name; t->namespace = namespace; - if (name) - reg_type(t, name, namespace, tsENUM); + reg_type(t, name, namespace, tsENUM); }
if (!t->defined && defined) @@ -293,18 +289,14 @@ type_t *type_new_enum(const char *name, struct namespace *namespace, int defined
type_t *type_new_struct(char *name, struct namespace *namespace, int defined, var_list_t *fields) { - type_t *t = NULL; - - if (name) - t = find_type(name, namespace, tsSTRUCT); + type_t *t = find_type(name, namespace, tsSTRUCT);
if (!t) { t = make_type(TYPE_STRUCT); t->name = name; t->namespace = namespace; - if (name) - reg_type(t, name, namespace, tsSTRUCT); + reg_type(t, name, namespace, tsSTRUCT); }
if (!t->defined && defined) @@ -321,17 +313,13 @@ type_t *type_new_struct(char *name, struct namespace *namespace, int defined, va
type_t *type_new_nonencapsulated_union(const char *name, int defined, var_list_t *fields) { - type_t *t = NULL; - - if (name) - t = find_type(name, NULL, tsUNION); + type_t *t = find_type(name, NULL, tsUNION);
if (!t) { t = make_type(TYPE_UNION); t->name = name; - if (name) - reg_type(t, name, NULL, tsUNION); + reg_type(t, name, NULL, tsUNION); }
if (!t->defined && defined) @@ -348,17 +336,13 @@ type_t *type_new_nonencapsulated_union(const char *name, int defined, var_list_t
type_t *type_new_encapsulated_union(char *name, var_t *switch_field, var_t *union_field, var_list_t *cases) { - type_t *t = NULL; - - if (name) - t = find_type(name, NULL, tsUNION); + type_t *t = find_type(name, NULL, tsUNION);
if (!t) { t = make_type(TYPE_ENCAPSULATED_UNION); t->name = name; - if (name) - reg_type(t, name, NULL, tsUNION); + reg_type(t, name, NULL, tsUNION); } t->type_type = TYPE_ENCAPSULATED_UNION;