[3/4] widl: Shrink type_t structure

Dan Hipschman dsh at linux.ucla.edu
Thu May 24 19:49:21 CDT 2007


All this patch does is shrink the type_t structure by replacing some of
the boolean valued fields with bitfields.  Also, the sign field only uses
the range [-1,1], so two bits suffice.

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

diff --git a/tools/widl/parser.y b/tools/widl/parser.y
index b70dab8..60d7d14 100644
--- a/tools/widl/parser.y
+++ b/tools/widl/parser.y
@@ -1200,7 +1200,7 @@ static type_t *make_type(unsigned char type, type_t *ref)
   t->fields = NULL;
   t->ifaces = NULL;
   t->typestring_offset = 0;
-  t->ignore = parse_only;
+  t->ignore = (parse_only != 0);
   t->is_const = FALSE;
   t->sign = 0;
   t->defined = FALSE;
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 946581a..4d8b6d4 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -208,9 +208,13 @@ struct _type_t {
   ifref_list_t *ifaces;           /* coclasses */
   type_t *orig;                   /* dup'd types */
   unsigned int typestring_offset;
-  int ignore, is_const, sign;
-  int defined, written, user_types_registered;
   int typelib_idx;
+  unsigned int ignore : 1;
+  unsigned int is_const : 1;
+  unsigned int defined : 1;
+  unsigned int written : 1;
+  unsigned int user_types_registered : 1;
+  int sign : 2;
 };
 
 struct _var_t {



More information about the wine-patches mailing list