Zebediah Figura : widl: Store the type for casts and sizeof() expressions as a decl_spec_t.

Alexandre Julliard julliard at winehq.org
Fri Aug 16 17:30:49 CDT 2019


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

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Aug 15 20:13:17 2019 -0500

widl: Store the type for casts and sizeof() expressions as a decl_spec_t.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 tools/widl/expr.c      | 12 ++++++------
 tools/widl/widltypes.h |  2 +-
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/tools/widl/expr.c b/tools/widl/expr.c
index 85ba463..3d40da5 100644
--- a/tools/widl/expr.c
+++ b/tools/widl/expr.c
@@ -202,7 +202,7 @@ expr_t *make_exprt(enum expr_type type, var_t *var, expr_t *expr)
     e = xmalloc(sizeof(expr_t));
     e->type = type;
     e->ref = expr;
-    e->u.tref = tref;
+    e->u.tref = var->declspec;
     e->is_const = FALSE;
     if (type == EXPR_SIZEOF)
     {
@@ -591,7 +591,7 @@ static struct expression_type resolve_expression(const struct expr_loc *expr_loc
         break;
     case EXPR_CAST:
         result = resolve_expression(expr_loc, cont_type, e->ref);
-        result.type = e->u.tref;
+        result.type = e->u.tref.type;
         break;
     case EXPR_SIZEOF:
         result.is_temporary = FALSE;
@@ -759,13 +759,13 @@ void write_expr(FILE *h, const expr_t *e, int brackets,
         break;
     case EXPR_CAST:
         fprintf(h, "(");
-        write_type_decl(h, e->u.tref, NULL);
+        write_type_decl(h, e->u.tref.type, NULL);
         fprintf(h, ")");
         write_expr(h, e->ref, 1, toplevel, toplevel_prefix, cont_type, local_var_prefix);
         break;
     case EXPR_SIZEOF:
         fprintf(h, "sizeof(");
-        write_type_decl(h, e->u.tref, NULL);
+        write_type_decl(h, e->u.tref.type, NULL);
         fprintf(h, ")");
         break;
     case EXPR_SHL:
@@ -917,7 +917,7 @@ int compare_expr(const expr_t *a, const expr_t *b)
                 return ret;
             return compare_expr(a->u.ext, b->u.ext);
         case EXPR_CAST:
-            ret = compare_type(a->u.tref, b->u.tref);
+            ret = compare_type(a->u.tref.type, b->u.tref.type);
             if (ret != 0)
                 return ret;
             /* Fall through.  */
@@ -929,7 +929,7 @@ int compare_expr(const expr_t *a, const expr_t *b)
         case EXPR_POS:
             return compare_expr(a->ref, b->ref);
         case EXPR_SIZEOF:
-            return compare_type(a->u.tref, b->u.tref);
+            return compare_type(a->u.tref.type, b->u.tref.type);
         case EXPR_VOID:
             return 0;
     }
diff --git a/tools/widl/widltypes.h b/tools/widl/widltypes.h
index 43931c9..3f2a719 100644
--- a/tools/widl/widltypes.h
+++ b/tools/widl/widltypes.h
@@ -319,7 +319,7 @@ struct _expr_t {
     double dval;
     const char *sval;
     const expr_t *ext;
-    type_t *tref;
+    decl_spec_t tref;
   } u;
   const expr_t *ext2;
   int is_const;




More information about the wine-cvs mailing list