- 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.

svn path=/trunk/; revision=38588
This commit is contained in:
Christoph von Wittich 2009-01-05 18:17:35 +00:00
parent c5c778d46e
commit 072a17a70e

View file

@ -883,7 +883,9 @@ static int encode_type(
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 @@ static int encode_type(
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 @@ static int encode_type(
*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 @@ static int encode_var(
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 @@ static HRESULT add_var_desc(msft_typeinfo_t *typeinfo, UINT index, var_t* var)
varflags |= 0x01; /* VARFLAG_FREADONLY */
break;
/* FIXME: VARFLAG_FREPLACEABLE */
break;
case ATTR_REQUESTEDIT:
varflags |= 0x08; /* VARFLAG_FREQUESTEDIT */
break;