Rob Shearman : widl: Fix detection of complex arrays.

Alexandre Julliard julliard at winehq.org
Mon Sep 17 07:59:51 CDT 2007


Module: wine
Branch: master
Commit: b7618f91d71c8f535e60005ae5616ea697f4bee6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=b7618f91d71c8f535e60005ae5616ea697f4bee6

Author: Rob Shearman <rob at codeweavers.com>
Date:   Sun Sep 16 22:28:30 2007 +0100

widl: Fix detection of complex arrays.

---

 tools/widl/header.c |    1 +
 tools/widl/parser.y |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tools/widl/header.c b/tools/widl/header.c
index c04222b..971b30f 100644
--- a/tools/widl/header.c
+++ b/tools/widl/header.c
@@ -250,6 +250,7 @@ void write_type_left(FILE *h, type_t *t)
       case RPC_FC_OP:
       case RPC_FC_CARRAY:
       case RPC_FC_CVARRAY:
+      case RPC_FC_BOGUS_ARRAY:
         write_type_left(h, t->ref);
         fprintf(h, "%s*", needs_space_after(t->ref) ? " " : "");
         break;
diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index cc5aca5..ac24038 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1363,6 +1363,10 @@ static void set_type(var_t *v, type_t *type, int ptr_level, array_dims_t *arr)
       (*ptype)->type = RPC_FC_BOGUS_ARRAY;
     }
   }
+
+  /* if the structure is complex, then so must be the encompassing array */
+  if (is_array(v->type) && (v->type->ref->type == RPC_FC_BOGUS_STRUCT))
+    v->type->type = RPC_FC_BOGUS_ARRAY;
 }
 
 static ifref_list_t *append_ifref(ifref_list_t *list, ifref_t *iface)
@@ -1812,6 +1816,7 @@ static int get_struct_type(var_list_t *fields)
     case RPC_FC_PAD:
     case RPC_FC_EMBEDDED_COMPLEX:
     case RPC_FC_BOGUS_STRUCT:
+    case RPC_FC_BOGUS_ARRAY:
       return RPC_FC_BOGUS_STRUCT;
     }
   }




More information about the wine-cvs mailing list