5 Commits
0.6.0 ... 0.6.1

Author SHA1 Message Date
Matt Nadareski
daf27b9175 Bump version 2024-11-15 21:05:58 -05:00
Matt Nadareski
daaf157bc5 Fix build issues from old transient deps 2024-11-15 21:04:43 -05:00
Matt Nadareski
163b2483f9 Update Models and IO to 1.5.1 2024-11-15 20:52:42 -05:00
Matt Nadareski
8ed85d52ed Framework only matters for executable 2024-11-15 20:50:36 -05:00
Matt Nadareski
042fc18aa7 Fix path in GHA 2024-11-13 12:07:04 -05:00
7 changed files with 36 additions and 27 deletions

View File

@@ -28,13 +28,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: 'Nuget Package'
path: 'bin/Release/*.nupkg'
path: 'SabreTools.Compression/bin/Release/*.nupkg'
- name: Upload to rolling
uses: ncipollo/release-action@v1.14.0
with:
allowUpdates: True
artifacts: 'bin/Release/*.nupkg'
artifacts: 'SabreTools.Compression/bin/Release/*.nupkg'
body: 'Last built commit: ${{ github.sha }}'
name: 'Rolling Release'
prerelease: True

View File

@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using static SabreTools.Compression.Blast.Constants;
namespace SabreTools.Compression.Blast
@@ -148,7 +147,9 @@ namespace SabreTools.Compression.Blast
{
try
{
OutHow.AddRange(Output.Take((int)Next));
byte[] next = new byte[Next];
Array.Copy(Output, next, next.Length);
OutHow.AddRange(next);
return true;
}
catch

View File

@@ -0,0 +1,9 @@
#if NET20
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class | AttributeTargets.Method)]
internal sealed class ExtensionAttribute : Attribute {}
}
#endif

View File

@@ -1,5 +1,5 @@
using System;
using System.IO;
using System.Linq;
using System.Text;
using SabreTools.IO.Extensions;
using SabreTools.Models.Compression.LZ;
@@ -181,7 +181,8 @@ namespace SabreTools.Compression.LZ
}
// Initialize the table with all spaces
byte[] table = Enumerable.Repeat((byte)' ', LZ_TABLE_SIZE).ToArray();
byte[] table = new byte[LZ_TABLE_SIZE];
table = Array.ConvertAll(table, b => (byte)' ');
// Build the state
var state = new State
@@ -247,7 +248,8 @@ namespace SabreTools.Compression.LZ
state.RealCurrent = 0;
state.ByteType = 0;
state.StringLength = 0;
state.Table = Enumerable.Repeat((byte)' ', LZ_TABLE_SIZE).ToArray();
state.Table = new byte[LZ_TABLE_SIZE];
state.Table = Array.ConvertAll(state.Table, b => (byte)' ');
state.CurrentTableEntry = 0xFF0;
}

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using SabreTools.IO.Streams;
using SabreTools.Models.Compression.MSZIP;
using static SabreTools.Models.Compression.MSZIP.Constants;
@@ -316,13 +315,15 @@ namespace SabreTools.Compression.MSZIP
if (distance == null)
return null;
byte[] arr = bytes.Skip(bytes.Count - (int)distance).Take((int)length).ToArray();
byte[] bytesArr = [.. bytes];
byte[] arr = new byte[(int)length];
Array.Copy(bytesArr, bytes.Count - (int)distance, arr, 0, (int)length);
bytes.AddRange(arr);
}
}
// Return the decoded array
return bytes.ToArray();
return [.. bytes];
}
/// <summary>

View File

@@ -1,6 +1,8 @@
using System;
using System.IO;
#if NET35_OR_GREATER || NETCOREAPP
using System.Linq;
#endif
using SabreTools.IO.Streams;
namespace SabreTools.Compression.MSZIP
@@ -27,7 +29,15 @@ namespace SabreTools.Compression.MSZIP
HuffmanNode? root = null;
// Determine the value for max_bits
#if NET20
uint max_bits = 0;
foreach (uint u in lengths)
{
max_bits = u > max_bits ? u : max_bits;
}
#else
uint max_bits = lengths.Max();
#endif
// Count the number of codes for each code length
int[] bl_count = new int[max_bits + 1];

View File

@@ -7,7 +7,7 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>0.6.0</Version>
<Version>0.6.1</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
@@ -21,27 +21,13 @@
<PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup>
<!-- Support All Frameworks -->
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net2`)) OR $(TargetFramework.StartsWith(`net3`)) OR $(TargetFramework.StartsWith(`net4`))">
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith(`netcoreapp`)) OR $(TargetFramework.StartsWith(`net5`))">
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.StartsWith(`net6`)) OR $(TargetFramework.StartsWith(`net7`)) OR $(TargetFramework.StartsWith(`net8`)) OR $(TargetFramework.StartsWith(`net9`))">
<RuntimeIdentifiers>win-x86;win-x64;win-arm64;linux-x64;linux-arm64;osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="$(RuntimeIdentifier.StartsWith(`osx-arm`))">
<TargetFrameworks>net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="SabreTools.IO" Version="1.5.0" />
<PackageReference Include="SabreTools.Models" Version="1.5.0" />
<PackageReference Include="SabreTools.IO" Version="1.5.1" />
<PackageReference Include="SabreTools.Models" Version="1.5.1" />
</ItemGroup>
</Project>