diff options
Diffstat (limited to 'src/Ryujinx.HLE/HOS/Services/Sm')
| -rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Sm/IManagerInterface.cs | 2 | ||||
| -rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs | 11 | ||||
| -rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Sm/ResultCode.cs | 10 | ||||
| -rw-r--r-- | src/Ryujinx.HLE/HOS/Services/Sm/SmRegistry.cs | 2 |
4 files changed, 13 insertions, 12 deletions
diff --git a/src/Ryujinx.HLE/HOS/Services/Sm/IManagerInterface.cs b/src/Ryujinx.HLE/HOS/Services/Sm/IManagerInterface.cs index f867f23a..412a3324 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sm/IManagerInterface.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sm/IManagerInterface.cs @@ -5,4 +5,4 @@ { public IManagerInterface(ServiceCtx context) { } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs b/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs index 005ec32d..2d850220 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sm/IUserInterface.cs @@ -13,7 +13,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm { class IUserInterface : IpcService { - private static Dictionary<string, Type> _services; + private static readonly Dictionary<string, Type> _services; private readonly SmRegistry _registry; private readonly ServerBase _commonServer; @@ -68,7 +68,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm return ResultCode.InvalidName; } - KSession session = new KSession(context.Device.System.KernelContext); + KSession session = new(context.Device.System.KernelContext); if (_registry.TryGetService(name, out KPort port)) { @@ -182,7 +182,7 @@ namespace Ryujinx.HLE.HOS.Services.Sm Logger.Debug?.Print(LogClass.ServiceSm, $"Register \"{name}\"."); - KPort port = new KPort(context.Device.System.KernelContext, maxSessions, isLight, null); + KPort port = new(context.Device.System.KernelContext, maxSessions, isLight, null); if (!_registry.TryRegister(name, port)) { @@ -215,9 +215,10 @@ namespace Ryujinx.HLE.HOS.Services.Sm context.RequestData.BaseStream.Seek(namePosition + 8, SeekOrigin.Begin); +#pragma warning disable IDE0059 // Remove unnecessary value assignment bool isLight = (context.RequestData.ReadInt32() & 1) != 0; - int maxSessions = context.RequestData.ReadInt32(); +#pragma warning restore IDE0059 if (string.IsNullOrEmpty(name)) { @@ -258,4 +259,4 @@ namespace Ryujinx.HLE.HOS.Services.Sm base.DestroyAtExit(); } } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sm/ResultCode.cs b/src/Ryujinx.HLE/HOS/Services/Sm/ResultCode.cs index f72bf010..6db33d2a 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sm/ResultCode.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sm/ResultCode.cs @@ -2,14 +2,14 @@ namespace Ryujinx.HLE.HOS.Services.Sm { enum ResultCode { - ModuleId = 21, + ModuleId = 21, ErrorCodeShift = 9, Success = 0, - NotInitialized = (2 << ErrorCodeShift) | ModuleId, + NotInitialized = (2 << ErrorCodeShift) | ModuleId, AlreadyRegistered = (4 << ErrorCodeShift) | ModuleId, - InvalidName = (6 << ErrorCodeShift) | ModuleId, - NotRegistered = (7 << ErrorCodeShift) | ModuleId + InvalidName = (6 << ErrorCodeShift) | ModuleId, + NotRegistered = (7 << ErrorCodeShift) | ModuleId, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.HLE/HOS/Services/Sm/SmRegistry.cs b/src/Ryujinx.HLE/HOS/Services/Sm/SmRegistry.cs index e62e0eb5..3919eaae 100644 --- a/src/Ryujinx.HLE/HOS/Services/Sm/SmRegistry.cs +++ b/src/Ryujinx.HLE/HOS/Services/Sm/SmRegistry.cs @@ -46,4 +46,4 @@ namespace Ryujinx.HLE.HOS.Services.Sm _serviceRegistrationEvent.WaitOne(); } } -}
\ No newline at end of file +} |
