widl: Make write_pointer_tfs more readable.

Change write_pointer_tfs to rely on the detected type of the type to
determine when to write a simple pointer rather than relying on
typestring_offset not being set anywhere else.
This commit is contained in:
Rob Shearman 2010-03-15 19:29:38 +00:00 committed by Alexandre Julliard
parent 5d985a8028
commit 08126d7483
1 changed files with 13 additions and 7 deletions

View File

@ -1404,15 +1404,21 @@ static unsigned int write_pointer_tfs(FILE *file, const attr_list_t *attrs,
print_start_tfs_comment(file, type, offset);
update_tfsoff(type, offset, file);
switch (typegen_detect_type(ref, attrs, TDT_ALL_TYPES))
{
case TGT_BASIC:
case TGT_ENUM:
*typestring_offset += write_simple_pointer(file, attrs, type,
toplevel_param);
break;
default:
if (ref->typestring_offset)
write_nonsimple_pointer(file, attrs, type,
toplevel_param,
type_pointer_get_ref(type)->typestring_offset,
typestring_offset);
else if (type_get_type(ref) == TYPE_BASIC ||
type_get_type(ref) == TYPE_ENUM)
*typestring_offset += write_simple_pointer(file, attrs, type,
toplevel_param);
break;
}
return offset;
}