From fd0a6955da15c2dfd2beeab1f25fc2ed8aa319dc Mon Sep 17 00:00:00 2001 From: Greg King Date: Sun, 19 Jul 2020 14:30:22 -0400 Subject: [PATCH] Changed "IsTypeStruct() || IsTypeUnion()" expressions into shorter "IsClassStruct()" expressions. Type-classes are groups of types that can be handled in the same way (similar syntax). --- src/cc65/expr.c | 4 ++-- src/cc65/function.c | 4 ++-- src/cc65/stmt.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index f28aa3965..ad3710e80 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -396,7 +396,7 @@ static unsigned FunctionParamList (FuncDesc* Func, int IsFastcall) } /* Handle struct/union specially */ - if (IsTypeStruct (Expr.Type) || IsTypeUnion (Expr.Type)) { + if (IsClassStruct (Expr.Type)) { /* Use the replacement type */ Flags |= TypeOf (GetStructReplacementType (Expr.Type)); } else { @@ -658,7 +658,7 @@ static void FunctionCall (ExprDesc* Expr) ReturnType = GetFuncReturn (Expr->Type); /* Handle struct/union specially */ - if (IsTypeStruct (ReturnType) || IsTypeUnion (ReturnType)) { + if (IsClassStruct (ReturnType)) { /* If there is no replacement type, then it is just the address */ if (ReturnType == GetStructReplacementType (ReturnType)) { /* Dereference it */ diff --git a/src/cc65/function.c b/src/cc65/function.c index 4cd5565c4..ff4c23656 100644 --- a/src/cc65/function.c +++ b/src/cc65/function.c @@ -477,7 +477,7 @@ void NewFunc (SymEntry* Func) Flags = CF_PTR; } else { /* Handle struct/union specially */ - if (IsTypeStruct (D->LastParam->Type) || IsTypeUnion (D->LastParam->Type)) { + if (IsClassStruct (D->LastParam->Type)) { Flags = TypeOf (GetStructReplacementType (D->LastParam->Type)) | CF_FORCECHAR; } else { Flags = TypeOf (D->LastParam->Type) | CF_FORCECHAR; @@ -506,7 +506,7 @@ void NewFunc (SymEntry* Func) /* Check if we need copy for struct/union type */ RType = Param->Type; - if (IsTypeStruct (RType) || IsTypeUnion (RType)) { + if (IsClassStruct (RType)) { RType = GetStructReplacementType (RType); /* If there is no replacement type, then it is just the address. diff --git a/src/cc65/stmt.c b/src/cc65/stmt.c index 6c839c420..b02ae1cd6 100644 --- a/src/cc65/stmt.c +++ b/src/cc65/stmt.c @@ -329,7 +329,7 @@ static void ReturnStatement (void) TypeConversion (&Expr, F_GetReturnType (CurrentFunc)); /* Load the value into the primary */ - if (IsTypeStruct (Expr.Type) || IsTypeUnion (Expr.Type)) { + if (IsClassStruct (Expr.Type)) { /* Handle struct/union specially */ ReturnType = GetStructReplacementType (Expr.Type); if (ReturnType == Expr.Type) {