From 84cb7cd6b1bc55b065b547f62682ae70d9c65f70 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 23 Mar 2020 09:37:50 -0700 Subject: [PATCH 1/4] Check for duplicate Results when doing codegen --- build/CodeGen/ResultCodegen.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/build/CodeGen/ResultCodegen.cs b/build/CodeGen/ResultCodegen.cs index 6ca773b2..6a4ffc51 100644 --- a/build/CodeGen/ResultCodegen.cs +++ b/build/CodeGen/ResultCodegen.cs @@ -25,6 +25,7 @@ namespace LibHacBuild.CodeGen SetEmptyResultValues(modules); ValidateResults(modules); + CheckForDuplicates(modules); ValidateHierarchy(modules); CheckIfAggressiveInliningNeeded(modules); @@ -119,6 +120,24 @@ namespace LibHacBuild.CodeGen } } + private static void CheckForDuplicates(ModuleInfo[] modules) + { + foreach (ModuleInfo module in modules) + { + var set = new HashSet(); + + foreach (ResultInfo result in module.Results) + { + long description = (long)result.DescriptionStart << 32 | (uint)result.DescriptionEnd; + + if (!set.Add(description)) + { + throw new InvalidDataException($"Duplicate result {result.Module}-{result.DescriptionStart}-{result.DescriptionEnd}."); + } + } + } + } + private static void ValidateHierarchy(ModuleInfo[] modules) { foreach (ModuleInfo module in modules) From d68ca84f07a73806ca334320383e060c6f4d2a8f Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 23 Mar 2020 09:40:41 -0700 Subject: [PATCH 2/4] Update versions to 0.10 --- src/LibHac/Fs/Shim/Host.cs | 2 ++ src/LibHac/LibHac.csproj | 2 +- src/hactoolnet/hactoolnet.csproj | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LibHac/Fs/Shim/Host.cs b/src/LibHac/Fs/Shim/Host.cs index 1164dbbb..48786e31 100644 --- a/src/LibHac/Fs/Shim/Host.cs +++ b/src/LibHac/Fs/Shim/Host.cs @@ -43,6 +43,7 @@ namespace LibHac.Fs.Shim if (nameBuffer.Length < requiredNameBufferSize) return ResultFs.TooLongPath.Log(); + // ReSharper disable once RedundantAssignment int size = new U8StringBuilder(nameBuffer).Append(HostRootFileSystemPath).Append(_path.Str).Length; Debug.Assert(size == requiredNameBufferSize - 1); @@ -58,6 +59,7 @@ namespace LibHac.Fs.Shim Debug.Assert(nameBuffer.Length >= requiredNameBufferSize); + // ReSharper disable once RedundantAssignment int size = StringUtils.Copy(nameBuffer, HostRootFileSystemPath); Debug.Assert(size == requiredNameBufferSize - 1); diff --git a/src/LibHac/LibHac.csproj b/src/LibHac/LibHac.csproj index 9b02585c..113fcad4 100644 --- a/src/LibHac/LibHac.csproj +++ b/src/LibHac/LibHac.csproj @@ -2,7 +2,7 @@ Library - 0.9.0 + 0.10.0 netcoreapp3.0;netstandard2.1 8.0 true diff --git a/src/hactoolnet/hactoolnet.csproj b/src/hactoolnet/hactoolnet.csproj index 6a3cf580..132ec3bc 100644 --- a/src/hactoolnet/hactoolnet.csproj +++ b/src/hactoolnet/hactoolnet.csproj @@ -7,7 +7,7 @@ - 0.9.0 + 0.10.0 $(MSBuildProjectDirectory)=C:/hactoolnet/ From bc769d745418c5edf1fe9e5bf2a2de4e59bac125 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 23 Mar 2020 09:49:18 -0700 Subject: [PATCH 3/4] Update build dependencies --- DotnetCliVersion.txt | 2 +- build/_build.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DotnetCliVersion.txt b/DotnetCliVersion.txt index f7744831..61bb1836 100644 --- a/DotnetCliVersion.txt +++ b/DotnetCliVersion.txt @@ -1 +1 @@ -3.1.101 \ No newline at end of file +3.1.200 \ No newline at end of file diff --git a/build/_build.csproj b/build/_build.csproj index 33ce19a2..e852b673 100644 --- a/build/_build.csproj +++ b/build/_build.csproj @@ -11,9 +11,9 @@ - + - + From ef727293919189c12f74984dbb3f4f4a2d8df252 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Mon, 23 Mar 2020 10:32:22 -0700 Subject: [PATCH 4/4] Mark Nacp as deprecated --- src/LibHac/Nacp.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LibHac/Nacp.cs b/src/LibHac/Nacp.cs index 96ddec9b..f71d6b62 100644 --- a/src/LibHac/Nacp.cs +++ b/src/LibHac/Nacp.cs @@ -1,8 +1,10 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.IO; namespace LibHac { + [Obsolete("This class has been deprecated. LibHac.Ns.ApplicationControlProperty should be used instead.")] public class Nacp { public NacpDescription[] Descriptions { get; } = new NacpDescription[0x10];