mirror of https://github.com/ppy/SDL3-CS.git
Use Utf8String directly in `fixed` statement
This commit is contained in:
parent
c4d0e86523
commit
567e6e4f7c
|
|
@ -112,10 +112,7 @@ using System;
|
||||||
param.Identifier.ValueText + pointer_suffix)
|
param.Identifier.ValueText + pointer_suffix)
|
||||||
.WithInitializer(
|
.WithInitializer(
|
||||||
SyntaxFactory.EqualsValueClause(
|
SyntaxFactory.EqualsValueClause(
|
||||||
SyntaxFactory.MemberAccessExpression(
|
SyntaxFactory.IdentifierName(param.Identifier))))),
|
||||||
SyntaxKind.SimpleMemberAccessExpression,
|
|
||||||
SyntaxFactory.IdentifierName(param.Identifier),
|
|
||||||
SyntaxFactory.IdentifierName(Helper.Utf8StringReadOnlySpanFieldName)))))),
|
|
||||||
expr);
|
expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,6 @@ namespace SDL3.SourceGeneration
|
||||||
|
|
||||||
public const string Utf8StringStructName = "Utf8String";
|
public const string Utf8StringStructName = "Utf8String";
|
||||||
|
|
||||||
public const string Utf8StringReadOnlySpanFieldName = "Raw";
|
|
||||||
|
|
||||||
public static bool IsVoid(this TypeSyntax type) => type is PredefinedTypeSyntax predefined
|
public static bool IsVoid(this TypeSyntax type) => type is PredefinedTypeSyntax predefined
|
||||||
&& predefined.Keyword.IsKind(SyntaxKind.VoidKeyword);
|
&& predefined.Keyword.IsKind(SyntaxKind.VoidKeyword);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,5 +48,7 @@ namespace SDL
|
||||||
|
|
||||||
return new Utf8String(raw);
|
return new Utf8String(raw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal ref readonly byte GetPinnableReference() => ref Raw.GetPinnableReference();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue