misc: chore: Remove redundant qualifiers

This commit is contained in:
KeatonTheBot 2025-03-30 00:29:59 -05:00
parent 9bcb744a6a
commit 19013d360a
8 changed files with 66 additions and 66 deletions

View file

@ -1,7 +1,7 @@
namespace ARMeilleure namespace ARMeilleure
{ {
using Arm64HardwareCapabilities = ARMeilleure.CodeGen.Arm64.HardwareCapabilities; using Arm64HardwareCapabilities = CodeGen.Arm64.HardwareCapabilities;
using X86HardwareCapabilities = ARMeilleure.CodeGen.X86.HardwareCapabilities; using X86HardwareCapabilities = CodeGen.X86.HardwareCapabilities;
public static class Optimizations public static class Optimizations
{ {

View file

@ -191,7 +191,7 @@ namespace Ryujinx.Common.Utilities
if (timedSw.Elapsed.TotalSeconds > 0) if (timedSw.Elapsed.TotalSeconds > 0)
{ {
Log?.Write(LogType.Info, $"Checked at {readSizeB / (double)XCIFileTrimmer.BytesInAMegabyte / timedSw.Elapsed.TotalSeconds:N} Mb/sec"); Log?.Write(LogType.Info, $"Checked at {readSizeB / (double)BytesInAMegabyte / timedSw.Elapsed.TotalSeconds:N} Mb/sec");
} }
if (freeSpaceValid) if (freeSpaceValid)
@ -219,7 +219,7 @@ namespace Ryujinx.Common.Utilities
private bool CheckPadding(long readSizeB, CancellationToken? cancelToken = null) private bool CheckPadding(long readSizeB, CancellationToken? cancelToken = null)
{ {
long maxReads = readSizeB / XCIFileTrimmer.BufferSize; long maxReads = readSizeB / BufferSize;
long read = 0; long read = 0;
var buffer = new byte[BufferSize]; var buffer = new byte[BufferSize];
@ -230,12 +230,12 @@ namespace Ryujinx.Common.Utilities
return false; return false;
} }
int bytes = _fileStream.Read(buffer, 0, XCIFileTrimmer.BufferSize); int bytes = _fileStream.Read(buffer, 0, BufferSize);
if (bytes == 0) if (bytes == 0)
break; break;
Log?.Progress(read, maxReads, "Verifying file can be trimmed", false); Log?.Progress(read, maxReads, "Verifying file can be trimmed", false);
if (buffer.Take(bytes).AsParallel().Any(b => b != XCIFileTrimmer.PaddingByte)) if (buffer.Take(bytes).AsParallel().Any(b => b != PaddingByte))
{ {
Log?.Write(LogType.Warn, "Free space is NOT valid"); Log?.Write(LogType.Warn, "Free space is NOT valid");
return false; return false;
@ -380,7 +380,7 @@ namespace Ryujinx.Common.Utilities
if (timedSw.Elapsed.TotalSeconds > 0) if (timedSw.Elapsed.TotalSeconds > 0)
{ {
Log?.Write(LogType.Info, $"Wrote at {bytesToWriteB / (double)XCIFileTrimmer.BytesInAMegabyte / timedSw.Elapsed.TotalSeconds:N} Mb/sec"); Log?.Write(LogType.Info, $"Wrote at {bytesToWriteB / (double)BytesInAMegabyte / timedSw.Elapsed.TotalSeconds:N} Mb/sec");
} }
if (cancelToken.HasValue && cancelToken.Value.IsCancellationRequested) if (cancelToken.HasValue && cancelToken.Value.IsCancellationRequested)
@ -408,13 +408,13 @@ namespace Ryujinx.Common.Utilities
private void WritePadding(FileStream outfileStream, long bytesToWriteB, CancellationToken? cancelToken = null) private void WritePadding(FileStream outfileStream, long bytesToWriteB, CancellationToken? cancelToken = null)
{ {
long bytesLeftToWriteB = bytesToWriteB; long bytesLeftToWriteB = bytesToWriteB;
long writes = bytesLeftToWriteB / XCIFileTrimmer.BufferSize; long writes = bytesLeftToWriteB / BufferSize;
int write = 0; int write = 0;
try try
{ {
var buffer = new byte[BufferSize]; var buffer = new byte[BufferSize];
Array.Fill<byte>(buffer, XCIFileTrimmer.PaddingByte); Array.Fill<byte>(buffer, PaddingByte);
while (bytesLeftToWriteB > 0) while (bytesLeftToWriteB > 0)
{ {
@ -423,7 +423,7 @@ namespace Ryujinx.Common.Utilities
return; return;
} }
long bytesToWrite = Math.Min(XCIFileTrimmer.BufferSize, bytesLeftToWriteB); long bytesToWrite = Math.Min(BufferSize, bytesLeftToWriteB);
#if !XCI_TRIMMER_READ_ONLY_MODE #if !XCI_TRIMMER_READ_ONLY_MODE
outfileStream.Write(buffer, 0, (int)bytesToWrite); outfileStream.Write(buffer, 0, (int)bytesToWrite);
@ -504,12 +504,12 @@ namespace Ryujinx.Common.Utilities
} }
// Setup offset // Setup offset
_offsetB = (long)(assumeKeyArea ? XCIFileTrimmer.CartKeyAreaSize : 0); _offsetB = (long)(assumeKeyArea ? CartKeyAreaSize : 0);
// Check header // Check header
Pos = _offsetB + XCIFileTrimmer.HeaderFilePos; Pos = _offsetB + HeaderFilePos;
string head = System.Text.Encoding.ASCII.GetString(_binaryReader.ReadBytes(4)); string head = System.Text.Encoding.ASCII.GetString(_binaryReader.ReadBytes(4));
if (head != XCIFileTrimmer.HeaderMagicValue) if (head != HeaderMagicValue)
{ {
if (!assumeKeyArea) if (!assumeKeyArea)
{ {
@ -524,17 +524,17 @@ namespace Ryujinx.Common.Utilities
} }
// Read Cart Size // Read Cart Size
Pos = _offsetB + XCIFileTrimmer.CartSizeFilePos; Pos = _offsetB + CartSizeFilePos;
byte cartSizeId = _binaryReader.ReadByte(); byte cartSizeId = _binaryReader.ReadByte();
if (!_cartSizesGB.TryGetValue(cartSizeId, out long cartSizeNGB)) if (!_cartSizesGB.TryGetValue(cartSizeId, out long cartSizeNGB))
{ {
Log?.Write(LogType.Error, $"The source file doesn't look like an XCI file as the Cartridge Size is incorrect (0x{cartSizeId:X2})"); Log?.Write(LogType.Error, $"The source file doesn't look like an XCI file as the Cartridge Size is incorrect (0x{cartSizeId:X2})");
return false; return false;
} }
_cartSizeB = cartSizeNGB * XCIFileTrimmer.CartSizeMBinFormattedGB * XCIFileTrimmer.BytesInAMegabyte; _cartSizeB = cartSizeNGB * CartSizeMBinFormattedGB * BytesInAMegabyte;
// Read data size // Read data size
Pos = _offsetB + XCIFileTrimmer.DataSizeFilePos; Pos = _offsetB + DataSizeFilePos;
long records = (long)BitConverter.ToUInt32(_binaryReader.ReadBytes(4), 0); long records = (long)BitConverter.ToUInt32(_binaryReader.ReadBytes(4), 0);
_dataSizeB = RecordsToByte(records); _dataSizeB = RecordsToByte(records);

View file

@ -506,7 +506,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.MME
maxDrawCount, maxDrawCount,
stride, stride,
indexCount, indexCount,
Threed.IndirectDrawType.DrawIndexedIndirectCount); IndirectDrawType.DrawIndexedIndirectCount);
} }
/// <summary> /// <summary>

View file

@ -280,7 +280,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
Array8<uint> frameSizes = new(); Array8<uint> frameSizes = new();
int frameCount = 0; int frameCount = 0;
CodecErr res = Types.Decoder.ParseSuperframeIndex(data, (ulong)data.Length, ref frameSizes, out frameCount); CodecErr res = Decoder.ParseSuperframeIndex(data, (ulong)data.Length, ref frameSizes, out frameCount);
if (res != CodecErr.Ok) if (res != CodecErr.Ok)
{ {
return res; return res;
@ -321,7 +321,7 @@ namespace Ryujinx.Graphics.Nvdec.Vp9.Types
// Account for suboptimal termination by the encoder. // Account for suboptimal termination by the encoder.
while (dataStart.Length != 0) while (dataStart.Length != 0)
{ {
byte marker = Types.Decoder.ReadMarker(dataStart); byte marker = Decoder.ReadMarker(dataStart);
if (marker != 0) if (marker != 0)
{ {
break; break;

View file

@ -9,48 +9,48 @@ namespace Ryujinx.Graphics.Vulkan
{ {
class FormatCapabilities class FormatCapabilities
{ {
private static readonly GAL.Format[] _scaledFormats = private static readonly Format[] _scaledFormats =
[ [
GAL.Format.R8Uscaled, Format.R8Uscaled,
GAL.Format.R8Sscaled, Format.R8Sscaled,
GAL.Format.R16Uscaled, Format.R16Uscaled,
GAL.Format.R16Sscaled, Format.R16Sscaled,
GAL.Format.R8G8Uscaled, Format.R8G8Uscaled,
GAL.Format.R8G8Sscaled, Format.R8G8Sscaled,
GAL.Format.R16G16Uscaled, Format.R16G16Uscaled,
GAL.Format.R16G16Sscaled, Format.R16G16Sscaled,
GAL.Format.R8G8B8Uscaled, Format.R8G8B8Uscaled,
GAL.Format.R8G8B8Sscaled, Format.R8G8B8Sscaled,
GAL.Format.R16G16B16Uscaled, Format.R16G16B16Uscaled,
GAL.Format.R16G16B16Sscaled, Format.R16G16B16Sscaled,
GAL.Format.R8G8B8A8Uscaled, Format.R8G8B8A8Uscaled,
GAL.Format.R8G8B8A8Sscaled, Format.R8G8B8A8Sscaled,
GAL.Format.R16G16B16A16Uscaled, Format.R16G16B16A16Uscaled,
GAL.Format.R16G16B16A16Sscaled, Format.R16G16B16A16Sscaled,
GAL.Format.R10G10B10A2Uscaled, Format.R10G10B10A2Uscaled,
GAL.Format.R10G10B10A2Sscaled Format.R10G10B10A2Sscaled
]; ];
private static readonly GAL.Format[] _intFormats = private static readonly Format[] _intFormats =
[ [
GAL.Format.R8Uint, Format.R8Uint,
GAL.Format.R8Sint, Format.R8Sint,
GAL.Format.R16Uint, Format.R16Uint,
GAL.Format.R16Sint, Format.R16Sint,
GAL.Format.R8G8Uint, Format.R8G8Uint,
GAL.Format.R8G8Sint, Format.R8G8Sint,
GAL.Format.R16G16Uint, Format.R16G16Uint,
GAL.Format.R16G16Sint, Format.R16G16Sint,
GAL.Format.R8G8B8Uint, Format.R8G8B8Uint,
GAL.Format.R8G8B8Sint, Format.R8G8B8Sint,
GAL.Format.R16G16B16Uint, Format.R16G16B16Uint,
GAL.Format.R16G16B16Sint, Format.R16G16B16Sint,
GAL.Format.R8G8B8A8Uint, Format.R8G8B8A8Uint,
GAL.Format.R8G8B8A8Sint, Format.R8G8B8A8Sint,
GAL.Format.R16G16B16A16Uint, Format.R16G16B16A16Uint,
GAL.Format.R16G16B16A16Sint, Format.R16G16B16A16Sint,
GAL.Format.R10G10B10A2Uint, Format.R10G10B10A2Uint,
GAL.Format.R10G10B10A2Sint Format.R10G10B10A2Sint
]; ];
private readonly FormatFeatureFlags[] _bufferTable; private readonly FormatFeatureFlags[] _bufferTable;

View file

@ -144,7 +144,7 @@ namespace Ryujinx.Ava
public static ThemeVariant DetectSystemTheme() public static ThemeVariant DetectSystemTheme()
{ {
if (Application.Current is App app) if (Current is App app)
{ {
var colorValues = app.PlatformSettings.GetColorValues(); var colorValues = app.PlatformSettings.GetColorValues();

View file

@ -465,7 +465,7 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool OpenDeviceSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0; public bool OpenDeviceSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.DeviceSaveDataSize > 0;
public bool TrimXCIEnabled => Ryujinx.Common.Utilities.XCIFileTrimmer.CanTrim(SelectedApplication.Path, new Common.XCIFileTrimmerMainWindowLog(this)); public bool TrimXCIEnabled => XCIFileTrimmer.CanTrim(SelectedApplication.Path, new XCIFileTrimmerMainWindowLog(this));
public bool OpenBcatSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0; public bool OpenBcatSaveDirectoryEnabled => !SelectedApplication.ControlHolder.ByteSpan.IsZeros() && SelectedApplication.ControlHolder.Value.BcatDeliveryCacheStorageSize > 0;
@ -1554,7 +1554,7 @@ namespace Ryujinx.Ava.UI.ViewModels
Dispatcher.UIThread.InvokeAsync(() => Dispatcher.UIThread.InvokeAsync(() =>
{ {
Application.Current.Styles.TryGetResource(args.VSyncMode, Application.Current.Styles.TryGetResource(args.VSyncMode,
Avalonia.Application.Current.ActualThemeVariant, Application.Current.ActualThemeVariant,
out object color); out object color);
if (color is not null) if (color is not null)
@ -2235,7 +2235,7 @@ namespace Ryujinx.Ava.UI.ViewModels
} }
} }
public async void ProcessTrimResult(String filename, Ryujinx.Common.Utilities.XCIFileTrimmer.OperationOutcome operationOutcome) public async void ProcessTrimResult(String filename, XCIFileTrimmer.OperationOutcome operationOutcome)
{ {
string notifyUser = operationOutcome.ToLocalisedText(); string notifyUser = operationOutcome.ToLocalisedText();
@ -2250,8 +2250,8 @@ namespace Ryujinx.Ava.UI.ViewModels
{ {
switch (operationOutcome) switch (operationOutcome)
{ {
case Ryujinx.Common.Utilities.XCIFileTrimmer.OperationOutcome.Successful: case XCIFileTrimmer.OperationOutcome.Successful:
if (Avalonia.Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) if (Application.Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{ {
if (desktop.MainWindow is MainWindow mainWindow) if (desktop.MainWindow is MainWindow mainWindow)
mainWindow.LoadApplications(); mainWindow.LoadApplications();
@ -2268,7 +2268,7 @@ namespace Ryujinx.Ava.UI.ViewModels
return; return;
} }
var trimmer = new XCIFileTrimmer(filename, new Common.XCIFileTrimmerMainWindowLog(this)); var trimmer = new XCIFileTrimmer(filename, new XCIFileTrimmerMainWindowLog(this));
if (trimmer.CanBeTrimmed) if (trimmer.CanBeTrimmed)
{ {

View file

@ -231,7 +231,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.ShowContent = true; ViewModel.ShowContent = true;
ViewModel.IsLoadingIndeterminate = false; ViewModel.IsLoadingIndeterminate = false;
if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState) if (startFullscreen && ViewModel.WindowState != FullScreenWindowState)
{ {
ViewModel.ToggleFullscreen(); ViewModel.ToggleFullscreen();
} }
@ -243,7 +243,7 @@ namespace Ryujinx.Ava.UI.Windows
ViewModel.ShowLoadProgress = true; ViewModel.ShowLoadProgress = true;
ViewModel.IsLoadingIndeterminate = true; ViewModel.IsLoadingIndeterminate = true;
if (startFullscreen && ViewModel.WindowState != MainWindow.FullScreenWindowState) if (startFullscreen && ViewModel.WindowState != FullScreenWindowState)
{ {
ViewModel.ToggleFullscreen(); ViewModel.ToggleFullscreen();
} }