Fix ~3500 analyser issues

See merge request ryubing/ryujinx!44
This commit is contained in:
MrKev
2025-05-30 17:08:34 -05:00
committed by LotP
parent 417df486b1
commit 361d0c5632
622 changed files with 3080 additions and 2652 deletions

View File

@@ -2,8 +2,6 @@ using System.Diagnostics.CodeAnalysis;
namespace Ryujinx.HLE.Loaders.Elf
{
[SuppressMessage("ReSharper", "InconsistentNaming")]
[SuppressMessage("Design", "CA1069: Enums values should not be duplicated")]
enum ElfDynamicTag
{
DT_NULL = 0,

View File

@@ -8,8 +8,8 @@ namespace Ryujinx.HLE.Loaders.Elf
public ElfSymbolBinding Binding { get; private set; }
public ElfSymbolVisibility Visibility { get; private set; }
public readonly bool IsFuncOrObject => Type == ElfSymbolType.SttFunc || Type == ElfSymbolType.SttObject;
public readonly bool IsGlobalOrWeak => Binding == ElfSymbolBinding.StbGlobal || Binding == ElfSymbolBinding.StbWeak;
public readonly bool IsFuncOrObject => Type is ElfSymbolType.SttFunc or ElfSymbolType.SttObject;
public readonly bool IsGlobalOrWeak => Binding is ElfSymbolBinding.StbGlobal or ElfSymbolBinding.StbWeak;
public int ShIdx { get; private set; }
public ulong Value { get; private set; }

View File

@@ -94,15 +94,15 @@ namespace Ryujinx.HLE.Loaders.Mods
static int ParseHexByte(byte c)
{
if (c >= '0' && c <= '9')
if (c is >= (byte)'0' and <= (byte)'9')
{
return c - '0';
}
else if (c >= 'A' && c <= 'F')
else if (c is >= (byte)'A' and <= (byte)'F')
{
return c - 'A' + 10;
}
else if (c >= 'a' && c <= 'f')
else if (c is >= (byte)'a' and <= (byte)'f')
{
return c - 'a' + 10;
}

View File

@@ -76,7 +76,7 @@ namespace Ryujinx.HLE.Loaders.Mods
Logger.Warning?.Print(LogClass.ModLoader, $"Attempted to patch protected memory ({patchOffset:x} is within protected boundary of {protectedOffset:x}).");
continue;
}
if (patchOffset > memory.Length)
{
Logger.Warning?.Print(LogClass.ModLoader, $"Attempted to patch out of bounds memory (offset {patchOffset} ({patchOffset:x}) exceeds memory buffer length {memory.Length}).");

View File

@@ -34,7 +34,7 @@ namespace Ryujinx.HLE.Loaders.Processes
if (!_processesByPid.TryGetValue(_latestPid, out ProcessResult value))
throw new RyujinxException(
$"The HLE Process map did not have a process with ID {_latestPid}. Are you missing firmware?");
return value;
}
}
@@ -159,7 +159,7 @@ namespace Ryujinx.HLE.Loaders.Processes
return false;
}
public bool LoadNxo(string path)
{
BlitStruct<ApplicationControlProperty> nacpData = new(1);
@@ -172,7 +172,7 @@ namespace Ryujinx.HLE.Loaders.Processes
// Load executable.
IExecutable executable;
if (Path.GetExtension(path).ToLower() == ".nro")
if (Path.GetExtension(path).Equals(".nro", StringComparison.OrdinalIgnoreCase))
{
FileStream input = new(path, FileMode.Open);
NroExecutable nro = new(input.AsStorage());