Huw Davies : widl: Don't restrict the number of params of [prop*] functions .

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jan 26 07:46:57 CST 2007


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

Author: Huw Davies <huw at codeweavers.com>
Date:   Thu Jan 25 13:40:40 2007 +0000

widl: Don't restrict the number of params of [prop*] functions.

---

 tools/widl/write_msft.c |   40 +++++++++++-----------------------------
 1 files changed, 11 insertions(+), 29 deletions(-)

diff --git a/tools/widl/write_msft.c b/tools/widl/write_msft.c
index 6ed9c2d..b2dfa15 100644
--- a/tools/widl/write_msft.c
+++ b/tools/widl/write_msft.c
@@ -1345,25 +1345,6 @@ static HRESULT add_func_desc(msft_typein
         }
     }
 
-    switch(invokekind) {
-    case 0x2: /* INVOKE_PROPERTYGET */
-        if((num_params != 0 && typeinfo->typekind == TKIND_DISPATCH)
-           || (num_params != 1 && typeinfo->typekind == TKIND_INTERFACE)) {
-            error("expecting no args on a propget func\n");
-            return S_FALSE;
-        }
-        break;
-    case 0x4: /* INVOKE_PROPERTYPUT */
-    case 0x8: /* INVOKE_PROPERTYPUTREF */
-        if(num_params != 1) {
-            error("expecting one arg on a propput func\n");
-            return S_FALSE;
-        }
-        break;
-    default:
-        break;
-    }
-
     /* allocate type data space for us */
     typedata_size = 0x18 + extra_attr * sizeof(int) + (num_params * (num_defaults ? 16 : 12));
 
@@ -1543,18 +1524,19 @@ static HRESULT add_func_desc(msft_typein
     if(typeinfo->typekind == TKIND_MODULE)
         namedata[9] |= 0x20;
 
-    if(invokekind != 0x4 /* INVOKE_PROPERTYPUT */ && invokekind != 0x8 /* INVOKE_PROPERTYPUTREF */) { 
-        /* don't give the arg of a [propput*] func a name */
-        if (func->args)
+    if (func->args)
+    {
+        i = 0;
+        LIST_FOR_EACH_ENTRY( arg, func->args, var_t, entry )
         {
-          i = 0;
-          LIST_FOR_EACH_ENTRY( arg, func->args, var_t, entry )
-          {
-            int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) + i * 3;
-            offset = ctl2_alloc_name(typeinfo->typelib, arg->name);
-            paramdata[1] = offset;
+            /* don't give the last arg of a [propput*] func a name */
+            if(i != num_params - 1 || (invokekind != 0x4 /* INVOKE_PROPERTYPUT */ && invokekind != 0x8 /* INVOKE_PROPERTYPUTREF */))
+            {
+                int *paramdata = typedata + 6 + extra_attr + (num_defaults ? num_params : 0) + i * 3;
+                offset = ctl2_alloc_name(typeinfo->typelib, arg->name);
+                paramdata[1] = offset;
+            }
             i++;
-          }
         }
     }
     return S_OK;




More information about the wine-cvs mailing list