widl: Remove constant t parameter from find_type_or_error.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-02-04 17:43:40 +01:00 committed by Alexandre Julliard
parent b3f807a142
commit 6a1b6a20a3
1 changed files with 18 additions and 18 deletions

View File

@ -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 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 *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); static var_t *reg_const(var_t *var);
@ -859,17 +859,17 @@ ident: aIDENTIFIER { $$ = make_var($1); }
| aKNOWNTYPE { $$ = make_var($<str>1); } | aKNOWNTYPE { $$ = make_var($<str>1); }
; ;
base_type: tBYTE { $$ = find_type_or_error($<str>1, 0); } base_type: tBYTE { $$ = find_type_or_error($<str>1); }
| tWCHAR { $$ = find_type_or_error($<str>1, 0); } | tWCHAR { $$ = find_type_or_error($<str>1); }
| int_std | int_std
| tSIGNED int_std { $$ = type_new_int(type_basic_get_type($2), -1); } | 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 int_std { $$ = type_new_int(type_basic_get_type($2), 1); }
| tUNSIGNED { $$ = type_new_int(TYPE_BASIC_INT, 1); } | tUNSIGNED { $$ = type_new_int(TYPE_BASIC_INT, 1); }
| tFLOAT { $$ = find_type_or_error($<str>1, 0); } | tFLOAT { $$ = find_type_or_error($<str>1); }
| tDOUBLE { $$ = find_type_or_error($<str>1, 0); } | tDOUBLE { $$ = find_type_or_error($<str>1); }
| tBOOLEAN { $$ = find_type_or_error($<str>1, 0); } | tBOOLEAN { $$ = find_type_or_error($<str>1); }
| tERRORSTATUST { $$ = find_type_or_error($<str>1, 0); } | tERRORSTATUST { $$ = find_type_or_error($<str>1); }
| tHANDLET { $$ = find_type_or_error($<str>1, 0); } | tHANDLET { $$ = find_type_or_error($<str>1); }
; ;
m_int: m_int:
@ -888,12 +888,12 @@ int_std: tINT { $$ = type_new_int(TYPE_BASIC_INT, 0); }
; ;
qualified_seq: qualified_seq:
aKNOWNTYPE { $$ = find_type_or_error($1, 0); } aKNOWNTYPE { $$ = find_type_or_error($1); }
| aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; } | aIDENTIFIER '.' { push_lookup_namespace($1); } qualified_seq { $$ = $4; }
; ;
qualified_type: qualified_type:
aKNOWNTYPE { $$ = find_type_or_error($1, 0); } aKNOWNTYPE { $$ = find_type_or_error($1); }
| aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; } | aNAMESPACE '.' { init_lookup_namespace($1); } qualified_seq { $$ = $4; }
; ;
@ -1014,7 +1014,7 @@ interfacedef: interfacehdr inherit
| interfacehdr ':' aIDENTIFIER | interfacehdr ':' aIDENTIFIER
'{' import int_statements '}' '{' import int_statements '}'
semicolon_opt { $$ = $1; 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; } | dispinterfacedef semicolon_opt { $$ = $1; }
; ;
@ -1247,14 +1247,14 @@ acf_int_statements
acf_int_statement acf_int_statement
: tTYPEDEF acf_attributes aKNOWNTYPE ';' : 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); type->attrs = append_attr_list(type->attrs, $2);
} }
; ;
acf_interface acf_interface
: acf_attributes tINTERFACE aKNOWNTYPE '{' acf_int_statements '}' : 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) if (type_get_type(iface) != TYPE_INTERFACE)
error_loc("%s is not an interface\n", iface->name); error_loc("%s is not an interface\n", iface->name);
iface->attrs = append_attr_list(iface->attrs, $1); 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; 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; type_t *type;
if (!(type = find_type(name, current_namespace, t)) && if (!(type = find_type(name, current_namespace, 0)) &&
!(type = find_type(name, lookup_namespace, t))) !(type = find_type(name, lookup_namespace, 0)))
{ {
error_loc("type '%s' not found\n", name); error_loc("type '%s' not found\n", name);
return NULL; return NULL;
@ -2909,7 +2909,7 @@ static void add_explicit_handle_if_necessary(const type_t *iface, var_t *func)
* function */ * function */
var_t *idl_handle = make_var(xstrdup("IDL_handle")); var_t *idl_handle = make_var(xstrdup("IDL_handle"));
idl_handle->attrs = append_attr(NULL, make_attr(ATTR_IN)); 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); 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 ) LIST_FOR_EACH_ENTRY_SAFE( decl, next, decls, declarator_t, entry )
{ {
var_t *var = decl->var; 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 = xmalloc(sizeof(type_list_t));
(*type_list)->type = type; (*type_list)->type = type;
(*type_list)->next = NULL; (*type_list)->next = NULL;