From 53177f48f4886d9299320f5483d9499d89b4e9b3 Mon Sep 17 00:00:00 2001 From: Eric Kohl Date: Sun, 26 Oct 2008 21:03:11 +0000 Subject: [PATCH] Initialize _RetVal properly in order to avoid compiler warnings. svn path=/trunk/; revision=37001 --- reactos/tools/widl/proxy.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/reactos/tools/widl/proxy.c b/reactos/tools/widl/proxy.c index 6d942b42223..b818288b810 100644 --- a/reactos/tools/widl/proxy.c +++ b/reactos/tools/widl/proxy.c @@ -267,7 +267,12 @@ static void gen_proxy(type_t *iface, const func_t *cur, int idx, if (has_ret) { print_proxy( "" ); write_type_decl_left(proxy, get_func_return_type(cur)); - print_proxy( " _RetVal;\n"); + + /* Initialize _RetVal properly in order to avoid compiler warnings */ + if (is_ptr(get_func_return_type(cur)) || is_array(get_func_return_type(cur))) + print_proxy(" _RetVal = NULL;\n"); + else + print_proxy(" _RetVal = 0;\n"); } print_proxy( "RPC_MESSAGE _RpcMessage;\n" ); print_proxy( "MIDL_STUB_MESSAGE _StubMsg;\n" );