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 GreemDev
parent 634cfae98e
commit 50211d5f2d
622 changed files with 3080 additions and 2652 deletions

View file

@ -189,7 +189,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
return Vi.ResultCode.InvalidValue;
}
if (layer.State != LayerState.ManagedClosed && layer.State != LayerState.ManagedOpened)
if (layer.State is not LayerState.ManagedClosed and not LayerState.ManagedOpened)
{
Logger.Error?.Print(LogClass.SurfaceFlinger, $"Failed to destroy managed layer {layerId} (permission denied)");
@ -393,7 +393,7 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
PostFrameBuffer(layer, item);
}
else if (acquireStatus != Status.NoBufferAvailaible && acquireStatus != Status.InvalidOperation)
else if (acquireStatus is not Status.NoBufferAvailaible and not Status.InvalidOperation)
{
throw new InvalidOperationException();
}
@ -421,8 +421,8 @@ namespace Ryujinx.HLE.HOS.Services.SurfaceFlinger
Format format = ConvertColorFormat(item.GraphicBuffer.Object.Buffer.Surfaces[0].ColorFormat);
byte bytesPerPixel =
format == Format.B5G6R5Unorm ||
format == Format.R4G4B4A4Unorm ? (byte)2 : (byte)4;
format is Format.B5G6R5Unorm or
Format.R4G4B4A4Unorm ? (byte)2 : (byte)4;
int gobBlocksInY = 1 << item.GraphicBuffer.Object.Buffer.Surfaces[0].BlockHeightLog2;