Structural and Memory Safety Improvements, Analyzer Cleanup (ryubing/ryujinx!47)

See merge request ryubing/ryujinx!47
This commit is contained in:
MrKev 2025-06-11 17:58:27 -05:00 committed by LotP
parent d03ae9c164
commit ea027d65a7
309 changed files with 1018 additions and 1247 deletions

View file

@ -10,10 +10,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// SetExpectedMasterVolume(f32, f32)
public ResultCode SetExpectedMasterVolume(ServiceCtx context)
{
#pragma warning disable IDE0059 // Remove unnecessary value assignment
float appletVolume = context.RequestData.ReadSingle();
float libraryAppletVolume = context.RequestData.ReadSingle();
#pragma warning restore IDE0059
_ = context.RequestData.ReadSingle(); // applet volume
_ = context.RequestData.ReadSingle(); // library applet volume
Logger.Stub?.PrintStub(LogClass.ServiceAm);
@ -46,10 +44,9 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// ChangeMainAppletMasterVolume(f32, u64)
public ResultCode ChangeMainAppletMasterVolume(ServiceCtx context)
{
#pragma warning disable IDE0059 // Remove unnecessary value assignment
float unknown0 = context.RequestData.ReadSingle();
long unknown1 = context.RequestData.ReadInt64();
#pragma warning restore IDE0059
// Unknown parameters.
_ = context.RequestData.ReadSingle();
_ = context.RequestData.ReadInt64();
Logger.Stub?.PrintStub(LogClass.ServiceAm);
@ -60,9 +57,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
// SetTransparentVolumeRate(f32)
public ResultCode SetTransparentVolumeRate(ServiceCtx context)
{
#pragma warning disable IDE0059 // Remove unnecessary value assignment
float unknown0 = context.RequestData.ReadSingle();
#pragma warning restore IDE0059
// Unknown parameter.
_ = context.RequestData.ReadSingle();
Logger.Stub?.PrintStub(LogClass.ServiceAm);

View file

@ -18,10 +18,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
private readonly Apm.SystemManagerServer _apmSystemManagerServer;
private bool _vrModeEnabled;
#pragma warning disable CS0414, IDE0052 // Remove unread private member
private bool _lcdBacklighOffEnabled;
private bool _requestExitToLibraryAppletAtExecuteNextProgramEnabled;
#pragma warning restore CS0414, IDE0052
private int _messageEventHandle;
private int _displayResolutionChangedEventHandle;

View file

@ -12,9 +12,8 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
public ResultCode CreateLibraryApplet(ServiceCtx context)
{
AppletId appletId = (AppletId)context.RequestData.ReadInt32();
#pragma warning disable IDE0059 // Remove unnecessary value assignment
int libraryAppletMode = context.RequestData.ReadInt32();
#pragma warning restore IDE0059
_ = context.RequestData.ReadInt32(); // libraryAppletMode
MakeObject(context, new ILibraryAppletAccessor(appletId, context.Device.System));

View file

@ -25,21 +25,21 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE.AllSystemAppletProxiesService.Sys
private readonly ulong _accumulatedSuspendedTickValue = 0;
// TODO: Determine where those fields are used.
#pragma warning disable IDE0052 // Remove unread private member
private bool _screenShotPermission = false;
private bool _operationModeChangedNotification = false;
private bool _performanceModeChangedNotification = false;
private bool _restartMessageEnabled = false;
private bool _outOfFocusSuspendingEnabled = false;
private bool _handlesRequestToDisplay = false;
#pragma warning restore IDE0052
private bool _autoSleepDisabled = false;
#pragma warning disable IDE0052 // Remove unread private member
private bool _albumImageTakenNotificationEnabled = false;
private bool _recordVolumeMuted = false;
private uint _screenShotImageOrientation = 0;
#pragma warning restore IDE0052
private uint _idleTimeDetectionExtension = 0;
public ISelfController(ServiceCtx context, ulong pid)

View file

@ -42,7 +42,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
{
try
{
this.Push(item);
Push(item);
return true;
}
@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
public bool TryTake(out T item)
{
return this.TryPop(out item);
return TryPop(out item);
}
public T Peek()
@ -104,7 +104,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
public void CopyTo(Array array, int index)
{
this.CopyTo((T[])array, index);
CopyTo((T[])array, index);
}
public IEnumerator<T> GetEnumerator()

View file

@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
public void Push(byte[] item)
{
if (!this.TryPush(item))
if (!TryPush(item))
{
// TODO(jduncanator): Throw a proper exception
throw new InvalidOperationException();
@ -50,7 +50,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
public byte[] Pop()
{
if (this.TryPop(out byte[] item))
if (TryPop(out byte[] item))
{
return item;
}
@ -71,7 +71,7 @@ namespace Ryujinx.HLE.HOS.Services.Am.AppletAE
/// </summary>
public AppletSession GetConsumer()
{
return new AppletSession(this._outputData, this._inputData);
return new AppletSession(_outputData, _inputData);
}
}
}