diff options
| author | Mary <me@thog.eu> | 2021-04-24 12:16:01 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-24 12:16:01 +0200 |
| commit | 305f06eb71a7832e6b0081a67015b66ced8a23cd (patch) | |
| tree | 98bcb3ed465332a04af449cb5c74bdca7855a141 /Ryujinx.HLE/HOS/Services/Nifm/StaticService | |
| parent | c46f6879ff9171a1e024965618242e8bad373b6b (diff) | |
HLE: Fix integer sign inconcistency accross the codebase (#2222)
* Make all title id instances unsigned
* Replace address and size with ulong instead of signed types
Long overdue change.
Also change some logics here and there to optimize with the new memory
manager.
* Address Ac_K's comments
* Remove uneeded cast all around
* Fixes some others misalignment
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Nifm/StaticService')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs index 5f1f9b3a..e650879b 100644 --- a/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs +++ b/Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs @@ -29,11 +29,11 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // GetClientId() -> buffer<nn::nifm::ClientId, 0x1a, 4> public ResultCode GetClientId(ServiceCtx context) { - long position = context.Request.RecvListBuff[0].Position; + ulong position = context.Request.RecvListBuff[0].Position; - context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(4); + context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(sizeof(int)); - context.Memory.Write((ulong)position, _generalServiceDetail.ClientId); + context.Memory.Write(position, _generalServiceDetail.ClientId); return ResultCode.Success; } @@ -58,7 +58,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // GetCurrentNetworkProfile() -> buffer<nn::nifm::detail::sf::NetworkProfileData, 0x1a, 0x17c> public ResultCode GetCurrentNetworkProfile(ServiceCtx context) { - long networkProfileDataPosition = context.Request.RecvListBuff[0].Position; + ulong networkProfileDataPosition = context.Request.RecvListBuff[0].Position; (IPInterfaceProperties interfaceProperties, UnicastIPAddressInformation unicastAddress) = GetLocalInterface(); @@ -69,7 +69,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService Logger.Info?.Print(LogClass.ServiceNifm, $"Console's local IP is \"{unicastAddress.Address}\"."); - context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize(Unsafe.SizeOf<NetworkProfileData>()); + context.Response.PtrBuff[0] = context.Response.PtrBuff[0].WithSize((uint)Unsafe.SizeOf<NetworkProfileData>()); NetworkProfileData networkProfile = new NetworkProfileData { @@ -81,7 +81,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService Encoding.ASCII.GetBytes("RyujinxNetwork").CopyTo(networkProfile.Name.ToSpan()); - context.Memory.Write((ulong)networkProfileDataPosition, networkProfile); + context.Memory.Write(networkProfileDataPosition, networkProfile); return ResultCode.Success; } @@ -148,10 +148,10 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService // IsAnyInternetRequestAccepted(buffer<nn::nifm::ClientId, 0x19, 4>) -> bool public ResultCode IsAnyInternetRequestAccepted(ServiceCtx context) { - long position = context.Request.PtrBuff[0].Position; - long size = context.Request.PtrBuff[0].Size; + ulong position = context.Request.PtrBuff[0].Position; + ulong size = context.Request.PtrBuff[0].Size; - int clientId = context.Memory.Read<int>((ulong)position); + int clientId = context.Memory.Read<int>(position); context.ResponseData.Write(GeneralServiceManager.Get(clientId).IsAnyInternetRequestAccepted); |
