mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2024-08-19 21:52:22 +00:00
"static readonly" constants should be "const" instead (#5560)
* "static readonly" constants should be "const" instead * change fields to PascalCase
This commit is contained in:
parent
ddefb4fff4
commit
8edfb2bc7b
|
@ -32,7 +32,7 @@ namespace ARMeilleure.Instructions
|
||||||
15L << 56 | 14L << 48 | 13L << 40 | 12L << 32 | 07L << 24 | 06L << 16 | 05L << 8 | 04L << 0, // S
|
15L << 56 | 14L << 48 | 13L << 40 | 12L << 32 | 07L << 24 | 06L << 16 | 05L << 8 | 04L << 0, // S
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly long ZeroMask = 128L << 56 | 128L << 48 | 128L << 40 | 128L << 32 | 128L << 24 | 128L << 16 | 128L << 8 | 128L << 0;
|
public const long ZeroMask = 128L << 56 | 128L << 48 | 128L << 40 | 128L << 32 | 128L << 24 | 128L << 16 | 128L << 8 | 128L << 0;
|
||||||
|
|
||||||
public static ulong X86GetGf2p8LogicalShiftLeft(int shift)
|
public static ulong X86GetGf2p8LogicalShiftLeft(int shift)
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,7 +37,7 @@ namespace Ryujinx.Modules
|
||||||
private static readonly string _homeDir = AppDomain.CurrentDomain.BaseDirectory;
|
private static readonly string _homeDir = AppDomain.CurrentDomain.BaseDirectory;
|
||||||
private static readonly string _updateDir = Path.Combine(Path.GetTempPath(), "Ryujinx", "update");
|
private static readonly string _updateDir = Path.Combine(Path.GetTempPath(), "Ryujinx", "update");
|
||||||
private static readonly string _updatePublishDir = Path.Combine(_updateDir, "publish");
|
private static readonly string _updatePublishDir = Path.Combine(_updateDir, "publish");
|
||||||
private static readonly int _connectionCount = 4;
|
private const int ConnectionCount = 4;
|
||||||
|
|
||||||
private static string _buildVer;
|
private static string _buildVer;
|
||||||
private static string _platformExt;
|
private static string _platformExt;
|
||||||
|
@ -344,22 +344,22 @@ namespace Ryujinx.Modules
|
||||||
private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile)
|
private static void DoUpdateWithMultipleThreads(TaskDialog taskDialog, string downloadUrl, string updateFile)
|
||||||
{
|
{
|
||||||
// Multi-Threaded Updater
|
// Multi-Threaded Updater
|
||||||
long chunkSize = _buildSize / _connectionCount;
|
long chunkSize = _buildSize / ConnectionCount;
|
||||||
long remainderChunk = _buildSize % _connectionCount;
|
long remainderChunk = _buildSize % ConnectionCount;
|
||||||
|
|
||||||
int completedRequests = 0;
|
int completedRequests = 0;
|
||||||
int totalProgressPercentage = 0;
|
int totalProgressPercentage = 0;
|
||||||
int[] progressPercentage = new int[_connectionCount];
|
int[] progressPercentage = new int[ConnectionCount];
|
||||||
|
|
||||||
List<byte[]> list = new(_connectionCount);
|
List<byte[]> list = new(ConnectionCount);
|
||||||
List<WebClient> webClients = new(_connectionCount);
|
List<WebClient> webClients = new(ConnectionCount);
|
||||||
|
|
||||||
for (int i = 0; i < _connectionCount; i++)
|
for (int i = 0; i < ConnectionCount; i++)
|
||||||
{
|
{
|
||||||
list.Add(Array.Empty<byte>());
|
list.Add(Array.Empty<byte>());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < _connectionCount; i++)
|
for (int i = 0; i < ConnectionCount; i++)
|
||||||
{
|
{
|
||||||
#pragma warning disable SYSLIB0014
|
#pragma warning disable SYSLIB0014
|
||||||
// TODO: WebClient is obsolete and need to be replaced with a more complex logic using HttpClient.
|
// TODO: WebClient is obsolete and need to be replaced with a more complex logic using HttpClient.
|
||||||
|
@ -368,7 +368,7 @@ namespace Ryujinx.Modules
|
||||||
|
|
||||||
webClients.Add(client);
|
webClients.Add(client);
|
||||||
|
|
||||||
if (i == _connectionCount - 1)
|
if (i == ConnectionCount - 1)
|
||||||
{
|
{
|
||||||
client.Headers.Add("Range", $"bytes={chunkSize * i}-{(chunkSize * (i + 1) - 1) + remainderChunk}");
|
client.Headers.Add("Range", $"bytes={chunkSize * i}-{(chunkSize * (i + 1) - 1) + remainderChunk}");
|
||||||
}
|
}
|
||||||
|
@ -385,7 +385,7 @@ namespace Ryujinx.Modules
|
||||||
Interlocked.Exchange(ref progressPercentage[index], args.ProgressPercentage);
|
Interlocked.Exchange(ref progressPercentage[index], args.ProgressPercentage);
|
||||||
Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage);
|
Interlocked.Add(ref totalProgressPercentage, args.ProgressPercentage);
|
||||||
|
|
||||||
taskDialog.SetProgressBarState(totalProgressPercentage / _connectionCount, TaskDialogProgressState.Normal);
|
taskDialog.SetProgressBarState(totalProgressPercentage / ConnectionCount, TaskDialogProgressState.Normal);
|
||||||
};
|
};
|
||||||
|
|
||||||
client.DownloadDataCompleted += (_, args) =>
|
client.DownloadDataCompleted += (_, args) =>
|
||||||
|
@ -404,10 +404,10 @@ namespace Ryujinx.Modules
|
||||||
list[index] = args.Result;
|
list[index] = args.Result;
|
||||||
Interlocked.Increment(ref completedRequests);
|
Interlocked.Increment(ref completedRequests);
|
||||||
|
|
||||||
if (Equals(completedRequests, _connectionCount))
|
if (Equals(completedRequests, ConnectionCount))
|
||||||
{
|
{
|
||||||
byte[] mergedFileBytes = new byte[_buildSize];
|
byte[] mergedFileBytes = new byte[_buildSize];
|
||||||
for (int connectionIndex = 0, destinationOffset = 0; connectionIndex < _connectionCount; connectionIndex++)
|
for (int connectionIndex = 0, destinationOffset = 0; connectionIndex < ConnectionCount; connectionIndex++)
|
||||||
{
|
{
|
||||||
Array.Copy(list[connectionIndex], 0, mergedFileBytes, destinationOffset, list[connectionIndex].Length);
|
Array.Copy(list[connectionIndex], 0, mergedFileBytes, destinationOffset, list[connectionIndex].Length);
|
||||||
destinationOffset += list[connectionIndex].Length;
|
destinationOffset += list[connectionIndex].Length;
|
||||||
|
|
|
@ -28,8 +28,8 @@ namespace Ryujinx.Common.SystemInterop
|
||||||
[LibraryImport(X11LibraryName)]
|
[LibraryImport(X11LibraryName)]
|
||||||
private static partial int XCloseDisplay(IntPtr display);
|
private static partial int XCloseDisplay(IntPtr display);
|
||||||
|
|
||||||
private static readonly double _standardDpiScale = 96.0;
|
private const double StandardDpiScale = 96.0;
|
||||||
private static readonly double _maxScaleFactor = 1.25;
|
private const double MaxScaleFactor = 1.25;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Marks the application as DPI-Aware when running on the Windows operating system.
|
/// Marks the application as DPI-Aware when running on the Windows operating system.
|
||||||
|
@ -90,7 +90,7 @@ namespace Ryujinx.Common.SystemInterop
|
||||||
{
|
{
|
||||||
double userDpiScale = GetActualScaleFactor();
|
double userDpiScale = GetActualScaleFactor();
|
||||||
|
|
||||||
return Math.Min(userDpiScale / _standardDpiScale, _maxScaleFactor);
|
return Math.Min(userDpiScale / StandardDpiScale, MaxScaleFactor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
/// </summary>
|
/// </summary>
|
||||||
class MultiFenceHolder
|
class MultiFenceHolder
|
||||||
{
|
{
|
||||||
private static readonly int _bufferUsageTrackingGranularity = 4096;
|
private const int BufferUsageTrackingGranularity = 4096;
|
||||||
|
|
||||||
private readonly FenceHolder[] _fences;
|
private readonly FenceHolder[] _fences;
|
||||||
private readonly BufferUsageBitmap _bufferUsageBitmap;
|
private readonly BufferUsageBitmap _bufferUsageBitmap;
|
||||||
|
@ -28,7 +28,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||||
public MultiFenceHolder(int size)
|
public MultiFenceHolder(int size)
|
||||||
{
|
{
|
||||||
_fences = new FenceHolder[CommandBufferPool.MaxCommandBuffers];
|
_fences = new FenceHolder[CommandBufferPool.MaxCommandBuffers];
|
||||||
_bufferUsageBitmap = new BufferUsageBitmap(size, _bufferUsageTrackingGranularity);
|
_bufferUsageBitmap = new BufferUsageBitmap(size, BufferUsageTrackingGranularity);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -8,7 +8,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
|
||||||
{
|
{
|
||||||
class Demangler
|
class Demangler
|
||||||
{
|
{
|
||||||
private static readonly string _base36 = "0123456789abcdefghijklmnopqrstuvwxyz";
|
private const string Base36 = "0123456789abcdefghijklmnopqrstuvwxyz";
|
||||||
private readonly List<BaseNode> _substitutionList = new();
|
private readonly List<BaseNode> _substitutionList = new();
|
||||||
private List<BaseNode> _templateParamList = new();
|
private List<BaseNode> _templateParamList = new();
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler
|
||||||
|
|
||||||
for (int i = 0; i < reversedEncoded.Length; i++)
|
for (int i = 0; i < reversedEncoded.Length; i++)
|
||||||
{
|
{
|
||||||
int value = _base36.IndexOf(reversedEncoded[i]);
|
int value = Base36.IndexOf(reversedEncoded[i]);
|
||||||
if (value == -1)
|
if (value == -1)
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
"sdk",
|
"sdk",
|
||||||
};
|
};
|
||||||
|
|
||||||
public static readonly string MainNpdmPath = "/main.npdm";
|
public const string MainNpdmPath = "/main.npdm";
|
||||||
|
|
||||||
public const int NroAsetMagic = ('A' << 0) | ('S' << 8) | ('E' << 16) | ('T' << 24);
|
public const int NroAsetMagic = ('A' << 0) | ('S' << 8) | ('E' << 16) | ('T' << 24);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue