Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ internal static BinaryExpressionSyntax ByteToBool (InvocationExpressionSyntax in
/// 2. Use the correct NSArray method depending on the content of the array.
/// </summary>
/// <param name="parameter">The parameter whose aux variable we want to generate.</param>
/// <param name="withUsing">If the using clause should be added to the declaration.</param>
/// <returns>The variable declaration for the NSArray aux variable of the parameter.</returns>
internal static LocalDeclarationStatementSyntax? GetNSArrayAuxVariable (in Parameter parameter)
{
Expand All @@ -142,7 +141,7 @@ internal static BinaryExpressionSyntax ByteToBool (InvocationExpressionSyntax in
var factoryInvocation = InvocationExpression (MemberAccessExpression (SyntaxKind.SimpleMemberAccessExpression,
IdentifierName ("NSArray"), IdentifierName (nsArrayFactoryMethod).WithTrailingTrivia (Space)))
.WithArgumentList (
ArgumentList (SingletonSeparatedList<ArgumentSyntax> (
ArgumentList (SingletonSeparatedList (
Argument (IdentifierName (parameter.Name)))));

// variable name
Expand Down Expand Up @@ -740,7 +739,7 @@ internal static LocalDeclarationStatementSyntax GetSelectorHandleField (string s
}

static string? GetObjCMessageSendMethodName<T> (ExportData<T> exportData,
TypeInfo returnType, ImmutableArray<Parameter> parameters, bool isSuper = false, bool isStret = false)
in TypeInfo returnType, ImmutableArray<Parameter> parameters, bool isSuper = false, bool isStret = false)
where T : Enum
{
var flags = exportData.Flags;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

using System;
using System.Security.Cryptography;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.Macios.Generator.DataModel;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ internal static InvocationExpressionSyntax StringFromHandle (ImmutableArray<Argu
/// </summary>
/// <param name="returnType">The type info of the return type.</param>
/// <returns>The member access to the correct NSValue method.</returns>
internal static MemberAccessExpressionSyntax? NSValueFromHandle (TypeInfo returnType)
internal static MemberAccessExpressionSyntax? NSValueFromHandle (in TypeInfo returnType)
{
#pragma warning disable format
var memberName = returnType switch {
Expand Down Expand Up @@ -238,7 +238,7 @@ internal static InvocationExpressionSyntax StringFromHandle (ImmutableArray<Argu
/// <param name="returnType">The return method of the method/property.</param>
/// <param name="arguments">The arguments to pass to the NSValue method.</param>
/// <returns>The expression needed to call the NSNumber method with the given args.</returns>
internal static InvocationExpressionSyntax? NSValueFromHandle (TypeInfo returnType,
internal static InvocationExpressionSyntax? NSValueFromHandle (in TypeInfo returnType,
ImmutableArray<ArgumentSyntax> arguments)
{
// generate: (arg1, arg2, arg3)
Expand All @@ -259,7 +259,7 @@ internal static InvocationExpressionSyntax StringFromHandle (ImmutableArray<Argu
/// </summary>
/// <param name="returnType">The type info of the return type.</param>
/// <returns>The member access to the correct NSNumber method.</returns>
internal static MemberAccessExpressionSyntax? NSNumberFromHandle (TypeInfo returnType)
internal static MemberAccessExpressionSyntax? NSNumberFromHandle (in TypeInfo returnType)
{
// create a tuple to store the name and special type depending if it is an array
// or a non array type
Expand Down Expand Up @@ -304,7 +304,7 @@ internal static InvocationExpressionSyntax StringFromHandle (ImmutableArray<Argu
/// <param name="returnType">The return method of the method/property.</param>
/// <param name="arguments">The arguments to pass to the NSNumber method.</param>
/// <returns>The expression needed to call the NSNumber method iwth the given args.</returns>
internal static InvocationExpressionSyntax? NSNumberFromHandle (TypeInfo returnType,
internal static InvocationExpressionSyntax? NSNumberFromHandle (in TypeInfo returnType,
ImmutableArray<ArgumentSyntax> arguments)
{
// generate: (arg1, arg2, arg3)
Expand Down
Loading