[ros-diffs] [cwittich] 38588: - Austin English <austinenglish <at> gmail.com> Tue, 9 Sep 2008 widl: remove unreached code (Smatch) - Rob Shearman <robertshearman <at> gmail.com> Wed Sep 10 2008 widl: Fix the writing typedefs to dispinterfaces and pointers to interfaces. - Rob Shearman <robertshearman <at> gmail.com> Wed Sep 10 2008 widl: Remove redundant code.

cwittich at svn.reactos.org cwittich at svn.reactos.org
Mon Jan 5 19:17:36 CET 2009


Author: cwittich
Date: Mon Jan  5 12:17:35 2009
New Revision: 38588

URL: http://svn.reactos.org/svn/reactos?rev=38588&view=rev
Log:
- Austin English <austinenglish <at> gmail.com> Tue, 9 Sep 2008
widl: remove unreached code (Smatch)

- Rob Shearman <robertshearman <at> gmail.com> Wed Sep 10 2008
widl: Fix the writing typedefs to dispinterfaces and pointers to interfaces.

- Rob Shearman <robertshearman <at> gmail.com> Wed Sep 10 2008
widl: Remove redundant code.

Modified:
    trunk/reactos/tools/widl/write_msft.c

Modified: trunk/reactos/tools/widl/write_msft.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/widl/write_msft.c?rev=38588&r1=38587&r2=38588&view=diff
==============================================================================
--- trunk/reactos/tools/widl/write_msft.c [iso-8859-1] (original)
+++ trunk/reactos/tools/widl/write_msft.c [iso-8859-1] Mon Jan  5 12:17:35 2009
@@ -883,7 +883,9 @@
             next_vt = VT_VOID;
 
         encode_type(typelib, next_vt, type->ref, &target_type, NULL, NULL, &child_size);
-        if(type->ref && (type->ref->type == RPC_FC_IP)) {
+        /* these types already have an implicit pointer, so we don't need to
+         * add another */
+        if(next_vt == VT_DISPATCH || next_vt == VT_UNKNOWN) {
             chat("encode_type: skipping ptr\n");
             *encoded_type = target_type;
             *width = 4;
@@ -1001,10 +1003,7 @@
                 add_coclass_typeinfo(typelib, type);
                 break;
             case 0:
-                if (type->kind == TKIND_DISPATCH)
-                    add_dispinterface_typeinfo(typelib, type);
-                else
-                    error("encode_type: VT_USERDEFINED - can't yet add typedef's on the fly\n");
+                error("encode_type: VT_USERDEFINED - can't yet add typedef's on the fly\n");
                 break;
             default:
                 error("encode_type: VT_USERDEFINED - unhandled type %d\n", type->type);
@@ -1028,24 +1027,6 @@
 	*encoded_type = typeoffset;
 	*width = 0;
 	*alignment = 1;
-
-        if(type->type == RPC_FC_IP) {
-            for (typeoffset = 0; typeoffset < typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length; typeoffset += 8) {
-                typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset];
-                if ((typedata[0] == ((0x7fff << 16) | VT_PTR)) && (typedata[1] == *encoded_type)) break;
-            }
-            if (typeoffset == typelib->typelib_segdir[MSFT_SEG_TYPEDESC].length) {
-                typeoffset = ctl2_alloc_segment(typelib, MSFT_SEG_TYPEDESC, 8, 0);
-                typedata = (void *)&typelib->typelib_segment_data[MSFT_SEG_TYPEDESC][typeoffset];
-
-                typedata[0] = (0x7fff << 16) | VT_PTR;
-                typedata[1] = *encoded_type;
-            }
-            *encoded_type = typeoffset;
-            *width = 4;
-            *alignment = 4;
-            *decoded_size += 8;
-        }
         break;
       }
 
@@ -1175,7 +1156,9 @@
     dump_type(type);
 
     encode_type(typelib, vt, type, encoded_type, width, alignment, decoded_size);
-    if(type->type == RPC_FC_IP) return 2;
+    /* these types already have an implicit pointer, so we don't need to
+     * add another */
+    if(vt == VT_DISPATCH || vt == VT_UNKNOWN) return 2;
     return 0;
 }
 
@@ -1646,7 +1629,6 @@
             varflags |= 0x01; /* VARFLAG_FREADONLY */
             break;
         /* FIXME: VARFLAG_FREPLACEABLE */
-            break;
         case ATTR_REQUESTEDIT:
             varflags |= 0x08; /* VARFLAG_FREQUESTEDIT */
             break;



More information about the Ros-diffs mailing list