mirror of
https://github.com/cc65/cc65.git
synced 2025-02-06 12:31:12 +00:00
Fixed function parameter type conversion.
This commit is contained in:
parent
632da3f4ee
commit
4e61ae5b36
@ -1492,13 +1492,27 @@ static void ParseTypeSpec (DeclSpec* D, long Default, TypeCode Qualifiers,
|
|||||||
|
|
||||||
|
|
||||||
static Type* ParamTypeCvt (Type* T)
|
static Type* ParamTypeCvt (Type* T)
|
||||||
/* If T is an array, convert it to a pointer else do nothing. Return the
|
/* If T is an array or a function, convert it to a pointer else do nothing.
|
||||||
** resulting type.
|
** Return the resulting type.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
|
Type* Tmp = 0;
|
||||||
|
|
||||||
if (IsTypeArray (T)) {
|
if (IsTypeArray (T)) {
|
||||||
T->C = T_PTR;
|
Tmp = ArrayToPtr (T);
|
||||||
|
} else if (IsTypeFunc (T)) {
|
||||||
|
Tmp = PointerTo (T);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Tmp != 0) {
|
||||||
|
/* Do several fixes on qualifiers */
|
||||||
|
FixQualifiers (Tmp);
|
||||||
|
|
||||||
|
/* Replace the type */
|
||||||
|
TypeCopy (T, Tmp);
|
||||||
|
TypeFree (Tmp);
|
||||||
|
}
|
||||||
|
|
||||||
return T;
|
return T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user