[PATCH 2/5] widl: Remove constant t parameter from find_type_or_error.
Rémi Bernon
rbernon at codeweavers.com
Thu Feb 4 10:43:40 CST 2021
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
tools/widl/parser.y | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 328829cc0da..a610a630282 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -75,7 +75,7 @@ static void append_chain_callconv(type_t *chain, char *callconv);
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_error(const char *name);
static var_t *reg_const(var_t *var);
@@ -859,17 +859,17 @@ ident: aIDENTIFIER { $$ = make_var($1); }
| aKNOWNTYPE { $$ = make_var($<str>1); }
;
-base_type: tBYTE { $$ = find_type_or_error($<str>1, 0); }
- | tWCHAR { $$ = find_type_or_error($<str>1, 0); }
+base_type: tBYTE { $$ = find_type_or_error($<str>1); }
+ | tWCHAR { $$ = find_type_or_error($<str>1); }
| int_std
| tSIGNED int_std { $$ = type_new_int(type_basic_get_type($2), -1); }
| tUNSIGNED int_std { $$ = type_new_int(type_basic_get_type($2), 1); }
| tUNSIGNED { $$ = type_new_int(TYPE_BASIC_INT, 1); }
- | tFLOAT { $$ = find_type_or_error($<str>1, 0); }
- | tDOUBLE { $$ = find_type_or_error($<str>1, 0); }
- | tBOOLEAN { $$ = find_type_or_error($<str>1, 0); }
- | tERRORSTATUST { $$ = find_type_or_error($<str>1, 0); }
- | tHANDLET { $$ = find_type_or_error($<str>1, 0); }
+ | tFLOAT { $$ = find_type_or_error($<str>1); }
+ | tDOUBLE { $$ = find_type_or_error($<str>1); }
+ | tBOOLEAN { $$ = find_type_or_error($<str>1); }
+ | tERRORSTATUST { $$ = find_type_or_error($<str>1); }
+ | tHANDLET { $$ = find_type_or_error($<str>1); }
;
m_int:
@@ -888,12 +888,12 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
;
qualified_seq:
- aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
+ aKNOWNTYPE { $$ = find_type_or_error($1); }
| aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; }
;
qualified_type:
- aKNOWNTYPE { $$ = find_type_or_error($1, 0); }
+ aKNOWNTYPE { $$ = find_type_or_error($1); }
| aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; }
;
@@ -1014,7 +1014,7 @@ interfacedef: interfacehdr inherit
| interfacehdr ':' aIDENTIFIER
'{' import int_statements '}'
semicolon_opt { $$ = $1;
- type_interface_define($$, find_type_or_error($3, 0), $6);
+ type_interface_define($$, find_type_or_error($3), $6);
}
| dispinterfacedef semicolon_opt { $$ = $1; }
;
@@ -1247,14 +1247,14 @@ acf_int_statements
acf_int_statement
: tTYPEDEF acf_attributes aKNOWNTYPE ';'
- { type_t *type = find_type_or_error($3, 0);
+ { type_t *type = find_type_or_error($3);
type->attrs = append_attr_list(type->attrs, $2);
}
;
acf_interface
: acf_attributes tINTERFACE aKNOWNTYPE '{' acf_int_statements '}'
- { type_t *iface = find_type_or_error($3, 0);
+ { type_t *iface = find_type_or_error($3);
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);
@@ -2092,11 +2092,11 @@ type_t *find_type(const char *name, struct namespace *namespace, int t)
return NULL;
}
-static type_t *find_type_or_error(const char *name, int t)
+static type_t *find_type_or_error(const char *name)
{
type_t *type;
- if (!(type = find_type(name, current_namespace, t)) &&
- !(type = find_type(name, lookup_namespace, t)))
+ if (!(type = find_type(name, current_namespace, 0)) &&
+ !(type = find_type(name, lookup_namespace, 0)))
{
error_loc("type '%s' not found\n", name);
return NULL;
@@ -2909,7 +2909,7 @@ static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func)
* function */
var_t *idl_handle = make_var(xstrdup("IDL_handle"));
idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN));
- idl_handle->declspec.type = find_type_or_error("handle_t", 0);
+ idl_handle->declspec.type = find_type_or_error("handle_t");
type_function_add_head_arg(func->declspec.type, idl_handle);
}
}
@@ -3200,7 +3200,7 @@ static statement_t *make_statement_typedef(declarator_list_t *decls, int declonl
LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry )
{
var_t *var = decl->var;
- type_t *type = find_type_or_error(var->name, 0);
+ type_t *type = find_type_or_error(var->name);
*type_list = xmalloc(sizeof(type_list_t));
(*type_list)->type = type;
(*type_list)->next = NULL;
--
2.30.0
More information about the wine-devel
mailing list