Huw Davies : widl: Initialise [out] only parameters if they are user types or interface pointers.

Alexandre Julliard julliard at winehq.org
Wed Feb 2 12:30:16 CST 2011


Module: wine
Branch: master
Commit: 5ae2b0f219cb5aed2bdf32746a57a699a32767a2
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5ae2b0f219cb5aed2bdf32746a57a699a32767a2

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Feb  2 12:16:29 2011 +0000

widl: Initialise [out] only parameters if they are user types or interface pointers.

---

 tools/widl/typegen.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 244baea..32a0b16 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:




More information about the wine-cvs mailing list