widl: initialize _RetVal to avoid compiler warnings

Christoph von Wittich Christoph at ApiViewer.de
Thu Feb 5 05:48:38 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) {




More information about the wine-patches mailing list