Module: wine
Branch: master
Commit: 0e6ad1fa8566f07fc82c392a80ad4b1b7e86a84c
URL: http://source.winehq.org/git/wine.git/?a=commit;h=0e6ad1fa8566f07fc82c392a8…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Mon Mar 15 19:30:50 2010 +0000
widl: Remove some FIXME comments and replace them with comments explaining why the current behaviour is correct.
---
tools/widl/typegen.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index b7982b0..a241e69 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -1555,8 +1555,10 @@ static void write_member_type(FILE *file, const type_t *cont,
reloff = absoff - (*tfsoff + 2);
print_file(file, 2, "0x4c,\t/* FC_EMBEDDED_COMPLEX */\n");
- /* FIXME: actually compute necessary padding */
- print_file(file, 2, "0x0,\t/* FIXME: padding */\n");
+ /* padding is represented using FC_STRUCTPAD* types, so presumably
+ * this is left over in the format for historical purposes in MIDL
+ * or rpcrt4. */
+ print_file(file, 2, "0x0,\n");
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Offset= %hd (%u) */\n",
reloff, reloff, absoff);
*tfsoff += 4;
@@ -1651,8 +1653,11 @@ static int write_pointer_description_offsets(
{
unsigned int memsize;
- /* pointer instance */
- /* FIXME: sometimes from end of structure, sometimes from beginning */
+ /* pointer instance
+ *
+ * note that MSDN states that for pointer layouts in structures,
+ * this is a negative offset from the end of the structure, but
+ * this statement is incorrect. all offsets are positive */
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Memory offset = %d */\n", *offset_in_memory, *offset_in_memory);
print_file(file, 2, "NdrFcShort(0x%hx),\t/* Buffer offset = %d */\n", *offset_in_buffer, *offset_in_buffer);
Module: wine
Branch: master
Commit: df853f8ed2ce37587585055cf0926e3ced745041
URL: http://source.winehq.org/git/wine.git/?a=commit;h=df853f8ed2ce37587585055cf…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Mon Mar 15 19:30:28 2010 +0000
widl: error_status_t isn't an allowed conformance type.
The FC code requires more than 4 bits to represent it and the
correlation descriptor and union formats only allow 4 bits to
represent the type referred to.
---
tools/widl/parser.y | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 71b7ed6..8a23a82 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -2261,7 +2261,6 @@ static int is_allowed_conf_type(const type_t *type)
case TYPE_BASIC_HYPER:
case TYPE_BASIC_BYTE:
case TYPE_BASIC_WCHAR:
- case TYPE_BASIC_ERROR_STATUS_T:
return TRUE;
default:
return FALSE;
Module: wine
Branch: master
Commit: 1d1d49b6abe7fd86b171346d4bd3ff30735a8268
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1d1d49b6abe7fd86b171346d4…
Author: Rob Shearman <robertshearman(a)gmail.com>
Date: Mon Mar 15 19:30:02 2010 +0000
widl: Use typegen_detect_type to determine which types should be written for the pointer description in write_struct_tfs.
Otherwise extra pointers for user types could be written.
---
tools/widl/typegen.c | 30 ++++++++++++++++++------------
1 files changed, 18 insertions(+), 12 deletions(-)
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index 7827e14..4f56bda 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -2417,27 +2417,33 @@ static unsigned int write_struct_tfs(FILE *file, type_t *type,
if (fields) LIST_FOR_EACH_ENTRY(f, fields, const var_t, entry)
{
type_t *ft = f->type;
- if (is_ptr(ft))
+ switch (typegen_detect_type(ft, f->attrs, TDT_IGNORE_STRINGS))
{
+ case TGT_POINTER:
if (is_string_type(f->attrs, ft))
write_string_tfs(file, f->attrs, ft, FALSE, f->name, tfsoff);
else
write_pointer_tfs(file, f->attrs, ft,
type_pointer_get_ref(ft)->typestring_offset,
FALSE, tfsoff);
- }
- else if (type_get_type(ft) == TYPE_ARRAY && type_array_is_decl_as_ptr(ft))
- {
- unsigned int offset;
+ break;
+ case TGT_ARRAY:
+ if (type_array_is_decl_as_ptr(ft))
+ {
+ unsigned int offset;
- print_file(file, 0, "/* %d */\n", *tfsoff);
+ print_file(file, 0, "/* %d */\n", *tfsoff);
- offset = ft->typestring_offset;
- /* skip over the pointer that is written for strings, since a
- * pointer has to be written in-place here */
- if (is_string_type(f->attrs, ft))
- offset += 4;
- write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff);
+ offset = ft->typestring_offset;
+ /* skip over the pointer that is written for strings, since a
+ * pointer has to be written in-place here */
+ if (is_string_type(f->attrs, ft))
+ offset += 4;
+ write_nonsimple_pointer(file, f->attrs, ft, FALSE, offset, tfsoff);
+ }
+ break;
+ default:
+ break;
}
}
if (type->ptrdesc == *tfsoff)