[PATCH 1/5] widl: Remove useless find_type_or_error2 helper.

Rémi Bernon rbernon at codeweavers.com
Thu Feb 4 10:43:39 CST 2021


Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---

This is the first part of a refactoring series, to cleanup namespace
usage, and ultimately better support qualified type names.

 tools/widl/parser.y | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 480552e3723..328829cc0da 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -76,7 +76,6 @@ static warning_list_t *append_warning(warning_list_t *, int);
 
 static type_t *reg_typedefs(decl_spec_t *decl_spec, var_list_t *names, attr_list_t *attrs);
 static type_t *find_type_or_error(const char *name, int t);
-static type_t *find_type_or_error2(char *name, int t);
 
 static var_t *reg_const(var_t *var);
 
@@ -1015,7 +1014,7 @@ interfacedef: interfacehdr inherit
 	| interfacehdr ':' aIDENTIFIER
 	  '{' import int_statements '}'
 	   semicolon_opt			{ $$ = $1;
-						  type_interface_define($$, find_type_or_error2($3, 0), $6);
+						  type_interface_define($$, find_type_or_error($3, 0), $6);
 						}
 	| dispinterfacedef semicolon_opt	{ $$ = $1; }
 	;
@@ -1255,7 +1254,7 @@ acf_int_statement
 
 acf_interface
         : acf_attributes tINTERFACE aKNOWNTYPE '{' acf_int_statements '}'
-                                                {  type_t *iface = find_type_or_error2($3, 0);
+                                                {  type_t *iface = find_type_or_error($3, 0);
                                                    if (type_get_type(iface) != TYPE_INTERFACE)
                                                        error_loc("%s is not an interface\n", iface->name);
                                                    iface->attrs = append_attr_list(iface->attrs, $1);
@@ -2105,13 +2104,6 @@ static type_t *find_type_or_error(const char *name, int t)
     return type;
 }
 
-static type_t *find_type_or_error2(char *name, int t)
-{
-  type_t *tp = find_type_or_error(name, t);
-  free(name);
-  return tp;
-}
-
 int is_type(const char *name)
 {
     return find_type(name, current_namespace, 0) != NULL ||
-- 
2.30.0




More information about the wine-devel mailing list