widl: Store the type for casts and sizeof() expressions as a decl_spec_t.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2019-08-15 20:13:17 -05:00 committed by Alexandre Julliard
parent 1419a06819
commit d0e10aa372
2 changed files with 7 additions and 7 deletions

View File

@ -202,7 +202,7 @@ expr_t *make_exprt(enum expr_type type, var_t *var, expr_t *expr)
e = xmalloc(sizeof(expr_t));
e->type = type;
e->ref = expr;
e->u.tref = tref;
e->u.tref = var->declspec;
e->is_const = FALSE;
if (type == EXPR_SIZEOF)
{
@ -591,7 +591,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
break;
case EXPR_CAST:
result = resolve_expression(expr_loc, cont_type, e->ref);
result.type = e->u.tref;
result.type = e->u.tref.type;
break;
case EXPR_SIZEOF:
result.is_temporary = FALSE;
@ -759,13 +759,13 @@ void write_expr(FILE *h, const expr_t *e, int brackets,
break;
case EXPR_CAST:
fprintf(h, "(");
write_type_decl(h, e->u.tref, NULL);
write_type_decl(h, e->u.tref.type, NULL);
fprintf(h, ")");
write_expr(h, e->ref, 1, toplevel, toplevel_prefix, cont_type, local_var_prefix);
break;
case EXPR_SIZEOF:
fprintf(h, "sizeof(");
write_type_decl(h, e->u.tref, NULL);
write_type_decl(h, e->u.tref.type, NULL);
fprintf(h, ")");
break;
case EXPR_SHL:
@ -917,7 +917,7 @@ int compare_expr(const expr_t *a, const expr_t *b)
return ret;
return compare_expr(a->u.ext, b->u.ext);
case EXPR_CAST:
ret = compare_type(a->u.tref, b->u.tref);
ret = compare_type(a->u.tref.type, b->u.tref.type);
if (ret != 0)
return ret;
/* Fall through. */
@ -929,7 +929,7 @@ int compare_expr(const expr_t *a, const expr_t *b)
case EXPR_POS:
return compare_expr(a->ref, b->ref);
case EXPR_SIZEOF:
return compare_type(a->u.tref, b->u.tref);
return compare_type(a->u.tref.type, b->u.tref.type);
case EXPR_VOID:
return 0;
}

View File

@ -319,7 +319,7 @@ struct _expr_t {
double dval;
const char *sval;
const expr_t *ext;
type_t *tref;
decl_spec_t tref;
} u;
const expr_t *ext2;
int is_const;