From 85dbb9559ad317a657dafd24da27fec4b3f5250f Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 4 Dec 2018 14:23:37 -0600 Subject: Adjust naming conventions and general refactoring in HLE Project (#490) * Rename enum fields * Naming conventions * Remove unneeded ".this" * Remove unneeded semicolons * Remove unused Usings * Don't use var * Remove unneeded enum underlying types * Explicitly label class visibility * Remove unneeded @ prefixes * Remove unneeded commas * Remove unneeded if expressions * Method doesn't use unsafe code * Remove unneeded casts * Initialized objects don't need an empty constructor * Remove settings from DotSettings * Revert "Explicitly label class visibility" This reverts commit ad5eb5787cc5b27a4631cd46ef5f551c4ae95e51. * Small changes * Revert external enum renaming * Changes from feedback * Remove unneeded property setters --- Ryujinx.HLE/HOS/Services/Am/ISelfController.cs | 76 +++++++++++++------------- 1 file changed, 38 insertions(+), 38 deletions(-) (limited to 'Ryujinx.HLE/HOS/Services/Am/ISelfController.cs') diff --git a/Ryujinx.HLE/HOS/Services/Am/ISelfController.cs b/Ryujinx.HLE/HOS/Services/Am/ISelfController.cs index 2abaee2e..dc922037 100644 --- a/Ryujinx.HLE/HOS/Services/Am/ISelfController.cs +++ b/Ryujinx.HLE/HOS/Services/Am/ISelfController.cs @@ -8,17 +8,17 @@ namespace Ryujinx.HLE.HOS.Services.Am { class ISelfController : IpcService { - private Dictionary m_Commands; + private Dictionary _commands; - public override IReadOnlyDictionary Commands => m_Commands; + public override IReadOnlyDictionary Commands => _commands; - private KEvent LaunchableEvent; + private KEvent _launchableEvent; - private int IdleTimeDetectionExtension; + private int _idleTimeDetectionExtension; - public ISelfController(Horizon System) + public ISelfController(Horizon system) { - m_Commands = new Dictionary() + _commands = new Dictionary { { 0, Exit }, { 1, LockExit }, @@ -36,114 +36,114 @@ namespace Ryujinx.HLE.HOS.Services.Am { 63, GetIdleTimeDetectionExtension } }; - LaunchableEvent = new KEvent(System); + _launchableEvent = new KEvent(system); } - public long Exit(ServiceCtx Context) + public long Exit(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long LockExit(ServiceCtx Context) + public long LockExit(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long UnlockExit(ServiceCtx Context) + public long UnlockExit(ServiceCtx context) { Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long GetLibraryAppletLaunchableEvent(ServiceCtx Context) + public long GetLibraryAppletLaunchableEvent(ServiceCtx context) { - LaunchableEvent.ReadableEvent.Signal(); + _launchableEvent.ReadableEvent.Signal(); - if (Context.Process.HandleTable.GenerateHandle(LaunchableEvent.ReadableEvent, out int Handle) != KernelResult.Success) + if (context.Process.HandleTable.GenerateHandle(_launchableEvent.ReadableEvent, out int handle) != KernelResult.Success) { throw new InvalidOperationException("Out of handles!"); } - Context.Response.HandleDesc = IpcHandleDesc.MakeCopy(Handle); + context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle); Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetScreenShotPermission(ServiceCtx Context) + public long SetScreenShotPermission(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetOperationModeChangedNotification(ServiceCtx Context) + public long SetOperationModeChangedNotification(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetPerformanceModeChangedNotification(ServiceCtx Context) + public long SetPerformanceModeChangedNotification(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetFocusHandlingMode(ServiceCtx Context) + public long SetFocusHandlingMode(ServiceCtx context) { - bool Flag1 = Context.RequestData.ReadByte() != 0 ? true : false; - bool Flag2 = Context.RequestData.ReadByte() != 0 ? true : false; - bool Flag3 = Context.RequestData.ReadByte() != 0 ? true : false; + bool flag1 = context.RequestData.ReadByte() != 0; + bool flag2 = context.RequestData.ReadByte() != 0; + bool flag3 = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetRestartMessageEnabled(ServiceCtx Context) + public long SetRestartMessageEnabled(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetOutOfFocusSuspendingEnabled(ServiceCtx Context) + public long SetOutOfFocusSuspendingEnabled(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetScreenShotImageOrientation(ServiceCtx Context) + public long SetScreenShotImageOrientation(ServiceCtx context) { - int Orientation = Context.RequestData.ReadInt32(); + int orientation = context.RequestData.ReadInt32(); Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); return 0; } - public long SetHandlesRequestToDisplay(ServiceCtx Context) + public long SetHandlesRequestToDisplay(ServiceCtx context) { - bool Enable = Context.RequestData.ReadByte() != 0 ? true : false; + bool enable = context.RequestData.ReadByte() != 0; Logger.PrintStub(LogClass.ServiceAm, "Stubbed."); @@ -151,21 +151,21 @@ namespace Ryujinx.HLE.HOS.Services.Am } // SetIdleTimeDetectionExtension(u32) - public long SetIdleTimeDetectionExtension(ServiceCtx Context) + public long SetIdleTimeDetectionExtension(ServiceCtx context) { - IdleTimeDetectionExtension = Context.RequestData.ReadInt32(); + _idleTimeDetectionExtension = context.RequestData.ReadInt32(); - Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {IdleTimeDetectionExtension}"); + Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {_idleTimeDetectionExtension}"); return 0; } // GetIdleTimeDetectionExtension() -> u32 - public long GetIdleTimeDetectionExtension(ServiceCtx Context) + public long GetIdleTimeDetectionExtension(ServiceCtx context) { - Context.ResponseData.Write(IdleTimeDetectionExtension); + context.ResponseData.Write(_idleTimeDetectionExtension); - Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {IdleTimeDetectionExtension}"); + Logger.PrintStub(LogClass.ServiceAm, $"Stubbed. IdleTimeDetectionExtension: {_idleTimeDetectionExtension}"); return 0; } -- cgit v1.2.3