Fix deprecation warning

This commit is contained in:
Wojtek Figat
2023-02-19 14:32:34 +01:00
parent 1096daaeb7
commit c00769e2b8
2 changed files with 2 additions and 2 deletions

View File

@@ -71,7 +71,7 @@ String MacUtils::ToString(CFStringRef str)
CFStringRef MacUtils::ToString(const StringView& str)
{
return CFStringCreateWithBytes(nullptr, (const UInt8*)str.GetNonTerminatedText(), str.Length() * sizeof(Char), kCFStringEncodingUTF16LE, false);
return CFStringCreateWithBytes(nullptr, (const UInt8*)str.GetText(), str.Length() * sizeof(Char), kCFStringEncodingUTF16LE, false);
}
Float2 MacUtils::PosToCoca(const Float2& pos)

View File

@@ -204,7 +204,7 @@ namespace Flax.Build.Bindings
if (typeInfo.Type == "String")
return $"(StringView){value}";
if (typeInfo.IsPtr && typeInfo.IsConst && typeInfo.Type == "Char")
return $"((StringView){value}).GetNonTerminatedText()"; // (StringView)Variant, if not empty, is guaranteed to point to a null-terminated buffer.
return $"((StringView){value}).GetText()"; // (StringView)Variant, if not empty, is guaranteed to point to a null-terminated buffer.
if (typeInfo.Type == "AssetReference" || typeInfo.Type == "WeakAssetReference" || typeInfo.Type == "SoftAssetReference")
return $"ScriptingObject::Cast<{typeInfo.GenericArgs[0].Type}>((Asset*){value})";
if (typeInfo.Type == "ScriptingObjectReference" || typeInfo.Type == "SoftObjectReference")