d3dcompiler: Pass a struct source_location to add_func_parameter().

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2020-03-03 20:29:48 -06:00 committed by Alexandre Julliard
parent eef3e3dacd
commit 3048fb9064
1 changed files with 5 additions and 11 deletions

View File

@ -826,7 +826,7 @@ static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct lis
return TRUE; return TRUE;
} }
static BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location *loc) static BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location loc)
{ {
struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl)); struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl));
@ -836,7 +836,7 @@ static BOOL add_func_parameter(struct list *list, struct parse_parameter *param,
return FALSE; return FALSE;
} }
decl->data_type = param->type; decl->data_type = param->type;
decl->loc = *loc; decl->loc = loc;
decl->name = param->name; decl->name = param->name;
decl->semantic = param->semantic; decl->semantic = param->semantic;
decl->reg_reservation = param->reg_reservation; decl->reg_reservation = param->reg_reservation;
@ -1411,12 +1411,9 @@ parameters: scope_start
param_list: parameter param_list: parameter
{ {
struct source_location loc;
$$ = d3dcompiler_alloc(sizeof(*$$)); $$ = d3dcompiler_alloc(sizeof(*$$));
list_init($$); list_init($$);
loc = get_location(&@1); if (!add_func_parameter($$, &$1, get_location(&@1)))
if (!add_func_parameter($$, &$1, &loc))
{ {
ERR("Error adding function parameter %s.\n", $1.name); ERR("Error adding function parameter %s.\n", $1.name);
set_parse_status(&hlsl_ctx.status, PARSE_ERR); set_parse_status(&hlsl_ctx.status, PARSE_ERR);
@ -1425,13 +1422,10 @@ param_list: parameter
} }
| param_list ',' parameter | param_list ',' parameter
{ {
struct source_location loc;
$$ = $1; $$ = $1;
loc = get_location(&@3); if (!add_func_parameter($$, &$3, get_location(&@3)))
if (!add_func_parameter($$, &$3, &loc))
{ {
hlsl_report_message(loc, HLSL_LEVEL_ERROR, hlsl_report_message(get_location(&@3), HLSL_LEVEL_ERROR,
"duplicate parameter %s", $3.name); "duplicate parameter %s", $3.name);
YYABORT; YYABORT;
} }