Skip to content

Commit 88246f8

Browse files
committed
Removed RefineFuncDesc() as an unnecessary wrapper.
1 parent 4e82067 commit 88246f8

File tree

3 files changed

+5
-36
lines changed

3 files changed

+5
-36
lines changed

src/cc65/symtab.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ static int HandleSymRedefinition (SymEntry* Sym, const Type* T, unsigned Flags)
741741
/* Refine the existing composite prototype with this new
742742
** one.
743743
*/
744-
RefineFuncDesc (Sym->Type, T);
744+
TypeComposition (Sym->Type, T);
745745
}
746746
}
747747

src/cc65/typeconv.c

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -427,10 +427,6 @@ void TypeComposition (Type* lhs, const Type* rhs)
427427
** type or this fails with a critical check.
428428
*/
429429
{
430-
FuncDesc* F1;
431-
FuncDesc* F2;
432-
long LeftCount, RightCount;
433-
434430
/* Compose two types */
435431
while (lhs->C != T_END) {
436432

@@ -445,8 +441,8 @@ void TypeComposition (Type* lhs, const Type* rhs)
445441
/* Check for special type elements */
446442
if (IsTypeFunc (lhs)) {
447443
/* Compose the function descriptors */
448-
F1 = GetFuncDesc (lhs);
449-
F2 = GetFuncDesc (rhs);
444+
FuncDesc* F1 = GetFuncDesc (lhs);
445+
FuncDesc* F2 = GetFuncDesc (rhs);
450446

451447
/* If F1 has an empty parameter list (which does also mean, it is
452448
** not a function definition, because the flag is reset in this
@@ -470,8 +466,8 @@ void TypeComposition (Type* lhs, const Type* rhs)
470466
}
471467
} else if (IsTypeArray (lhs)) {
472468
/* Check member count */
473-
LeftCount = GetElementCount (lhs);
474-
RightCount = GetElementCount (rhs);
469+
long LeftCount = GetElementCount (lhs);
470+
long RightCount = GetElementCount (rhs);
475471

476472
/* Set composite type if it is requested */
477473
if (LeftCount != UNSPECIFIED) {
@@ -485,28 +481,4 @@ void TypeComposition (Type* lhs, const Type* rhs)
485481
++lhs;
486482
++rhs;
487483
}
488-
489-
return;
490-
}
491-
492-
493-
494-
FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType)
495-
/* Refine the existing function descriptor with a new one */
496-
{
497-
FuncDesc* Old = GetFuncDesc (OldType);
498-
FuncDesc* New = GetFuncDesc (NewType);
499-
500-
CHECK (Old != 0 && New != 0);
501-
502-
if ((New->Flags & FD_EMPTY) == 0) {
503-
if ((Old->Flags & FD_EMPTY) == 0) {
504-
TypeComposition (OldType, NewType);
505-
} else {
506-
TypeCopy (OldType, NewType);
507-
Old->Flags &= ~FD_EMPTY;
508-
}
509-
}
510-
511-
return Old;
512484
}

src/cc65/typeconv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ void TypeComposition (Type* lhs, const Type* rhs);
6363
** type or this fails with a critical check.
6464
*/
6565

66-
FuncDesc* RefineFuncDesc (Type* OldType, const Type* NewType);
67-
/* Refine the existing function descriptor with a new one */
68-
6966

7067

7168
/* End of typeconv.h */

0 commit comments

Comments
 (0)