Fix nullable warnings
This commit is contained in:
@@ -20,7 +20,7 @@ namespace FlaxEditor
|
||||
/// <param name="writer">The <see cref="JsonWriter"/> to write to.</param>
|
||||
/// <param name="value">The value.</param>
|
||||
/// <param name="serializer">The calling serializer.</param>
|
||||
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
|
||||
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ namespace FlaxEditor
|
||||
/// <param name="existingValue">The existing property value of the JSON that is being converted.</param>
|
||||
/// <param name="serializer">The calling serializer.</param>
|
||||
/// <returns>The object value.</returns>
|
||||
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
|
||||
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
|
||||
{
|
||||
if (reader.TokenType == JsonToken.Null)
|
||||
{
|
||||
|
||||
@@ -350,14 +350,14 @@ namespace FlaxEngine.Interop
|
||||
#endif
|
||||
public static class NativeToManaged
|
||||
{
|
||||
public static T[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements)
|
||||
public static T[] AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements)
|
||||
{
|
||||
if (unmanaged is null)
|
||||
return null;
|
||||
return new T[numElements];
|
||||
}
|
||||
|
||||
public static Span<T> GetManagedValuesDestination(T[]? managed) => managed;
|
||||
public static Span<T> GetManagedValuesDestination(T[] managed) => managed;
|
||||
|
||||
public static ReadOnlySpan<TUnmanagedElement> GetUnmanagedValuesSource(TUnmanagedElement* unmanaged, int numElements)
|
||||
{
|
||||
@@ -390,7 +390,7 @@ namespace FlaxEngine.Interop
|
||||
#endif
|
||||
public static class ManagedToNative
|
||||
{
|
||||
public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[]? managed, out int numElements)
|
||||
public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[] managed, out int numElements)
|
||||
{
|
||||
if (managed is null)
|
||||
{
|
||||
@@ -402,7 +402,7 @@ namespace FlaxEngine.Interop
|
||||
return (TUnmanagedElement*)ManagedHandle.ToIntPtr(managedArray, GCHandleType.Weak);
|
||||
}
|
||||
|
||||
public static ReadOnlySpan<T> GetManagedValuesSource(T[]? managed) => managed;
|
||||
public static ReadOnlySpan<T> GetManagedValuesSource(T[] managed) => managed;
|
||||
|
||||
public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements)
|
||||
{
|
||||
@@ -431,7 +431,7 @@ namespace FlaxEngine.Interop
|
||||
ManagedArray unmanagedArray;
|
||||
ManagedHandle handle;
|
||||
|
||||
public void FromManaged(T[]? managed)
|
||||
public void FromManaged(T[] managed)
|
||||
{
|
||||
if (managed == null)
|
||||
return;
|
||||
@@ -476,7 +476,7 @@ namespace FlaxEngine.Interop
|
||||
}
|
||||
}
|
||||
|
||||
public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[]? managed, out int numElements)
|
||||
public static TUnmanagedElement* AllocateContainerForUnmanagedElements(T[] managed, out int numElements)
|
||||
{
|
||||
if (managed is null)
|
||||
{
|
||||
@@ -489,7 +489,7 @@ namespace FlaxEngine.Interop
|
||||
return (TUnmanagedElement*)handle;
|
||||
}
|
||||
|
||||
public static ReadOnlySpan<T> GetManagedValuesSource(T[]? managed) => managed;
|
||||
public static ReadOnlySpan<T> GetManagedValuesSource(T[] managed) => managed;
|
||||
|
||||
public static Span<TUnmanagedElement> GetUnmanagedValuesDestination(TUnmanagedElement* unmanaged, int numElements)
|
||||
{
|
||||
@@ -499,9 +499,9 @@ namespace FlaxEngine.Interop
|
||||
return unmanagedArray.ToSpan<TUnmanagedElement>();
|
||||
}
|
||||
|
||||
public static T[]? AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) => unmanaged is null ? null : new T[numElements];
|
||||
public static T[] AllocateContainerForManagedElements(TUnmanagedElement* unmanaged, int numElements) => unmanaged is null ? null : new T[numElements];
|
||||
|
||||
public static Span<T> GetManagedValuesDestination(T[]? managed) => managed;
|
||||
public static Span<T> GetManagedValuesDestination(T[] managed) => managed;
|
||||
|
||||
public static ReadOnlySpan<TUnmanagedElement> GetUnmanagedValuesSource(TUnmanagedElement* unmanaged, int numElements)
|
||||
{
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace FlaxEngine.Interop
|
||||
}
|
||||
|
||||
#if FLAX_EDITOR
|
||||
private static Assembly? OnScriptingAssemblyLoadContextResolving(AssemblyLoadContext assemblyLoadContext, AssemblyName assemblyName)
|
||||
private static Assembly OnScriptingAssemblyLoadContextResolving(AssemblyLoadContext assemblyLoadContext, AssemblyName assemblyName)
|
||||
{
|
||||
// FIXME: There should be a better way to resolve the path to EditorTargetPath where the dependencies are stored
|
||||
string editorTargetPath = Path.GetDirectoryName(nativeLibraryPaths.Keys.First(x => x != "FlaxEngine"));
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace FlaxEngine
|
||||
#else
|
||||
private class ExtractArrayFromListContext<T>
|
||||
{
|
||||
public static FieldInfo? itemsField;
|
||||
public static FieldInfo itemsField;
|
||||
}
|
||||
internal static T[] ExtractArrayFromList<T>(List<T> list)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user