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