Module: wine Branch: master Commit: f21eab110127a27855db84b5a7d53f2c44984a0b URL: http://source.winehq.org/git/wine.git/?a=commit;h=f21eab110127a27855db84b5a7...
Author: Alexandre Julliard julliard@winehq.org Date: Mon Jul 13 09:23:06 2009 +0200
widl: Take into account the alignment of conformant arrays to pad a structure.
---
tools/widl/typegen.c | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index 3a5e2e5..d297eb2 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -2208,11 +2208,12 @@ static void write_struct_members(FILE *file, const type_t *type, if (fields) LIST_FOR_EACH_ENTRY( field, fields, const var_t, entry ) { type_t *ft = field->type; + unsigned int align = 0; + unsigned int size = type_memsize(ft, &align); + if (salign < align) salign = align; + if (!is_conformant_array(ft) || type_array_is_decl_as_ptr(ft)) { - unsigned int align = 0; - unsigned int size = type_memsize(ft, &align); - if (salign < align) salign = align; if ((align - 1) & offset) { unsigned char fc = 0;