From 88246f852d73bc52e4ac37ea1927e3d9e9c70c3d Mon Sep 17 00:00:00 2001 From: acqn Date: Mon, 1 Jan 2024 15:04:50 +0800 Subject: [PATCH] Removed RefineFuncDesc() as an unnecessary wrapper. --- src/cc65/symtab.c | 2 +- src/cc65/typeconv.c | 36 ++++-------------------------------- src/cc65/typeconv.h | 3 --- 3 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/cc65/symtab.c b/src/cc65/symtab.c index 3018c910d..c2c6bab27 100644 --- a/src/cc65/symtab.c +++ b/src/cc65/symtab.c @@ -741,7 +741,7 @@ static int HandleSymRedefinition (SymEntry* Sym, const Type* T, unsigned Flags) /* Refine the existing composite prototype with this new ** one. */ - RefineFuncDesc (Sym->Type, T); + TypeComposition (Sym->Type, T); } } diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index 76658502d..25b693511 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -427,10 +427,6 @@ void TypeComposition (Type* lhs, const Type* rhs) ** type or this fails with a critical check. */ { - FuncDesc* F1; - FuncDesc* F2; - long LeftCount, RightCount; - /* Compose two types */ while (lhs->C != T_END) { @@ -445,8 +441,8 @@ void TypeComposition (Type* lhs, const Type* rhs) /* Check for special type elements */ if (IsTypeFunc (lhs)) { /* Compose the function descriptors */ - F1 = GetFuncDesc (lhs); - F2 = GetFuncDesc (rhs); + FuncDesc* F1 = GetFuncDesc (lhs); + FuncDesc* F2 = GetFuncDesc (rhs); /* If F1 has an empty parameter list (which does also mean, it is ** not a function definition, because the flag is reset in this @@ -470,8 +466,8 @@ void TypeComposition (Type* lhs, const Type* rhs) } } else if (IsTypeArray (lhs)) { /* Check member count */ - LeftCount = GetElementCount (lhs); - RightCount = GetElementCount (rhs); + long LeftCount = GetElementCount (lhs); + long RightCount = GetElementCount (rhs); /* Set composite type if it is requested */ if (LeftCount != UNSPECIFIED) { @@ -485,28 +481,4 @@ void TypeComposition (Type* lhs, const Type* rhs) ++lhs; ++rhs; } - - return; -} - - - -FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType) -/* Refine the existing function descriptor with a new one */ -{ - FuncDesc* Old = GetFuncDesc (OldType); - FuncDesc* New = GetFuncDesc (NewType); - - CHECK (Old != 0 && New != 0); - - if ((New->Flags & FD_EMPTY) == 0) { - if ((Old->Flags & FD_EMPTY) == 0) { - TypeComposition (OldType, NewType); - } else { - TypeCopy (OldType, NewType); - Old->Flags &= ~FD_EMPTY; - } - } - - return Old; } diff --git a/src/cc65/typeconv.h b/src/cc65/typeconv.h index 839c5e43e..1d79a446c 100644 --- a/src/cc65/typeconv.h +++ b/src/cc65/typeconv.h @@ -63,9 +63,6 @@ void TypeComposition (Type* lhs, const Type* rhs); ** type or this fails with a critical check. */ -FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType); -/* Refine the existing function descriptor with a new one */ - /* End of typeconv.h */