1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

Replaced certain usage of "(New-)PointerTo()" with "AddressOf()".

This commit is contained in:
acqn 2021-06-08 00:43:26 +08:00 committed by mrdudz
parent 7e1df39432
commit 55881e913d

View File

@ -1127,7 +1127,7 @@ static void Primary (ExprDesc* E)
/* output its label */ /* output its label */
E->Flags = E_RTYPE_RVAL | E_LOC_CODE | E_ADDRESS_OF; E->Flags = E_RTYPE_RVAL | E_LOC_CODE | E_ADDRESS_OF;
E->Name = Entry->V.L.Label; E->Name = Entry->V.L.Label;
E->Type = NewPointerTo (type_void); E->Type = type_void_p;
NextToken (); NextToken ();
} else { } else {
Error ("Computed gotos are a C extension, not supported with this --standard"); Error ("Computed gotos are a C extension, not supported with this --standard");
@ -1946,7 +1946,7 @@ void hie10 (ExprDesc* Expr)
/* The & operator yields an rvalue address */ /* The & operator yields an rvalue address */
ED_AddrExpr (Expr); ED_AddrExpr (Expr);
} }
Expr->Type = NewPointerTo (Expr->Type); Expr->Type = AddressOf (Expr->Type);
break; break;
case TOK_SIZEOF: case TOK_SIZEOF:
@ -2265,9 +2265,9 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
Tok = CurTok.Tok; Tok = CurTok.Tok;
NextToken (); NextToken ();
/* If lhs is a function, convert it to pointer to function */ /* If lhs is a function, convert it to the address of the function */
if (IsTypeFunc (Expr->Type)) { if (IsTypeFunc (Expr->Type)) {
Expr->Type = NewPointerTo (Expr->Type); Expr->Type = AddressOf (Expr->Type);
} }
/* Get the lhs on stack */ /* Get the lhs on stack */
@ -2287,9 +2287,9 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
/* Get the right hand side */ /* Get the right hand side */
MarkedExprWithCheck (hienext, &Expr2); MarkedExprWithCheck (hienext, &Expr2);
/* If rhs is a function, convert it to pointer to function */ /* If rhs is a function, convert it to the address of the function */
if (IsTypeFunc (Expr2.Type)) { if (IsTypeFunc (Expr2.Type)) {
Expr2.Type = NewPointerTo (Expr2.Type); Expr2.Type = AddressOf (Expr2.Type);
} }
/* Check for a numeric constant expression */ /* Check for a numeric constant expression */