TypeConversion GetParamConversion(Parameter p) { if (p.IsReference) { var ic = GetConversion(p.Source, p.Type); return(TypeConversion.Identity(new IdentityConversion(p.Type, ic.ForeignType + "*"))); } return(GetParamConversion(p.Source, p.Type)); }
TypeConversion GetParamConversion(Source src, DataType dt) { if (dt.IsArray) { var ic = GetConversion(src, dt.ElementType); return(new TypeConversion(dt, ic.ForeignType + "*", x => "(" + ic.ForeignType + "*)" + GetDataPtr(x))); } if (dt == Essentials.String) { return(new TypeConversion(dt, "const char16_t*", x => "(char16_t*)" + GetDataPtr(x))); } if (dt.IsDelegate) { return(TypeConversion.Identity(new IdentityConversion(dt, Helpers.CompiledType(dt)))); } return(TypeConversion.Identity(GetConversion(src, dt))); }