widl: Pass a decl_spec_t to type_new_array().

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Richard Pospesel 2019-08-15 20:13:20 -05:00 committed by Alexandre Julliard
parent e8b6c05242
commit d4dfbb630f
3 changed files with 9 additions and 8 deletions

View File

@ -1622,11 +1622,11 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
error_loc("%s: cannot specify size_is for an already sized array\n", v->name);
else
*ptype = type_new_array((*ptype)->name,
type_array_get_element_type(*ptype), FALSE,
type_array_get_element(*ptype), FALSE,
0, dim, NULL, FC_RP);
}
else if (is_ptr(*ptype))
*ptype = type_new_array((*ptype)->name, type_pointer_get_ref_type(*ptype), TRUE,
*ptype = type_new_array((*ptype)->name, type_pointer_get_ref(*ptype), TRUE,
0, dim, NULL, pointer_default);
else
error_loc("%s: size_is attribute applied to illegal type\n", v->name);
@ -1648,7 +1648,7 @@ static var_t *declare_var(attr_list_t *attrs, decl_spec_t *decl_spec, const decl
if (is_array(*ptype))
{
*ptype = type_new_array((*ptype)->name,
type_array_get_element_type(*ptype),
type_array_get_element(*ptype),
type_array_is_decl_as_ptr(*ptype),
type_array_get_dim(*ptype),
type_array_get_conformance(*ptype),
@ -1802,8 +1802,8 @@ static declarator_t *make_declarator(var_t *var)
static type_t *make_safearray(type_t *type)
{
return type_new_array(NULL, type_new_alias(type, "SAFEARRAY"), TRUE, 0,
NULL, NULL, FC_RP);
const decl_spec_t ds = {.type = type_new_alias(type, "SAFEARRAY")};
return type_new_array(NULL, &ds, TRUE, 0, NULL, NULL, FC_RP);
}
static typelib_t *make_library(const char *name, const attr_list_t *attrs)

View File

@ -217,7 +217,7 @@ type_t *type_new_coclass(char *name)
}
type_t *type_new_array(const char *name, type_t *element, int declptr,
type_t *type_new_array(const char *name, const decl_spec_t *element, int declptr,
unsigned int dim, expr_t *size_is, expr_t *length_is,
unsigned char ptr_default_fc)
{
@ -229,7 +229,8 @@ type_t *type_new_array(const char *name, type_t *element, int declptr,
t->details.array.size_is = size_is;
else
t->details.array.dim = dim;
t->details.array.elem.type = element;
if (element)
t->details.array.elem = *element;
t->details.array.ptr_def_fc = ptr_default_fc;
return t;
}

View File

@ -33,7 +33,7 @@ type_t *type_new_function(var_list_t *args);
type_t *type_new_pointer(unsigned char pointer_default, type_t *ref, attr_list_t *attrs);
type_t *type_new_alias(type_t *t, const char *name);
type_t *type_new_module(char *name);
type_t *type_new_array(const char *name, type_t *element, int declptr,
type_t *type_new_array(const char *name, const decl_spec_t *element, int declptr,
unsigned int dim, expr_t *size_is, expr_t *length_is,
unsigned char ptr_default_fc);
type_t *type_new_basic(enum type_basic_type basic_type);