From 25116ae360012e7568e091fd790eaf676e1d1ef9 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Mon, 26 Dec 2005 13:13:04 +0100 Subject: [PATCH] widl: Treat variables with array indices the same as pointers. --- tools/widl/typegen.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index d20f56673a0..c68c4a6c1c3 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -293,7 +293,7 @@ void marshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type while (NEXT_LINK(var)) var = NEXT_LINK(var); for (; var; *type_offset += get_size_typeformatstring_var(var), var = PREV_LINK(var)) { - if (var->ptr_level == 0) + if (var->ptr_level == 0 && !var->array) { unsigned int size; unsigned int alignment = 0; @@ -351,7 +351,8 @@ void marshall_arguments(FILE *file, int indent, func_t *func, unsigned int *type last_size = size; } - else if (var->ptr_level == 1) + else if (var->ptr_level == 1 || + (var->ptr_level == 0 && var->array && !NEXT_LINK(var->array))) { if (is_attr(var->attrs, ATTR_STRING)) { @@ -397,7 +398,7 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func, unsigned int *ty while (NEXT_LINK(var)) var = NEXT_LINK(var); for (; var; *type_offset += get_size_typeformatstring_var(var), var = PREV_LINK(var)) { - if (var->ptr_level == 0) + if (var->ptr_level == 0 && !var->array) { unsigned int size; unsigned int alignment = 0; @@ -456,7 +457,8 @@ void unmarshall_arguments(FILE *file, int indent, func_t *func, unsigned int *ty last_size = size; } - else if (var->ptr_level == 1) + else if (var->ptr_level == 1 || + (var->ptr_level == 0 && var->array && !NEXT_LINK(var->array))) { if (is_attr(var->attrs, ATTR_STRING)) {