Robert Shearman : widl: Better array support.
Alexandre Julliard
julliard at wine.codeweavers.com
Mon Dec 26 11:46:31 CST 2005
Module: wine
Branch: refs/heads/master
Commit: 30a9f99bb95707c68c9247cbfafd1d4a878b0f71
URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=30a9f99bb95707c68c9247cbfafd1d4a878b0f71
Author: Robert Shearman <rob at codeweavers.com>
Date: Mon Dec 26 13:06:29 2005 +0100
widl: Better array support.
Treat variables with array indices the same as pointers when writing
out the proc & type format strings.
Fix a typo when writing out the proc format string where a non-return
type was written out for a return type and vice-versa.
---
tools/widl/typegen.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 1e6581a..5724d96 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -59,7 +59,7 @@ static int print_file(FILE *file, int in
static size_t write_procformatstring_var(FILE *file, int indent, var_t *var, int is_return, unsigned int *type_offset)
{
size_t size;
- if (var->ptr_level == 0)
+ if (var->ptr_level == 0 && !var->array)
{
if (is_return)
print_file(file, indent, "0x53, /* FC_RETURN_PARAM_BASETYPE */\n");
@@ -97,9 +97,9 @@ static size_t write_procformatstring_var
else
{
if (is_return)
- print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n");
- else
print_file(file, indent, "0x52, /* FC_RETURN_PARAM */\n");
+ else
+ print_file(file, indent, "0x4d, /* FC_IN_PARAM */\n");
print_file(file, indent, "0x01,\n");
print_file(file, indent, "NdrFcShort(0x%x),\n", *type_offset);
size = 4; /* includes param type prefix */
@@ -164,10 +164,11 @@ static size_t write_typeformatstring_var
int ptr_level = var->ptr_level;
/* basic types don't need a type format string */
- if (ptr_level == 0)
+ if (ptr_level == 0 && !var->array)
return 0;
- if (ptr_level == 1)
+ if (ptr_level == 1 ||
+ (var->ptr_level == 0 && var->array && !NEXT_LINK(var->array)))
{
switch (var->type->type)
{
More information about the wine-cvs
mailing list