Use file-scoped namespaces

This commit is contained in:
Alex Barney 2021-11-14 12:08:57 -07:00
parent 6fe89a2966
commit 34dda02c38
688 changed files with 81696 additions and 82374 deletions

View File

@ -1 +1 @@
5.0.402 6.0.100

View File

@ -22,8 +22,8 @@ using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction; using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks; using static Nuke.Common.Tools.DotNet.DotNetTasks;
namespace LibHacBuild namespace LibHacBuild;
{
partial class Build : NukeBuild partial class Build : NukeBuild
{ {
public static int Main() => Execute<Build>(x => x.Standard); public static int Main() => Execute<Build>(x => x.Standard);
@ -705,4 +705,3 @@ namespace LibHacBuild
} }
} }
} }
}

View File

@ -5,8 +5,8 @@ using System.Reflection;
using System.Text; using System.Text;
using Nuke.Common; using Nuke.Common;
namespace LibHacBuild.CodeGen namespace LibHacBuild.CodeGen;
{
public static class Common public static class Common
{ {
public static string GetHeader() public static string GetHeader()
@ -106,4 +106,3 @@ namespace LibHacBuild.CodeGen
return Path.Combine(currentDir, "src"); return Path.Combine(currentDir, "src");
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using System.Text; using System.Text;
namespace LibHacBuild.CodeGen namespace LibHacBuild.CodeGen;
{
public class IndentingStringBuilder public class IndentingStringBuilder
{ {
public int LevelSize { get; set; } = 4; public int LevelSize { get; set; } = 4;
@ -86,4 +86,3 @@ namespace LibHacBuild.CodeGen
public override string ToString() => _sb.ToString(); public override string ToString() => _sb.ToString();
} }
}

View File

@ -11,8 +11,8 @@ using CsvHelper;
using CsvHelper.Configuration; using CsvHelper.Configuration;
using static LibHacBuild.CodeGen.Common; using static LibHacBuild.CodeGen.Common;
namespace LibHacBuild.CodeGen.Stage1 namespace LibHacBuild.CodeGen.Stage1;
{
public static class ResultCodeGen public static class ResultCodeGen
{ {
// RyuJIT will always be inlined a function if its CIL size is <= 0x10 bytes // RyuJIT will always be inlined a function if its CIL size is <= 0x10 bytes
@ -712,4 +712,3 @@ namespace LibHacBuild.CodeGen.Stage1
}); });
} }
} }
}

View File

@ -8,8 +8,8 @@ using LibHac.Common.Keys;
using LibHac.Crypto; using LibHac.Crypto;
using static LibHacBuild.CodeGen.Common; using static LibHacBuild.CodeGen.Common;
namespace LibHacBuild.CodeGen.Stage2 namespace LibHacBuild.CodeGen.Stage2;
{
public static class KeysCodeGen public static class KeysCodeGen
{ {
private static string InputMainKeyFileName = "IncludedKeys.txt"; private static string InputMainKeyFileName = "IncludedKeys.txt";
@ -390,4 +390,3 @@ namespace LibHacBuild.CodeGen.Stage2
0x71, 0xB0, 0x5C, 0xF4, 0xAD, 0x63, 0x4F, 0xC5, 0xE2, 0xAC, 0x1E, 0xC4, 0x33, 0x96, 0x09, 0x7B 0x71, 0xB0, 0x5C, 0xF4, 0xAD, 0x63, 0x4F, 0xC5, 0xE2, 0xAC, 0x1E, 0xC4, 0x33, 0x96, 0x09, 0x7B
}; };
} }
}

View File

@ -2,8 +2,8 @@
using System.IO; using System.IO;
using Octokit; using Octokit;
namespace LibHacBuild.CodeGen.Stage2 namespace LibHacBuild.CodeGen.Stage2;
{
// Some codegen depends on classes in LibHac. // Some codegen depends on classes in LibHac.
// The part that does is split out into a separate project so the main build project // The part that does is split out into a separate project so the main build project
// doesn't depend on LibHac. // doesn't depend on LibHac.
@ -23,4 +23,3 @@ namespace LibHacBuild.CodeGen.Stage2
return 0; return 0;
} }
} }
}

View File

@ -3,6 +3,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace>LibHacBuild.CodeGen</RootNamespace> <RootNamespace>LibHacBuild.CodeGen</RootNamespace>
<IsPackable>False</IsPackable> <IsPackable>False</IsPackable>

View File

@ -11,8 +11,8 @@ using Nuke.Common.IO;
using Nuke.Common.Tools.NuGet; using Nuke.Common.Tools.NuGet;
using static Nuke.Common.IO.FileSystemTasks; using static Nuke.Common.IO.FileSystemTasks;
namespace LibHacBuild namespace LibHacBuild;
{
public partial class Build public partial class Build
{ {
public void RepackNugetPackage(string path) public void RepackNugetPackage(string path)
@ -133,4 +133,3 @@ namespace LibHacBuild
return BitConverter.ToString(arr).ToLower().Replace("-", ""); return BitConverter.ToString(arr).ToLower().Replace("-", "");
} }
} }
}

View File

@ -3,6 +3,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net5.0</TargetFramework>
<LangVersion>10.0</LangVersion>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath> <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<RootNamespace>LibHacBuild</RootNamespace> <RootNamespace>LibHacBuild</RootNamespace>
<IsPackable>False</IsPackable> <IsPackable>False</IsPackable>

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Account namespace LibHac.Account;
{
[DebuggerDisplay("0x{ToString(),nq}")] [DebuggerDisplay("0x{ToString(),nq}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)] [StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct Uid : IEquatable<Uid>, IComparable<Uid>, IComparable public struct Uid : IEquatable<Uid>, IComparable<Uid>, IComparable
@ -56,4 +56,3 @@ namespace LibHac.Account
public static bool operator <=(Uid left, Uid right) => left.CompareTo(right) <= 0; public static bool operator <=(Uid left, Uid right) => left.CompareTo(right) <= 0;
public static bool operator >=(Uid left, Uid right) => left.CompareTo(right) >= 0; public static bool operator >=(Uid left, Uid right) => left.CompareTo(right) >= 0;
} }
}

View File

@ -1,7 +1,7 @@
using System; using System;
namespace LibHac namespace LibHac;
{
public readonly struct ApplicationId : IEquatable<ApplicationId> public readonly struct ApplicationId : IEquatable<ApplicationId>
{ {
public static ApplicationId InvalidId => default; public static ApplicationId InvalidId => default;
@ -20,4 +20,3 @@ namespace LibHac
public bool Equals(ApplicationId other) => Value == other.Value; public bool Equals(ApplicationId other) => Value == other.Value;
public override int GetHashCode() => HashCode.Combine(Value); public override int GetHashCode() => HashCode.Combine(Value);
} }
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Arp namespace LibHac.Arp;
{
[StructLayout(LayoutKind.Explicit, Size = 0x10)] [StructLayout(LayoutKind.Explicit, Size = 0x10)]
public struct ApplicationLaunchProperty public struct ApplicationLaunchProperty
{ {
@ -10,4 +10,3 @@ namespace LibHac.Arp
[FieldOffset(0xC)] public Ncm.StorageId BaseStorageId; [FieldOffset(0xC)] public Ncm.StorageId BaseStorageId;
[FieldOffset(0xD)] public Ncm.StorageId UpdateStorageId; [FieldOffset(0xD)] public Ncm.StorageId UpdateStorageId;
} }
}

View File

@ -3,8 +3,8 @@ using LibHac.Arp.Impl;
using LibHac.Common; using LibHac.Common;
using LibHac.Ns; using LibHac.Ns;
namespace LibHac.Arp namespace LibHac.Arp;
{
public class ArpClient : IDisposable public class ArpClient : IDisposable
{ {
private HorizonClient _hosClient; private HorizonClient _hosClient;
@ -72,4 +72,3 @@ namespace LibHac.Arp
} }
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Ns; using LibHac.Ns;
namespace LibHac.Arp.Impl namespace LibHac.Arp.Impl;
{
public interface IReader : IDisposable public interface IReader : IDisposable
{ {
Result GetApplicationLaunchProperty(out ApplicationLaunchProperty launchProperty, ulong processId); Result GetApplicationLaunchProperty(out ApplicationLaunchProperty launchProperty, ulong processId);
@ -10,4 +10,3 @@ namespace LibHac.Arp.Impl
Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId); Result GetApplicationControlProperty(out ApplicationControlProperty controlProperty, ulong processId);
Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId); Result GetApplicationControlPropertyWithApplicationId(out ApplicationControlProperty controlProperty, ApplicationId applicationId);
} }
}

View File

@ -5,8 +5,8 @@ using LibHac.Bcat.Impl.Service.Core;
using LibHac.Common; using LibHac.Common;
using LibHac.Fs; using LibHac.Fs;
namespace LibHac.Bcat namespace LibHac.Bcat;
{
public class BcatServer public class BcatServer
{ {
private const int ServiceTypeCount = 4; private const int ServiceTypeCount = 4;
@ -87,4 +87,3 @@ namespace LibHac.Bcat
} }
} }
} }
}

View File

@ -1,5 +1,5 @@
namespace LibHac.Bcat namespace LibHac.Bcat;
{
public enum BcatServiceType public enum BcatServiceType
{ {
BcatU, BcatU,
@ -7,4 +7,3 @@
BcatM, BcatM,
BcatA BcatA
} }
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Bcat namespace LibHac.Bcat;
{
[StructLayout(LayoutKind.Explicit, Size = 0x38)] [StructLayout(LayoutKind.Explicit, Size = 0x38)]
public struct DeliveryCacheDirectoryEntry public struct DeliveryCacheDirectoryEntry
{ {
@ -16,4 +16,3 @@ namespace LibHac.Bcat
Digest = digest; Digest = digest;
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.InteropServices;
using LibHac.Common; using LibHac.Common;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Bcat namespace LibHac.Bcat;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 16)] [StructLayout(LayoutKind.Sequential, Size = 16)]
public struct Digest public struct Digest
@ -26,4 +26,3 @@ namespace LibHac.Bcat
return Bytes.ToHexString(); return Bytes.ToHexString();
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.InteropServices;
using LibHac.Common; using LibHac.Common;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Bcat namespace LibHac.Bcat;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = MaxSize)] [StructLayout(LayoutKind.Sequential, Size = MaxSize)]
public struct DirectoryName public struct DirectoryName
@ -50,4 +50,3 @@ namespace LibHac.Bcat
return StringUtils.Utf8ZToString(Bytes); return StringUtils.Utf8ZToString(Bytes);
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.InteropServices;
using LibHac.Common; using LibHac.Common;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Bcat namespace LibHac.Bcat;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = MaxSize)] [StructLayout(LayoutKind.Sequential, Size = MaxSize)]
public struct FileName public struct FileName
@ -53,4 +53,3 @@ namespace LibHac.Bcat
return StringUtils.Utf8ZToString(Bytes); return StringUtils.Utf8ZToString(Bytes);
} }
} }
}

View File

@ -2,8 +2,8 @@
using LibHac.Common; using LibHac.Common;
using LibHac.Sm; using LibHac.Sm;
namespace LibHac.Bcat.Impl.Ipc namespace LibHac.Bcat.Impl.Ipc;
{
internal class BcatServiceObject : IServiceObject internal class BcatServiceObject : IServiceObject
{ {
private SharedRef<IServiceCreator> _serviceCreator; private SharedRef<IServiceCreator> _serviceCreator;
@ -24,4 +24,3 @@ namespace LibHac.Bcat.Impl.Ipc
return Result.Success; return Result.Success;
} }
} }
}

View File

@ -1,11 +1,10 @@
using System; using System;
namespace LibHac.Bcat.Impl.Ipc namespace LibHac.Bcat.Impl.Ipc;
{
public interface IDeliveryCacheDirectoryService : IDisposable public interface IDeliveryCacheDirectoryService : IDisposable
{ {
Result Open(ref DirectoryName name); Result Open(ref DirectoryName name);
Result Read(out int entriesRead, Span<DeliveryCacheDirectoryEntry> entryBuffer); Result Read(out int entriesRead, Span<DeliveryCacheDirectoryEntry> entryBuffer);
Result GetCount(out int count); Result GetCount(out int count);
} }
}

View File

@ -1,7 +1,7 @@
using System; using System;
namespace LibHac.Bcat.Impl.Ipc namespace LibHac.Bcat.Impl.Ipc;
{
public interface IDeliveryCacheFileService : IDisposable public interface IDeliveryCacheFileService : IDisposable
{ {
Result Open(ref DirectoryName directoryName, ref FileName fileName); Result Open(ref DirectoryName directoryName, ref FileName fileName);
@ -9,4 +9,3 @@ namespace LibHac.Bcat.Impl.Ipc
Result GetSize(out long size); Result GetSize(out long size);
Result GetDigest(out Digest digest); Result GetDigest(out Digest digest);
} }
}

View File

@ -1,12 +1,11 @@
using System; using System;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Bcat.Impl.Ipc namespace LibHac.Bcat.Impl.Ipc;
{
public interface IDeliveryCacheStorageService : IDisposable public interface IDeliveryCacheStorageService : IDisposable
{ {
Result CreateFileService(ref SharedRef<IDeliveryCacheFileService> outFileService); Result CreateFileService(ref SharedRef<IDeliveryCacheFileService> outFileService);
Result CreateDirectoryService(ref SharedRef<IDeliveryCacheDirectoryService> outDirectoryService); Result CreateDirectoryService(ref SharedRef<IDeliveryCacheDirectoryService> outDirectoryService);
Result EnumerateDeliveryCacheDirectory(out int namesRead, Span<DirectoryName> nameBuffer); Result EnumerateDeliveryCacheDirectory(out int namesRead, Span<DirectoryName> nameBuffer);
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Bcat.Impl.Ipc namespace LibHac.Bcat.Impl.Ipc;
{
public interface IServiceCreator : IDisposable public interface IServiceCreator : IDisposable
{ {
Result CreateDeliveryCacheStorageService(ref SharedRef<IDeliveryCacheStorageService> outService, Result CreateDeliveryCacheStorageService(ref SharedRef<IDeliveryCacheStorageService> outService,
@ -11,4 +11,3 @@ namespace LibHac.Bcat.Impl.Ipc
Result CreateDeliveryCacheStorageServiceWithApplicationId( Result CreateDeliveryCacheStorageServiceWithApplicationId(
ref SharedRef<IDeliveryCacheStorageService> outService, ApplicationId applicationId); ref SharedRef<IDeliveryCacheStorageService> outService, ApplicationId applicationId);
} }
}

View File

@ -1,7 +1,7 @@
using System; using System;
namespace LibHac.Bcat.Impl.Service namespace LibHac.Bcat.Impl.Service;
{
[Flags] [Flags]
internal enum AccessControl internal enum AccessControl
{ {
@ -12,4 +12,3 @@ namespace LibHac.Bcat.Impl.Service
Debug = 1 << 4, Debug = 1 << 4,
All = ~0 All = ~0
} }
}

View File

@ -5,8 +5,8 @@ using LibHac.Common;
using LibHac.Fs; using LibHac.Fs;
using LibHac.Fs.Fsa; using LibHac.Fs.Fsa;
namespace LibHac.Bcat.Impl.Service.Core namespace LibHac.Bcat.Impl.Service.Core;
{
internal class DeliveryCacheDirectoryMetaAccessor internal class DeliveryCacheDirectoryMetaAccessor
{ {
private const int MaxEntryCount = 100; private const int MaxEntryCount = 100;
@ -98,4 +98,3 @@ namespace LibHac.Bcat.Impl.Service.Core
} }
} }
} }
}

View File

@ -1,11 +1,10 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Bcat.Impl.Service.Core namespace LibHac.Bcat.Impl.Service.Core;
{
[StructLayout(LayoutKind.Explicit, Size = 0x40)] [StructLayout(LayoutKind.Explicit, Size = 0x40)]
internal struct DeliveryCacheDirectoryMetaEntry internal struct DeliveryCacheDirectoryMetaEntry
{ {
[FieldOffset(0x00)] public DirectoryName Name; [FieldOffset(0x00)] public DirectoryName Name;
[FieldOffset(0x20)] public Digest Digest; [FieldOffset(0x20)] public Digest Digest;
} }
}

View File

@ -6,8 +6,8 @@ using LibHac.Fs;
using LibHac.Fs.Fsa; using LibHac.Fs.Fsa;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Bcat.Impl.Service.Core namespace LibHac.Bcat.Impl.Service.Core;
{
internal class DeliveryCacheFileMetaAccessor internal class DeliveryCacheFileMetaAccessor
{ {
private const int MaxEntryCount = 100; private const int MaxEntryCount = 100;
@ -119,4 +119,3 @@ namespace LibHac.Bcat.Impl.Service.Core
} }
} }
} }
}

View File

@ -1,7 +1,7 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Bcat.Impl.Service.Core namespace LibHac.Bcat.Impl.Service.Core;
{
[StructLayout(LayoutKind.Explicit, Size = 0x80)] [StructLayout(LayoutKind.Explicit, Size = 0x80)]
internal struct DeliveryCacheFileMetaEntry internal struct DeliveryCacheFileMetaEntry
{ {
@ -10,4 +10,3 @@ namespace LibHac.Bcat.Impl.Service.Core
[FieldOffset(0x28)] public long Size; [FieldOffset(0x28)] public long Size;
[FieldOffset(0x30)] public Digest Digest; [FieldOffset(0x30)] public Digest Digest;
} }
}

View File

@ -6,8 +6,8 @@ using LibHac.Fs.Fsa;
using LibHac.Fs.Shim; using LibHac.Fs.Shim;
using static LibHac.Fs.StringTraits; using static LibHac.Fs.StringTraits;
namespace LibHac.Bcat.Impl.Service.Core namespace LibHac.Bcat.Impl.Service.Core;
{
internal class DeliveryCacheStorageManager internal class DeliveryCacheStorageManager
{ {
private const int MaxEntryCount = 4; private const int MaxEntryCount = 4;
@ -396,4 +396,3 @@ namespace LibHac.Bcat.Impl.Service.Core
private static ReadOnlySpan<byte> FilesDirectoryName => // files private static ReadOnlySpan<byte> FilesDirectoryName => // files
new[] { (byte)'f', (byte)'i', (byte)'l', (byte)'e', (byte)'s' }; new[] { (byte)'f', (byte)'i', (byte)'l', (byte)'e', (byte)'s' };
} }
}

View File

@ -3,8 +3,8 @@ using LibHac.Bcat.Impl.Ipc;
using LibHac.Bcat.Impl.Service.Core; using LibHac.Bcat.Impl.Service.Core;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Bcat.Impl.Service namespace LibHac.Bcat.Impl.Service;
{
internal class DeliveryCacheDirectoryService : IDeliveryCacheDirectoryService internal class DeliveryCacheDirectoryService : IDeliveryCacheDirectoryService
{ {
private BcatServer Server { get; } private BcatServer Server { get; }
@ -104,4 +104,3 @@ namespace LibHac.Bcat.Impl.Service
Parent.NotifyCloseDirectory(); Parent.NotifyCloseDirectory();
} }
} }
}

View File

@ -5,8 +5,8 @@ using LibHac.Common;
using LibHac.Fs; using LibHac.Fs;
using LibHac.Fs.Fsa; using LibHac.Fs.Fsa;
namespace LibHac.Bcat.Impl.Service namespace LibHac.Bcat.Impl.Service;
{
internal class DeliveryCacheFileService : IDeliveryCacheFileService internal class DeliveryCacheFileService : IDeliveryCacheFileService
{ {
private BcatServer Server { get; } private BcatServer Server { get; }
@ -120,4 +120,3 @@ namespace LibHac.Bcat.Impl.Service
Parent.NotifyCloseFile(); Parent.NotifyCloseFile();
} }
} }
}

View File

@ -5,8 +5,8 @@ using LibHac.Bcat.Impl.Service.Core;
using LibHac.Common; using LibHac.Common;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Bcat.Impl.Service namespace LibHac.Bcat.Impl.Service;
{
internal class DeliveryCacheStorageService : IDeliveryCacheStorageService internal class DeliveryCacheStorageService : IDeliveryCacheStorageService
{ {
private const int MaxOpenCount = 8; private const int MaxOpenCount = 8;
@ -109,4 +109,3 @@ namespace LibHac.Bcat.Impl.Service
Server.GetStorageManager().Release(ApplicationId); Server.GetStorageManager().Release(ApplicationId);
} }
} }
}

View File

@ -2,8 +2,8 @@
using LibHac.Bcat.Impl.Ipc; using LibHac.Bcat.Impl.Ipc;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Bcat.Impl.Service namespace LibHac.Bcat.Impl.Service;
{
// Todo: Update BCAT service object management // Todo: Update BCAT service object management
internal class ServiceCreator : IServiceCreator internal class ServiceCreator : IServiceCreator
{ {
@ -56,4 +56,3 @@ namespace LibHac.Bcat.Impl.Service
return Result.Success; return Result.Success;
} }
} }
}

View File

@ -9,8 +9,8 @@
// code generation portion of the build. // code generation portion of the build.
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
namespace LibHac.Bcat namespace LibHac.Bcat;
{
public static class ResultBcat public static class ResultBcat
{ {
public const int ModuleBcat = 122; public const int ModuleBcat = 122;
@ -52,4 +52,3 @@ namespace LibHac.Bcat
/// <summary>Error code: 2122-0205; Inner value: 0x19a7a</summary> /// <summary>Error code: 2122-0205; Inner value: 0x19a7a</summary>
public static Result.Base StorageOpenLimitReached => new Result.Base(ModuleBcat, 205); public static Result.Base StorageOpenLimitReached => new Result.Base(ModuleBcat, 205);
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
namespace LibHac namespace LibHac;
{
public class BitReader public class BitReader
{ {
public byte[] Buffer { get; private set; } public byte[] Buffer { get; private set; }
@ -130,4 +130,3 @@ namespace LibHac
Negative = 0 Negative = 0
} }
} }
}

View File

@ -1,5 +1,5 @@
namespace LibHac namespace LibHac;
{
public static class BitTools public static class BitTools
{ {
public static int SignExtend32(int value, int bits) public static int SignExtend32(int value, int bits)
@ -8,4 +8,3 @@
return (value << shift) >> shift; return (value << shift) >> shift;
} }
} }
}

View File

@ -6,8 +6,8 @@ using LibHac.Common;
using LibHac.Crypto; using LibHac.Crypto;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Boot namespace LibHac.Boot;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Explicit, Size = 0xB0)] [StructLayout(LayoutKind.Explicit, Size = 0xB0)]
public struct EncryptedKeyBlob public struct EncryptedKeyBlob
@ -91,4 +91,3 @@ namespace LibHac.Boot
public override readonly string ToString() => ReadOnlyBytes.ToHexString(); public override readonly string ToString() => ReadOnlyBytes.ToHexString();
} }
}

View File

@ -9,8 +9,8 @@ using LibHac.Common.Keys;
using LibHac.Diag; using LibHac.Diag;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Boot namespace LibHac.Boot;
{
[StructLayout(LayoutKind.Explicit, Size = 0x170)] [StructLayout(LayoutKind.Explicit, Size = 0x170)]
public struct Package1MarikoOemHeader public struct Package1MarikoOemHeader
{ {
@ -551,4 +551,3 @@ namespace LibHac.Boot
(byte) '2', (byte) '0', (byte) '1', (byte) '8', (byte) '1', (byte) '1', (byte) '0', (byte) '7' (byte) '2', (byte) '0', (byte) '1', (byte) '8', (byte) '1', (byte) '1', (byte) '0', (byte) '7'
}; };
} }
}

View File

@ -8,8 +8,8 @@ using LibHac.Util;
using System.Diagnostics; using System.Diagnostics;
#endif #endif
namespace LibHac.Boot namespace LibHac.Boot;
{
[StructLayout(LayoutKind.Explicit, Size = 0x200)] [StructLayout(LayoutKind.Explicit, Size = 0x200)]
public struct Package2Header public struct Package2Header
{ {
@ -161,4 +161,3 @@ namespace LibHac.Boot
[DebuggerBrowsable(DebuggerBrowsableState.Never)] [FieldOffset(0x00)] private readonly Padding100 PaddingForVsDebugging; [DebuggerBrowsable(DebuggerBrowsableState.Never)] [FieldOffset(0x00)] private readonly Padding100 PaddingForVsDebugging;
#endif #endif
} }
}

View File

@ -8,8 +8,8 @@ using LibHac.Fs;
using LibHac.FsSystem; using LibHac.FsSystem;
using LibHac.Kernel; using LibHac.Kernel;
namespace LibHac.Boot namespace LibHac.Boot;
{
/// <summary> /// <summary>
/// Parses a package2 file and opens the payloads within. /// Parses a package2 file and opens the payloads within.
/// </summary> /// </summary>
@ -267,4 +267,3 @@ namespace LibHac.Boot
return _header.Meta.PayloadSizes[IniPayloadIndex] != 0; return _header.Meta.PayloadSizes[IniPayloadIndex] != 0;
} }
} }
}

View File

@ -1,8 +1,8 @@
using System.IO; using System.IO;
using System.Text; using System.Text;
namespace LibHac namespace LibHac;
{
public class Calibration public class Calibration
{ {
public const string ExpectedMagic = "CAL0"; public const string ExpectedMagic = "CAL0";
@ -272,4 +272,3 @@ namespace LibHac
ConsoleSixAxisSensorMountType = reader.ReadBytes(0x1); ConsoleSixAxisSensorMountType = reader.ReadBytes(0x1);
} }
} }
}

View File

@ -4,8 +4,8 @@ using LibHac.FsSystem.NcaUtils;
using LibHac.Ncm; using LibHac.Ncm;
using ContentType = LibHac.Ncm.ContentType; using ContentType = LibHac.Ncm.ContentType;
namespace LibHac namespace LibHac;
{
public class Cnmt public class Cnmt
{ {
public ulong TitleId { get; } public ulong TitleId { get; }
@ -323,4 +323,3 @@ namespace LibHac
FragmentIndex = reader.ReadInt16(); FragmentIndex = reader.ReadInt16();
} }
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common namespace LibHac.Common;
{
/// <summary> /// <summary>
/// Provides a representation of a region of memory as if it were a series of blittable structs /// Provides a representation of a region of memory as if it were a series of blittable structs
/// of type <typeparamref name="T"/>. Also allows viewing the memory as a <see cref="Span{T}"/> of bytes. /// of type <typeparamref name="T"/>. Also allows viewing the memory as a <see cref="Span{T}"/> of bytes.
@ -107,4 +107,3 @@ namespace LibHac.Common
return Unsafe.SizeOf<T>() * elementCount; return Unsafe.SizeOf<T>() * elementCount;
} }
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common namespace LibHac.Common;
{
/// <summary> /// <summary>
/// Handles storing a blittable struct or a series of blittable structs in a byte array. /// Handles storing a blittable struct or a series of blittable structs in a byte array.
/// </summary> /// </summary>
@ -67,4 +67,3 @@ namespace LibHac.Common
return Unsafe.SizeOf<T>() * elementCount; return Unsafe.SizeOf<T>() * elementCount;
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
/// <summary> /// <summary>
/// Represents a buffer of 16 bytes. /// Represents a buffer of 16 bytes.
/// Contains functions that assist with common operations on small buffers. /// Contains functions that assist with common operations on small buffers.
@ -125,4 +125,3 @@ namespace LibHac.Common
return Bytes.ToHexString(); return Bytes.ToHexString();
} }
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array1<T> public struct Array1<T>
{ {
@ -19,4 +19,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array1<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array1<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array12<T> public struct Array12<T>
{ {
@ -30,4 +30,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array12<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array12<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array128<T> public struct Array128<T>
{ {
@ -29,4 +29,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array128<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array128<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array16<T> public struct Array16<T>
{ {
@ -29,4 +29,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array16<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array16<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array2<T> public struct Array2<T>
{ {
@ -20,4 +20,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array2<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array2<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array256<T> public struct Array256<T>
{ {
@ -29,4 +29,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array256<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array256<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array3<T> public struct Array3<T>
{ {
@ -21,4 +21,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array3<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array3<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array32<T> public struct Array32<T>
{ {
@ -29,4 +29,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array32<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array32<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array4<T> public struct Array4<T>
{ {
@ -22,4 +22,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array4<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array4<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array5<T> public struct Array5<T>
{ {
@ -23,4 +23,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array5<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array5<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array64<T> public struct Array64<T>
{ {
@ -29,4 +29,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array64<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array64<T> value) => value.ItemsRo;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common.FixedArrays namespace LibHac.Common.FixedArrays;
{
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Array8<T> public struct Array8<T>
{ {
@ -26,4 +26,3 @@ namespace LibHac.Common.FixedArrays
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array8<T> value) => value.ItemsRo; public static implicit operator ReadOnlySpan<T>(in Array8<T> value) => value.ItemsRo;
} }
}

View File

@ -1,8 +1,8 @@
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using LibHac.Fs; using LibHac.Fs;
namespace LibHac.Common namespace LibHac.Common;
{
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
internal static class HResult internal static class HResult
{ {
@ -38,4 +38,3 @@ namespace LibHac.Common
_ => ResultFs.UnexpectedInLocalFileSystemE.Value _ => ResultFs.UnexpectedInLocalFileSystemE.Value
}; };
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
/// <summary> /// <summary>
/// A generic 128-bit ID value. /// A generic 128-bit ID value.
/// </summary> /// </summary>
@ -82,4 +82,3 @@ namespace LibHac.Common
public static bool operator <=(Id128 left, Id128 right) => left.CompareTo(right) <= 0; public static bool operator <=(Id128 left, Id128 right) => left.CompareTo(right) <= 0;
public static bool operator >=(Id128 left, Id128 right) => left.CompareTo(right) >= 0; public static bool operator >=(Id128 left, Id128 right) => left.CompareTo(right) >= 0;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Threading; using System.Threading;
namespace LibHac.Common namespace LibHac.Common;
{
internal readonly ref struct InitializationGuard internal readonly ref struct InitializationGuard
{ {
private readonly Ref<nint> _guard; private readonly Ref<nint> _guard;
@ -92,4 +92,3 @@ namespace LibHac.Common
return (guard & 1) != 0; return (guard & 1) != 0;
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.InteropServices;
#pragma warning disable 649 #pragma warning disable 649
namespace LibHac.Common namespace LibHac.Common;
{
public static unsafe class InteropWin32 public static unsafe class InteropWin32
{ {
[DllImport("kernel32.dll")] [DllImport("kernel32.dll")]
@ -61,4 +61,3 @@ namespace LibHac.Common
public Span<char> AlternateFileName => MemoryMarshal.CreateSpan(ref _alternateFileName[0], 14); public Span<char> AlternateFileName => MemoryMarshal.CreateSpan(ref _alternateFileName[0], 14);
} }
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)] [StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct Key128 : IEquatable<Key128> public struct Key128 : IEquatable<Key128>
@ -43,4 +43,3 @@ namespace LibHac.Common
public static bool operator ==(Key128 left, Key128 right) => left.Equals(right); public static bool operator ==(Key128 left, Key128 right) => left.Equals(right);
public static bool operator !=(Key128 left, Key128 right) => !(left == right); public static bool operator !=(Key128 left, Key128 right) => !(left == right);
} }
}

View File

@ -1,7 +1,7 @@
using System; using System;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
internal static partial class DefaultKeySet internal static partial class DefaultKeySet
{ {
private static ReadOnlySpan<byte> RootKeysDev => new byte[] { }; private static ReadOnlySpan<byte> RootKeysDev => new byte[] { };
@ -16,4 +16,3 @@ namespace LibHac.Common.Keys
private static ReadOnlySpan<byte> RsaSigningKeysProd => new byte[] { }; private static ReadOnlySpan<byte> RsaSigningKeysProd => new byte[] { };
private static ReadOnlySpan<byte> RsaKeys => new byte[] { }; private static ReadOnlySpan<byte> RsaKeys => new byte[] { };
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.InteropServices;
using Type = LibHac.Common.Keys.KeyInfo.KeyType; using Type = LibHac.Common.Keys.KeyInfo.KeyType;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
internal static partial class DefaultKeySet internal static partial class DefaultKeySet
{ {
/// <summary> /// <summary>
@ -178,4 +178,3 @@ namespace LibHac.Common.Keys
return keys; return keys;
} }
} }
}

View File

@ -8,8 +8,8 @@ using LibHac.Fs;
using LibHac.Spl; using LibHac.Spl;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
public static class ExternalKeyReader public static class ExternalKeyReader
{ {
private const int ReadBufferSize = 1024; private const int ReadBufferSize = 1024;
@ -585,4 +585,3 @@ namespace LibHac.Common.Keys
return false; return false;
} }
} }
}

View File

@ -9,8 +9,8 @@ using LibHac.Util;
using Type = LibHac.Common.Keys.KeyInfo.KeyType; using Type = LibHac.Common.Keys.KeyInfo.KeyType;
using RangeType = LibHac.Common.Keys.KeyInfo.KeyRangeType; using RangeType = LibHac.Common.Keys.KeyInfo.KeyRangeType;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
public static class ExternalKeyWriter public static class ExternalKeyWriter
{ {
public static void PrintKeys(KeySet keySet, StringBuilder sb, List<KeyInfo> keys, Type filter, bool isDev) public static void PrintKeys(KeySet keySet, StringBuilder sb, List<KeyInfo> keys, Type filter, bool isDev)
@ -170,4 +170,3 @@ namespace LibHac.Common.Keys
return sb.ToString(); return sb.ToString();
} }
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using LibHac.Crypto; using LibHac.Crypto;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
internal static class KeyDerivation internal static class KeyDerivation
{ {
public static void DeriveAllKeys(KeySet keySet, IProgressReport logger = null) public static void DeriveAllKeys(KeySet keySet, IProgressReport logger = null)
@ -395,4 +395,3 @@ namespace LibHac.Common.Keys
} }
} }
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using LibHac.Diag; using LibHac.Diag;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
[DebuggerDisplay("{" + nameof(Name) + "}")] [DebuggerDisplay("{" + nameof(Name) + "}")]
public readonly struct KeyInfo public readonly struct KeyInfo
{ {
@ -164,4 +164,3 @@ namespace LibHac.Common.Keys
return isValid1 && isValid2; return isValid1 && isValid2;
} }
} }
}

View File

@ -8,8 +8,8 @@ using LibHac.Crypto;
using LibHac.FsSrv; using LibHac.FsSrv;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common.Keys namespace LibHac.Common.Keys;
{
public class KeySet public class KeySet
{ {
public enum Mode public enum Mode
@ -381,4 +381,3 @@ namespace LibHac.Common.Keys
{ {
public RsaFullKey BetaNca0KeyAreaKey; public RsaFullKey BetaNca0KeyAreaKey;
} }
}

View File

@ -1,10 +1,9 @@
using System; using System;
namespace LibHac.Common namespace LibHac.Common;
{
[AttributeUsage(AttributeTargets.Struct)] [AttributeUsage(AttributeTargets.Struct)]
public sealed class NonCopyableAttribute : Attribute { } public sealed class NonCopyableAttribute : Attribute { }
[AttributeUsage(AttributeTargets.Struct)] [AttributeUsage(AttributeTargets.Struct)]
public sealed class NonCopyableDisposableAttribute : Attribute { } public sealed class NonCopyableDisposableAttribute : Attribute { }
}

View File

@ -1,8 +1,8 @@
using System.Diagnostics; using System.Diagnostics;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common namespace LibHac.Common;
{
// In order for the Visual Studio debugger to accurately display a struct, every offset // In order for the Visual Studio debugger to accurately display a struct, every offset
// in the struct that is used for the debugger display must be part of a field. // in the struct that is used for the debugger display must be part of a field.
// These padding structs make it easier to accomplish that. // These padding structs make it easier to accomplish that.
@ -49,4 +49,3 @@ namespace LibHac.Common
[DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly Padding100 Padding000; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly Padding100 Padding000;
[DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly Padding100 Padding100; [DebuggerBrowsable(DebuggerBrowsableState.Never)] private readonly Padding100 Padding100;
} }
}

View File

@ -5,8 +5,8 @@ using LibHac.Fs;
using LibHac.FsSystem; using LibHac.FsSystem;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
internal ref struct PathBuilder internal ref struct PathBuilder
{ {
@ -121,4 +121,3 @@ namespace LibHac.Common
return StringUtils.Utf8ZToString(_buffer.Slice(0, Length)); return StringUtils.Utf8ZToString(_buffer.Slice(0, Length));
} }
} }
}

View File

@ -6,8 +6,8 @@ using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common namespace LibHac.Common;
{
/// <summary> /// <summary>
/// A <see langword="struct"/> that can store a reference to a value of a specified type. /// A <see langword="struct"/> that can store a reference to a value of a specified type.
/// </summary> /// </summary>
@ -131,4 +131,3 @@ namespace LibHac.Common
return reference.Value; return reference.Value;
} }
} }
}

View File

@ -2,8 +2,8 @@
using System.Buffers; using System.Buffers;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace LibHac.Common namespace LibHac.Common;
{
public readonly ref struct RentedArray<T> public readonly ref struct RentedArray<T>
{ {
// It's faster to create new smaller arrays than rent them // It's faster to create new smaller arrays than rent them
@ -38,4 +38,3 @@ namespace LibHac.Common
} }
} }
} }
}

View File

@ -11,8 +11,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace LibHac.Common namespace LibHac.Common;
{
public static class ResultLibHac public static class ResultLibHac
{ {
public const int ModuleLibHac = 428; public const int ModuleLibHac = 428;
@ -93,4 +93,3 @@ namespace LibHac.Common
/// <summary>Error code: 2428-1043; Inner value: 0x827ac</summary> /// <summary>Error code: 2428-1043; Inner value: 0x827ac</summary>
public static Result.Base InvalidPackage1Pk11Size => new Result.Base(ModuleLibHac, 1043); public static Result.Base InvalidPackage1Pk11Size => new Result.Base(ModuleLibHac, 1043);
} }
}

View File

@ -1,7 +1,7 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace LibHac.Common namespace LibHac.Common;
{
public static class Shared public static class Shared
{ {
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
@ -19,4 +19,3 @@ namespace LibHac.Common
value = default; value = default;
} }
} }
}

View File

@ -6,8 +6,8 @@ using LibHac.Diag;
#pragma warning disable LH0001 #pragma warning disable LH0001
namespace LibHac.Common namespace LibHac.Common;
{
public static class SharedRefExtensions public static class SharedRefExtensions
{ {
// ReSharper disable once EntityNameCapturedOnly.Global // ReSharper disable once EntityNameCapturedOnly.Global
@ -438,4 +438,3 @@ namespace LibHac.Common
return sharedRef; return sharedRef;
} }
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Common namespace LibHac.Common;
{
public static class SpanExtensions public static class SpanExtensions
{ {
/// <summary> /// <summary>
@ -114,4 +114,3 @@ namespace LibHac.Common
return ref MemoryMarshal.Cast<TFrom, TTo>(span)[0]; return ref MemoryMarshal.Cast<TFrom, TTo>(span)[0];
} }
} }
}

View File

@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
using System.Text; using System.Text;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
public readonly ref struct U8Span public readonly ref struct U8Span
{ {
@ -100,4 +100,3 @@ namespace LibHac.Common
/// Otherwise, <see langword="false"/>.</returns> /// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0; public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0;
} }
}

View File

@ -5,8 +5,8 @@ using System.Runtime.InteropServices;
using System.Text; using System.Text;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
public readonly ref struct U8SpanMutable public readonly ref struct U8SpanMutable
{ {
@ -96,4 +96,3 @@ namespace LibHac.Common
/// Otherwise, <see langword="false"/>.</returns> /// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0; public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0;
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Text; using System.Text;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
public readonly struct U8String public readonly struct U8String
{ {
@ -61,4 +61,3 @@ namespace LibHac.Common
/// Otherwise, <see langword="false"/>.</returns> /// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0; public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0;
} }
}

View File

@ -6,8 +6,8 @@ using System.Runtime.CompilerServices;
using LibHac.Diag; using LibHac.Diag;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
public ref struct U8StringBuilder public ref struct U8StringBuilder
{ {
@ -566,4 +566,3 @@ namespace LibHac.Common
return ref sb; return ref sb;
} }
} }
}

View File

@ -1,5 +1,5 @@
namespace LibHac.Common namespace LibHac.Common;
{
public static class U8StringHelpers public static class U8StringHelpers
{ {
public static U8String ToU8String(this string value) public static U8String ToU8String(this string value)
@ -12,4 +12,3 @@
return new U8Span(value); return new U8Span(value);
} }
} }
}

View File

@ -3,8 +3,8 @@ using System.Diagnostics;
using System.Text; using System.Text;
using LibHac.Util; using LibHac.Util;
namespace LibHac.Common namespace LibHac.Common;
{
[DebuggerDisplay("{ToString()}")] [DebuggerDisplay("{ToString()}")]
public readonly struct U8StringMutable public readonly struct U8StringMutable
{ {
@ -68,4 +68,3 @@ namespace LibHac.Common
/// Otherwise, <see langword="false"/>.</returns> /// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0; public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0;
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using static InlineIL.IL.Emit; using static InlineIL.IL.Emit;
namespace LibHac.Common namespace LibHac.Common;
{
public static class UniqueRefExtensions public static class UniqueRefExtensions
{ {
// ReSharper disable once EntityNameCapturedOnly.Global // ReSharper disable once EntityNameCapturedOnly.Global
@ -88,4 +88,3 @@ namespace LibHac.Common
return oldValue; return oldValue;
} }
} }
}

View File

@ -1,7 +1,7 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace LibHac.Common namespace LibHac.Common;
{
public static class UnsafeHelpers public static class UnsafeHelpers
{ {
/// <summary> /// <summary>
@ -64,4 +64,3 @@ namespace LibHac.Common
SkipParamInit(out value3); SkipParamInit(out value3);
} }
} }
}

View File

@ -7,8 +7,8 @@ using LibHac.Diag;
using AesNi = System.Runtime.Intrinsics.X86.Aes; using AesNi = System.Runtime.Intrinsics.X86.Aes;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public static class Aes public static class Aes
{ {
public const int KeySize128 = 0x10; public const int KeySize128 = 0x10;
@ -308,4 +308,3 @@ namespace LibHac.Crypto
} }
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesCbcEncryptor : ICipher public class AesCbcEncryptor : ICipher
{ {
private AesCbcMode _baseCipher; private AesCbcMode _baseCipher;
@ -34,4 +34,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.Intrinsics;
using LibHac.Common; using LibHac.Common;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesCbcEncryptorNi : ICipherWithIv public class AesCbcEncryptorNi : ICipherWithIv
{ {
private AesCbcModeNi _baseCipher; private AesCbcModeNi _baseCipher;
@ -41,4 +41,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -2,8 +2,8 @@
using LibHac.Common; using LibHac.Common;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesCtrCipher : ICipherWithIv public class AesCtrCipher : ICipherWithIv
{ {
private AesCtrMode _baseCipher; private AesCtrMode _baseCipher;
@ -21,4 +21,3 @@ namespace LibHac.Crypto
_baseCipher.Transform(input, output); _baseCipher.Transform(input, output);
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.Intrinsics;
using LibHac.Common; using LibHac.Common;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesCtrCipherNi : ICipherWithIv public class AesCtrCipherNi : ICipherWithIv
{ {
private AesCtrModeNi _baseCipher; private AesCtrModeNi _baseCipher;
@ -23,4 +23,3 @@ namespace LibHac.Crypto
_baseCipher.Transform(input, output); _baseCipher.Transform(input, output);
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesEcbEncryptor : ICipher public class AesEcbEncryptor : ICipher
{ {
private AesEcbMode _baseCipher; private AesEcbMode _baseCipher;
@ -34,4 +34,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesEcbEncryptorNi : ICipher public class AesEcbEncryptorNi : ICipher
{ {
private AesEcbModeNi _baseCipher; private AesEcbModeNi _baseCipher;
@ -34,4 +34,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -2,8 +2,8 @@
using LibHac.Common; using LibHac.Common;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesXtsEncryptor : ICipherWithIv public class AesXtsEncryptor : ICipherWithIv
{ {
private AesXtsMode _baseCipher; private AesXtsMode _baseCipher;
@ -39,4 +39,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -4,8 +4,8 @@ using System.Runtime.Intrinsics;
using LibHac.Common; using LibHac.Common;
using LibHac.Crypto.Impl; using LibHac.Crypto.Impl;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public class AesXtsEncryptorNi : ICipherWithIv public class AesXtsEncryptorNi : ICipherWithIv
{ {
private AesXtsModeNi _baseCipher; private AesXtsModeNi _baseCipher;
@ -41,4 +41,3 @@ namespace LibHac.Crypto
_baseCipher.Decrypt(input, output); _baseCipher.Decrypt(input, output);
} }
} }
}

View File

@ -2,8 +2,8 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
internal static class CryptoUtil internal static class CryptoUtil
{ {
public static bool IsSameBytes(ReadOnlySpan<byte> buffer1, ReadOnlySpan<byte> buffer2, int length) public static bool IsSameBytes(ReadOnlySpan<byte> buffer1, ReadOnlySpan<byte> buffer2, int length)
@ -27,4 +27,3 @@ namespace LibHac.Crypto
return result == 0; return result == 0;
} }
} }
}

View File

@ -1,8 +1,8 @@
using System; using System;
using LibHac.Common; using LibHac.Common;
namespace LibHac.Crypto namespace LibHac.Crypto;
{
public interface ICipher public interface ICipher
{ {
void Transform(ReadOnlySpan<byte> input, Span<byte> output); void Transform(ReadOnlySpan<byte> input, Span<byte> output);
@ -12,4 +12,3 @@ namespace LibHac.Crypto
{ {
ref Buffer16 Iv { get; } ref Buffer16 Iv { get; }
} }
}

Some files were not shown because too many files have changed in this diff Show More