Added /unsafe

This commit is contained in:
Lee Fogg 2020-04-25 00:31:33 +01:00
parent 89a8795143
commit c14296f2f3
2 changed files with 5 additions and 0 deletions

View File

@ -5,6 +5,10 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DefineConstants>TRACE</DefineConstants>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

View File

@ -65,6 +65,7 @@ namespace Emux.NAudio
AddSamples(_newSampleData, 0, length * sizeof(float));
}
// Taken and modified from System.BitConverter
[System.Security.SecuritySafeCritical]
public unsafe static void GetBytes(float value, byte[] bytes) => GetBytes(*(int*)&value, bytes);
[System.Security.SecuritySafeCritical]