Commit e8b6c052 authored by Richard Pospesel's avatar Richard Pospesel Committed by Alexandre Julliard

widl: Pass a decl_spec_t to write_type_left().

parent aa2bd521
......@@ -54,7 +54,7 @@ static void write_client_func_decl( const type_t *iface, const var_t *func )
{
const char *callconv = get_attrp(func->declspec.type->attrs, ATTR_CALLCONV);
const var_list_t *args = type_function_get_args(func->declspec.type);
type_t *rettype = type_function_get_rettype(func->declspec.type);
const decl_spec_t *rettype = type_function_get_ret(func->declspec.type);
if (!callconv) callconv = "__cdecl";
write_type_decl_left(client, rettype);
......
......@@ -29,10 +29,10 @@ extern int is_attr(const attr_list_t *list, enum attr_type t);
extern void *get_attrp(const attr_list_t *list, enum attr_type t);
extern unsigned int get_attrv(const attr_list_t *list, enum attr_type t);
extern const char* get_name(const var_t *v);
extern void write_type_left(FILE *h, type_t *t, enum name_type name_type, int declonly);
extern void write_type_left(FILE *h, const decl_spec_t *ds, enum name_type name_type, int declonly);
extern void write_type_right(FILE *h, type_t *t, int is_field);
extern void write_type_decl(FILE *f, const decl_spec_t *t, const char *name);
extern void write_type_decl_left(FILE *f, type_t *t);
extern void write_type_decl_left(FILE *f, const decl_spec_t *ds);
extern unsigned int get_context_handle_offset( const type_t *type );
extern unsigned int get_generic_handle_offset( const type_t *type );
extern int needs_space_after(type_t *t);
......
......@@ -202,7 +202,7 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx,
if (is_interpreted_func( iface, func ))
{
if (get_stub_mode() == MODE_Oif && !is_callas( func->attrs )) return;
write_type_decl_left(proxy, retval->declspec.type);
write_type_decl_left(proxy, &retval->declspec);
print_proxy( " %s %s_%s_Proxy(\n", callconv, iface->name, get_name(func));
write_args(proxy, args, iface->name, 1, TRUE);
print_proxy( ")\n");
......@@ -219,7 +219,7 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx,
print_proxy( "}\n");
print_proxy( "\n");
write_type_decl_left(proxy, retval->declspec.type);
write_type_decl_left(proxy, &retval->declspec);
print_proxy( " %s %s_%s_Proxy(\n", callconv, iface->name, get_name(func));
write_args(proxy, args, iface->name, 1, TRUE);
print_proxy( ")\n");
......
......@@ -185,7 +185,7 @@ static void write_function_stub(const type_t *iface, const var_t *func, unsigned
* be direct, otherwise it is a pointer */
const char *ch_ptr = is_aliaschain_attr(var->declspec.type, ATTR_CONTEXTHANDLE) ? "*" : "";
print_server("(");
write_type_decl_left(server, var->declspec.type);
write_type_decl_left(server, &var->declspec);
fprintf(server, ")%sNDRSContextValue(__frame->%s)", ch_ptr, var->name);
}
else
......
......@@ -4652,7 +4652,7 @@ void declare_stub_args( FILE *file, int indent, const var_t *func )
}
print_file(file, indent, "%s", "");
write_type_decl_left(file, var->declspec.type);
write_type_decl_left(file, &var->declspec);
fprintf(file, " ");
if (type_get_type(var->declspec.type) == TYPE_ARRAY &&
!type_array_is_decl_as_ptr(var->declspec.type)) {
......@@ -4805,7 +4805,7 @@ void write_func_param_struct( FILE *file, const type_t *iface, const type_t *fun
if (args) LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry )
{
print_file(file, 2, "%s", "");
write_type_left( file, (type_t *)arg->declspec.type, NAME_DEFAULT, TRUE );
write_type_left( file, &arg->declspec, NAME_DEFAULT, TRUE );
if (needs_space_after( arg->declspec.type )) fputc( ' ', file );
if (is_array( arg->declspec.type ) && !type_array_is_decl_as_ptr( arg->declspec.type )) fputc( '*', file );
......@@ -4869,10 +4869,11 @@ int write_expr_eval_routines(FILE *file, const char *iface)
}
else
{
decl_spec_t ds = {.type = (type_t *)eval->cont_type};
print_file(file, 1, "%s", "");
write_type_left(file, (type_t *)eval->cont_type, NAME_DEFAULT, TRUE);
write_type_left(file, &ds, NAME_DEFAULT, TRUE);
fprintf(file, " *%s = (", var_name);
write_type_left(file, (type_t *)eval->cont_type, NAME_DEFAULT, TRUE);
write_type_left(file, &ds, NAME_DEFAULT, TRUE);
fprintf(file, " *)(pStubMsg->StackTop - %u);\n", eval->baseoff);
}
print_file(file, 1, "pStubMsg->Offset = 0;\n"); /* FIXME */
......@@ -4966,8 +4967,8 @@ error:
void write_client_call_routine( FILE *file, const type_t *iface, const var_t *func,
const char *prefix, unsigned int proc_offset )
{
type_t *rettype = type_function_get_rettype( func->declspec.type );
int has_ret = !is_void( rettype );
const decl_spec_t *rettype = type_function_get_ret( func->declspec.type );
int has_ret = !is_void( rettype->type );
const var_list_t *args = type_function_get_args( func->declspec.type );
const var_t *arg;
int len, needs_params = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment