widl: initialize _RetVal properly to avoid warnings

unknown (none) Christoph at .
Fri Feb 6 07:24:51 CST 2009


---
 tools/widl/proxy.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/tools/widl/proxy.c b/tools/widl/proxy.c
index 0dcb737..08a97c8 100644
--- a/tools/widl/proxy.c
+++ b/tools/widl/proxy.c
@@ -327,7 +327,12 @@ static void gen_proxy(type_t *iface, const var_t *func, int idx,
   if (has_ret) {
     print_proxy( "" );
     write_type_decl_left(proxy, type_function_get_rettype(func->type));
-    print_proxy( " _RetVal;\n");
+
+	/* Initialize _RetVal properly in order to avoid compiler warnings */
+    if (is_ptr(type_function_get_rettype(func->type)) || is_array(type_function_get_rettype(func->type)))
+      print_proxy(" _RetVal = NULL;\n");
+    else
+      print_proxy(" _RetVal = 0;\n");
   }
   print_proxy( "RPC_MESSAGE _RpcMessage;\n" );
   if (has_ret) {
-- 
1.6.1.9.g97c34


--------------050305000600030600020209--



More information about the wine-patches mailing list