1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Removed RefineFuncDesc() as an unnecessary wrapper.

This commit is contained in:
acqn 2024-01-01 15:04:50 +08:00
parent 4e820677ee
commit 88246f852d
3 changed files with 5 additions and 36 deletions

View File

@ -741,7 +741,7 @@ static int HandleSymRedefinition (SymEntry* Sym, const Type* T, unsigned Flags)
/* Refine the existing composite prototype with this new /* Refine the existing composite prototype with this new
** one. ** one.
*/ */
RefineFuncDesc (Sym->Type, T); TypeComposition (Sym->Type, T);
} }
} }

View File

@ -427,10 +427,6 @@ void TypeComposition (Type* lhs, const Type* rhs)
** type or this fails with a critical check. ** type or this fails with a critical check.
*/ */
{ {
FuncDesc* F1;
FuncDesc* F2;
long LeftCount, RightCount;
/* Compose two types */ /* Compose two types */
while (lhs->C != T_END) { while (lhs->C != T_END) {
@ -445,8 +441,8 @@ void TypeComposition (Type* lhs, const Type* rhs)
/* Check for special type elements */ /* Check for special type elements */
if (IsTypeFunc (lhs)) { if (IsTypeFunc (lhs)) {
/* Compose the function descriptors */ /* Compose the function descriptors */
F1 = GetFuncDesc (lhs); FuncDesc* F1 = GetFuncDesc (lhs);
F2 = GetFuncDesc (rhs); FuncDesc* F2 = GetFuncDesc (rhs);
/* If F1 has an empty parameter list (which does also mean, it is /* If F1 has an empty parameter list (which does also mean, it is
** not a function definition, because the flag is reset in this ** 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)) { } else if (IsTypeArray (lhs)) {
/* Check member count */ /* Check member count */
LeftCount = GetElementCount (lhs); long LeftCount = GetElementCount (lhs);
RightCount = GetElementCount (rhs); long RightCount = GetElementCount (rhs);
/* Set composite type if it is requested */ /* Set composite type if it is requested */
if (LeftCount != UNSPECIFIED) { if (LeftCount != UNSPECIFIED) {
@ -485,28 +481,4 @@ void TypeComposition (Type* lhs, const Type* rhs)
++lhs; ++lhs;
++rhs; ++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;
} }

View File

@ -63,9 +63,6 @@ void TypeComposition (Type* lhs, const Type* rhs);
** type or this fails with a critical check. ** 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 */ /* End of typeconv.h */