From 57d6c2f51eb376d43470652f9241fcf6c10ca14e Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 14 Nov 2002 22:51:59 +0000 Subject: [PATCH] New function ReplaceType git-svn-id: svn://svn.cc65.org/cc65/trunk@1520 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/exprdesc.c | 10 ++++++++++ src/cc65/exprdesc.h | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/cc65/exprdesc.c b/src/cc65/exprdesc.c index ea919dcc9..f31d4ef6b 100644 --- a/src/cc65/exprdesc.c +++ b/src/cc65/exprdesc.c @@ -110,3 +110,13 @@ void PrintExprDesc (FILE* F, ExprDesc* E) +type* ReplaceType (ExprDesc* Expr, const type* NewType) +/* Replace the type of Expr by a copy of Newtype and return the old type string */ +{ + type* OldType = Expr->Type; + Expr->Type = TypeDup (NewType); + return OldType; +} + + + diff --git a/src/cc65/exprdesc.h b/src/cc65/exprdesc.h index 039a46ff8..bdd29f703 100644 --- a/src/cc65/exprdesc.h +++ b/src/cc65/exprdesc.h @@ -37,7 +37,7 @@ #define EXPRDESC_H - + /* cc65 */ #include "datatype.h" @@ -94,6 +94,9 @@ void MakeConstIntExpr (ExprDesc* Expr, long Value); void PrintExprDesc (FILE* F, ExprDesc* Expr); /* Print an ExprDesc */ +type* ReplaceType (ExprDesc* Expr, const type* NewType); +/* Replace the type of Expr by a copy of Newtype and return the old type string */ + /* End of exprdesc.h */ -- 2.39.5