Dan Hipschman : widl: Use ref_type to simplify some code.

Alexandre Julliard julliard at wine.codeweavers.com
Sat Aug 12 06:10:40 CDT 2006


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

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Fri Aug 11 17:32:47 2006 -0700

widl: Use ref_type to simplify some code.

---

 tools/widl/parser.y    |    5 +----
 tools/widl/typegen.c   |    2 +-
 tools/widl/widltypes.h |    3 +++
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index ca5db5c..73ccf25 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1235,10 +1235,7 @@ static unsigned char get_pointer_type( t
   int t;
   if (is_attr( type->attrs, ATTR_STRING ))
   {
-    type_t *t = type;
-    while( t->type == 0 && t->ref )
-      t = t->ref;
-    switch( t->type )
+    switch( ref_type( type ) )
     {
     case RPC_FC_CHAR:
       return RPC_FC_C_CSTRING;
diff --git a/tools/widl/typegen.c b/tools/widl/typegen.c
index badf124..83af2eb 100644
--- a/tools/widl/typegen.c
+++ b/tools/widl/typegen.c
@@ -165,7 +165,7 @@ static inline int is_base_type(unsigned 
     }
 }
 
-static unsigned char ref_type(const type_t *type)
+unsigned char ref_type(const type_t *type)
 {
     while (type_has_ref(type))
         type = type->ref;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 7bf2229..926a3e2 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -297,4 +297,7 @@ struct _typelib_t {
     importlib_t *importlibs;
 };
 
+/* Get the actual type field for a type (chase down typedef references).  */
+unsigned char ref_type(const type_t *type);
+
 #endif




More information about the wine-cvs mailing list