Robert Shearman : widl: Fix pointer detection for structures with embedded arrays.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Feb 7 06:05:46 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 9f0c45b7e79ba2faebaf2b9b63bf711cf86b7ded
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=9f0c45b7e79ba2faebaf2b9b63bf711cf86b7ded

Author: Robert Shearman <rob at codeweavers.com>
Date:   Tue Feb  7 12:29:39 2006 +0100

widl: Fix pointer detection for structures with embedded arrays.
Pointers have priority over every other type, so move the detection to
the top of get_struct_type.
Fall through from the embedded array detection to the embedded
structure handling code so that conformance, variance and pointer
presence is inherited from the array's base type.

---

 tools/widl/parser.y |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index 15f1367..499f0f4 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1280,14 +1280,20 @@ static int get_struct_type(var_t *field)
     while( (t->type == 0) && t->ref )
       t = t->ref;
 
-    if (is_string_type(field->attrs, field->ptr_level, field->array))
+    if (field->ptr_level > 0)
+    {
+        has_pointer = 1;
+        continue;
+    }
+
+    if (is_string_type(field->attrs, 0, field->array))
     {
         has_conformance = 1;
         has_variance = 1;
         continue;
     }
 
-    if (is_array_type(field->attrs, field->ptr_level, field->array))
+    if (is_array_type(field->attrs, 0, field->array))
     {
         if (field->array && !field->array->is_const)
         {
@@ -1298,13 +1304,6 @@ static int get_struct_type(var_t *field)
         }
         if (is_attr(field->attrs, ATTR_LENGTHIS))
             has_variance = 1;
-        continue;
-    }
-
-    if (field->ptr_level > 0)
-    {
-        has_pointer = 1;
-        continue;
     }
 
     switch (t->type)




More information about the wine-cvs mailing list