Fix building plist-cil

This commit is contained in:
Frederik Carlier
2018-05-22 13:51:26 +02:00
parent b9977e92d3
commit 5be1901bdb
3 changed files with 49 additions and 13 deletions

View File

@@ -21,7 +21,6 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Text; using System.Text;
namespace Claunia.PropertyList namespace Claunia.PropertyList

View File

@@ -84,7 +84,10 @@ namespace Claunia.PropertyList
if(number <= byte.MaxValue) if(number <= byte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>
@@ -98,7 +101,10 @@ namespace Claunia.PropertyList
if(number >= sbyte.MinValue && number <= sbyte.MaxValue) if(number >= sbyte.MinValue && number <= sbyte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>
@@ -112,9 +118,15 @@ namespace Claunia.PropertyList
if(number <= byte.MaxValue) if(number <= byte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
else if(number <= ushort.MaxValue) else if(number <= ushort.MaxValue)
this.bytes = BitConverter.GetBytes((ushort)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((ushort)number);
Array.Reverse(this.bytes);
}
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>
@@ -128,9 +140,15 @@ namespace Claunia.PropertyList
if(number >= sbyte.MinValue && number <= sbyte.MaxValue) if(number >= sbyte.MinValue && number <= sbyte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
if(number >= short.MinValue && number <= short.MaxValue) if(number >= short.MinValue && number <= short.MaxValue)
this.bytes = BitConverter.GetBytes((short)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((short)number);
Array.Reverse(this.bytes);
}
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>
@@ -144,11 +162,20 @@ namespace Claunia.PropertyList
if(number <= byte.MaxValue) if(number <= byte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
else if(number <= ushort.MaxValue) else if(number <= ushort.MaxValue)
this.bytes = BitConverter.GetBytes((ushort)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((ushort)number);
Array.Reverse(this.bytes);
}
else if(number <= uint.MaxValue) else if(number <= uint.MaxValue)
this.bytes = BitConverter.GetBytes((uint)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((uint)number);
Array.Reverse(this.bytes);
}
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>
@@ -162,11 +189,20 @@ namespace Claunia.PropertyList
if(number >= sbyte.MinValue && number <= sbyte.MaxValue) if(number >= sbyte.MinValue && number <= sbyte.MaxValue)
this.bytes = new[] { (byte)number }; this.bytes = new[] { (byte)number };
if(number >= short.MinValue && number <= short.MaxValue) if(number >= short.MinValue && number <= short.MaxValue)
this.bytes = BitConverter.GetBytes((short)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((short)number);
Array.Reverse(this.bytes);
}
if(number >= int.MinValue && number <= int.MaxValue) if(number >= int.MinValue && number <= int.MaxValue)
this.bytes = BitConverter.GetBytes((int)number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes((int)number);
Array.Reverse(this.bytes);
}
else else
this.bytes = BitConverter.GetBytes(number).Reverse().ToArray(); {
this.bytes = BitConverter.GetBytes(number);
Array.Reverse(this.bytes);
}
} }
/// <summary> /// <summary>

View File

@@ -50,6 +50,7 @@ Added examples to README.</PackageReleaseNotes>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Numerics" /> <Reference Include="System.Numerics" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Core" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.4' Or '$(TargetFramework)' == 'netstandard1.6'"> <ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp1.0' Or '$(TargetFramework)' == 'netstandard1.3' Or '$(TargetFramework)' == 'netstandard1.4' Or '$(TargetFramework)' == 'netstandard1.6'">