From 5ae2b0f219cb5aed2bdf32746a57a699a32767a2 Mon Sep 17 00:00:00 2001 From: Huw Davies Date: Wed, 2 Feb 2011 12:16:29 +0000 Subject: [PATCH] widl: Initialise [out] only parameters if they are user types or interface pointers. --- tools/widl/typegen.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 244baeafd45..32a0b1692a1 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -4055,12 +4055,15 @@ void assign_stub_out_args( FILE *file, int indent, const var_t *func, const char case TGT_ENUM: case TGT_POINTER: case TGT_RANGE: + case TGT_IFACE_POINTER: print_file(file, indent, "%s_W%u = 0;\n", local_var_prefix, i); break; + case TGT_USER_TYPE: + print_file(file, indent, "memset(&%s_W%u, 0, sizeof(%s_W%u));\n", + local_var_prefix, i, local_var_prefix, i); + break; case TGT_STRUCT: case TGT_UNION: - case TGT_USER_TYPE: - case TGT_IFACE_POINTER: case TGT_ARRAY: case TGT_CTXT_HANDLE: case TGT_CTXT_HANDLE_POINTER: