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

@@ -57,7 +57,7 @@ namespace Ryujinx.Common.SystemInterop
{
string xdgSessionType = Environment.GetEnvironmentVariable("XDG_SESSION_TYPE")?.ToLower();
if (xdgSessionType == null || xdgSessionType == "x11")
if (xdgSessionType is null or "x11")
{
nint display = XOpenDisplay(null);
string dpiString = Marshal.PtrToStringAnsi(XGetDefault(display, "Xft", "dpi"));
@@ -65,6 +65,7 @@ namespace Ryujinx.Common.SystemInterop
{
userDpiScale = XDisplayWidth(display, 0) * 25.4 / XDisplayWidthMM(display, 0);
}
_ = XCloseDisplay(display);
}
else if (xdgSessionType == "wayland")

View File

@@ -12,8 +12,8 @@ namespace Ryujinx.Common.SystemInterop
public partial class StdErrAdapter : IDisposable
{
private bool _disposable;
private Stream _pipeReader;
private Stream _pipeWriter;
private FileStream _pipeReader;
private FileStream _pipeWriter;
private CancellationTokenSource _cancellationTokenSource;
private Task _worker;
@@ -46,7 +46,7 @@ namespace Ryujinx.Common.SystemInterop
[SupportedOSPlatform("macos")]
private async Task EventWorkerAsync(CancellationToken cancellationToken)
{
using TextReader reader = new StreamReader(_pipeReader, leaveOpen: true);
using StreamReader reader = new(_pipeReader, leaveOpen: true);
string line;
while (cancellationToken.IsCancellationRequested == false && (line = await reader.ReadLineAsync(cancellationToken)) != null)
{
@@ -92,13 +92,12 @@ namespace Ryujinx.Common.SystemInterop
[SupportedOSPlatform("linux")]
[SupportedOSPlatform("macos")]
private static Stream CreateFileDescriptorStream(int fd)
private static FileStream CreateFileDescriptorStream(int fd)
{
return new FileStream(
new SafeFileHandle(fd, ownsHandle: true),
FileAccess.ReadWrite
);
}
}
}