From 36c03f6a940bacfc92202e846fa9e34b901eb1ad Mon Sep 17 00:00:00 2001 From: Rob Shearman Date: Tue, 30 Dec 2008 18:49:48 +0000 Subject: [PATCH] widl: Remove duplicate pointer handling code in get_struct_type. Only make the structure complex if there is an interface pointer, not if there is a pointer to a union or complex struct since these are handled perfectly well by the pointer marshalling code. Fix the detection of structures with ref-pointers or pointers in 64-bit code. --- tools/widl/typegen.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index daabbd6ca70..8852ca0d5f3 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -142,25 +142,6 @@ static int get_struct_type(const type_t *type) if (is_user_type(t)) return RPC_FC_BOGUS_STRUCT; - if (is_ptr(t)) - { - do - t = t->ref; - while (is_ptr(t)); - - switch (get_struct_type(t)) - { - case RPC_FC_IP: - case RPC_FC_ENCAPSULATED_UNION: - case RPC_FC_NON_ENCAPSULATED_UNION: - case RPC_FC_BOGUS_STRUCT: - return RPC_FC_BOGUS_STRUCT; - } - - has_pointer = 1; - continue; - } - if (field->type->declarray) { if (is_string_type(field->attrs, field->type)) @@ -222,6 +203,10 @@ static int get_struct_type(const type_t *type) case RPC_FC_OP: if (pointer_size != 4) return RPC_FC_BOGUS_STRUCT; + /* pointers to interfaces aren't really pointers and have to be + * marshalled specially so they make the structure complex */ + if (t->ref->type == RPC_FC_IP) + return RPC_FC_BOGUS_STRUCT; has_pointer = 1; break;