Commit 50a7b239 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

widl: Generate correct size and alignment for all types.

Using type_memsize_and_alignment() directly instead of reimplementing it. Also fix the generated tests in oleaut32 to reflect correct sizes for 64-bit typelibs. Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 70e5d5fd
......@@ -84,7 +84,6 @@ static const unsigned short IsSimpleRef = 0x0100;
static unsigned int field_memsize(const type_t *type, unsigned int *offset);
static unsigned int fields_memsize(const var_list_t *fields, unsigned int *align);
static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align);
static unsigned int write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type,
const char *name, unsigned int *typestring_offset);
static unsigned int write_struct_tfs(FILE *file, type_t *type, const char *name, unsigned int *tfsoff);
......@@ -1841,7 +1840,7 @@ static unsigned int union_memsize(const var_list_t *fields, unsigned int *pmaxa)
return maxs;
}
static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align)
unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align)
{
unsigned int size = 0;
......@@ -1910,6 +1909,7 @@ static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *al
size = union_memsize(type_union_get_cases(t), align);
break;
case TYPE_POINTER:
case TYPE_INTERFACE:
assert( pointer_size );
size = pointer_size;
if (size > *align) *align = size;
......@@ -1933,7 +1933,6 @@ static unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *al
if (size > *align) *align = size;
}
break;
case TYPE_INTERFACE:
case TYPE_ALIAS:
case TYPE_VOID:
case TYPE_COCLASS:
......
......@@ -100,3 +100,4 @@ unsigned char get_basic_fc(const type_t *type);
unsigned char get_pointer_fc(const type_t *type, const attr_list_t *attrs, int toplevel_param);
unsigned char get_struct_fc(const type_t *type);
enum typegen_type typegen_detect_type(const type_t *type, const attr_list_t *attrs, unsigned int flags);
unsigned int type_memsize_and_alignment(const type_t *t, unsigned int *align);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment