From ca22457d7bc88036029f03e70c0732a37e5759d1 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 27 Jul 2011 16:16:08 +0200 Subject: [PATCH] widl: Don't set base types to 0 on proxy entry. --- tools/widl/proxy.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c index 5129971f603..699e073bc35 100644 --- a/tools/widl/proxy.c +++ b/tools/widl/proxy.c @@ -111,12 +111,14 @@ static void clear_output_vars( const var_list_t *args ) if (!args) return; LIST_FOR_EACH_ENTRY( arg, args, const var_t, entry ) { - if (is_attr(arg->attrs, ATTR_OUT) && !is_attr(arg->attrs, ATTR_IN)) { - print_proxy( "if(%s)\n", arg->name ); - indent++; - print_proxy( "MIDL_memset( %s, 0, sizeof( *%s ));\n", arg->name, arg->name ); - indent--; - } + if (is_attr(arg->attrs, ATTR_IN)) continue; + if (!is_attr(arg->attrs, ATTR_OUT)) continue; + if (is_ptr(arg->type)) + { + if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_BASIC) continue; + if (type_get_type(type_pointer_get_ref(arg->type)) == TYPE_ENUM) continue; + } + print_proxy( "if (%s) MIDL_memset( %s, 0, sizeof( *%s ));\n", arg->name, arg->name, arg->name ); } }