Fix or suppress some ReSharper warnings

This commit is contained in:
Alex Barney 2021-12-18 23:45:06 -07:00
parent 0846b86249
commit ae35a1b916
6 changed files with 7 additions and 4 deletions

View file

@ -414,6 +414,7 @@ internal class NcaFileSystemService : IRomFileSystemAccessFailureManager
return Result.Success;
}
// ReSharper disable once OutParameterValueIsAlwaysDiscarded.Local
private Result OpenDataFileSystemCore(ref SharedRef<IFileSystem> outFileSystem, out bool isHostFs,
ulong programId, StorageId storageId)
{

View file

@ -630,6 +630,7 @@ public class NcaFileSystemServiceImpl
{
ulong ncaProgramId = ncaTemp.Header.TitleId;
// ReSharper disable once ConditionIsAlwaysTrueOrFalse
if (ncaProgramId != ulong.MaxValue && ncaId != ncaProgramId)
{
return ResultFs.InvalidNcaId.Log();

View file

@ -212,7 +212,7 @@ public static class HierarchicalIntegrityVerificationStorageExtensions
break;
}
if (block == Validity.Unchecked && levelValidity != Validity.Invalid)
if (block == Validity.Unchecked)
{
levelValidity = Validity.Unchecked;
}

View file

@ -11,7 +11,7 @@ public struct NcaSparseInfo
public Array16<byte> MetaHeader;
public long PhysicalOffset;
public ushort Generation;
private Array6<byte> _reserved;
public Array6<byte> Reserved;
public readonly uint GetGeneration() => (uint)(Generation << 16);
public readonly long GetPhysicalSize() => MetaOffset + MetaSize;

View file

@ -85,7 +85,7 @@ public class AesXtsDirectory : IDirectory
if (bytesRead != sizeof(uint) || magic != AesXtsFileHeader.AesXtsFileMagic) return 0;
file.Get.Read(out bytesRead, fileSizeOffset, SpanHelpers.AsByteSpan(ref fileSize), ReadOption.None);
if (bytesRead != sizeof(long) || magic != AesXtsFileHeader.AesXtsFileMagic) return 0;
if (bytesRead != sizeof(long)) return 0;
return fileSize;
}

View file

@ -195,6 +195,7 @@ public class Nca
long nodeOffset = 0;
long nodeSize = IndirectStorage.QueryNodeStorageSize(header.EntryCount);
// ReSharper disable once UselessBinaryOperation
long entryOffset = nodeOffset + nodeSize;
long entrySize = IndirectStorage.QueryEntryStorageSize(header.EntryCount);