Module: wine Branch: master Commit: 9a28119dd8e6b9fc715fe5b2f16d3e7881823bfc URL: http://source.winehq.org/git/wine.git/?a=commit;h=9a28119dd8e6b9fc715fe5b2f1...
Author: Rob Shearman rob@codeweavers.com Date: Mon Sep 17 09:46:22 2007 +0100
widl: Fix write_string_tfs for strings declared as arrays.
The immediate type will be FC_*ARRAY, so rtype needs to use the referred type to get the base type.
Also update the typeformat-string offset of the type.
---
tools/widl/typegen.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c index a15a969..f585c1f 100644 --- a/tools/widl/typegen.c +++ b/tools/widl/typegen.c @@ -1341,12 +1341,14 @@ static int is_declptr(const type_t *t) }
static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, - const type_t *type, + type_t *type, const char *name, unsigned int *typestring_offset) { size_t start_offset = *typestring_offset; unsigned char rtype;
+ update_tfsoff(type, start_offset, file); + if (is_declptr(type)) { unsigned char flag = is_conformant_array(type) ? 0 : RPC_FC_P_SIMPLEPOINTER; @@ -1365,7 +1367,7 @@ static size_t write_string_tfs(FILE *file, const attr_list_t *attrs, rtype = type->ref->type; } else - rtype = type->type; + rtype = type->ref->type;
if ((rtype != RPC_FC_BYTE) && (rtype != RPC_FC_CHAR) && (rtype != RPC_FC_WCHAR)) {