Zebediah Figura : widl: Create exactly one type_t object per named enum type.
Alexandre Julliard
julliard at winehq.org
Tue Aug 20 15:35:22 CDT 2019
Module: wine
Branch: master
Commit: 0aa6049c8d46dd6d4e92c30f7b0380d1e5f46af2
URL: https://source.winehq.org/git/wine.git/?a=commit;h=0aa6049c8d46dd6d4e92c30f7b0380d1e5f46af2
Author: Zebediah Figura <z.figura12 at gmail.com>
Date: Mon Aug 19 21:17:39 2019 -0500
widl: Create exactly one type_t object per named enum type.
Based on a patch by Richard Pospesel.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47035
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/widl/typetree.c | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/tools/widl/typetree.c b/tools/widl/typetree.c
index a7fd561..faa5820 100644
--- a/tools/widl/typetree.c
+++ b/tools/widl/typetree.c
@@ -265,25 +265,27 @@ 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 *tag_type = name ? find_type(name, namespace, tsENUM) : NULL;
- type_t *t = make_type(TYPE_ENUM);
- t->name = name;
- t->namespace = namespace;
-
- if (tag_type && tag_type->details.enumeration)
- t->details.enumeration = tag_type->details.enumeration;
- else if (defined)
+ type_t *t = NULL;
+
+ if (name)
+ 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);
+ }
+
+ if (!t->defined && defined)
{
t->details.enumeration = xmalloc(sizeof(*t->details.enumeration));
t->details.enumeration->enums = enums;
t->defined = TRUE;
}
- if (name)
- {
- if (defined)
- reg_type(t, name, namespace, tsENUM);
- }
return t;
}
More information about the wine-cvs
mailing list