widl: Fix array alignment bug

Dan Hipschman dsh at linux.ucla.edu
Wed Sep 26 19:34:25 CDT 2007

This patch fixes an array alignment problem.  The align parameter to
type_memsize has to be initialized, to zero in this case, but it is
being set to something else above this call.  The result is that widl
generates code that aligns arrays of chars to 4-byte boundaries.

This doesn't depend on my patches from earlier today, except maybe
for patch offset.

 tools/widl/typegen.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 205529d..c2e16e5 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1469,6 +1469,7 @@ static size_t write_array_tfs(FILE *file, const attr_list_t *attrs, type_t *type
     if (write_embedded_types(file, attrs, type->ref, name, FALSE, typestring_offset))
         has_pointer = TRUE;
+    align = 0;
     size = type_memsize(type, &align);
     if (size == 0)              /* conformant array */
         size = type_memsize(type->ref, &align);

More information about the wine-patches mailing list