diff options
author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-28 18:34:00 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 18:34:00 +0200 |
commit | 0a75b73fa43ddadf561ddeb0f923c6f3811c025b (patch) | |
tree | 402bfc83772498c26468115f5a73c7a8f07deae2 /src/Ryujinx.Memory/MemoryManagementUnix.cs | |
parent | 46b7c905f5dbb8c7e527281e22d5d2fc36bc666f (diff) |
[Ryujinx.Memory] Address dotnet-format issues (#5386)1.1.935
* dotnet format style --severity info
Some changes were manually reverted.
* dotnet format analyzers --serverity info
Some changes have been minimally adapted.
* Silence dotnet format IDE0059 warnings
* Address or silence dotnet format IDE1006 warnings
* Address dotnet format CA1816 warnings
* Address or silence dotnet format CA1069 warnings
* Address remaining dotnet format analyzer warnings
* Address review comments
* Address most dotnet format whitespace warnings
* Apply dotnet format whitespace formatting
A few of them have been manually reverted and the corresponding warning was silenced
* Format if-blocks correctly
* Another rebase, another dotnet format run
* Run dotnet format after rebase and remove unused usings
- analyzers
- style
- whitespace
* Add comments to disabled warnings
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* Address review feedback
* Assign Decommit to ReplacePlaceholder
* Run final dotnet format pass
* Organize imports again
* Add trailing commas
* Add missing newline
Diffstat (limited to 'src/Ryujinx.Memory/MemoryManagementUnix.cs')
-rw-r--r-- | src/Ryujinx.Memory/MemoryManagementUnix.cs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Ryujinx.Memory/MemoryManagementUnix.cs b/src/Ryujinx.Memory/MemoryManagementUnix.cs index 4314c392..9827b59b 100644 --- a/src/Ryujinx.Memory/MemoryManagementUnix.cs +++ b/src/Ryujinx.Memory/MemoryManagementUnix.cs @@ -50,7 +50,7 @@ namespace Ryujinx.Memory } } - IntPtr ptr = mmap(IntPtr.Zero, size, prot, flags, -1, 0); + IntPtr ptr = Mmap(IntPtr.Zero, size, prot, flags, -1, 0); if (ptr == MAP_FAILED) { @@ -115,7 +115,7 @@ namespace Ryujinx.Memory MemoryPermission.ReadAndExecute => MmapProts.PROT_READ | MmapProts.PROT_EXEC, MemoryPermission.ReadWriteExecute => MmapProts.PROT_READ | MmapProts.PROT_WRITE | MmapProts.PROT_EXEC, MemoryPermission.Execute => MmapProts.PROT_EXEC, - _ => throw new MemoryProtectionException(permission) + _ => throw new MemoryProtectionException(permission), }; } @@ -185,12 +185,12 @@ namespace Ryujinx.Memory public static void DestroySharedMemory(IntPtr handle) { - close((int)handle); + close(handle.ToInt32()); } public static IntPtr MapSharedMemory(IntPtr handle, ulong size) { - return mmap(IntPtr.Zero, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, MmapFlags.MAP_SHARED, (int)handle, 0); + return Mmap(IntPtr.Zero, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, MmapFlags.MAP_SHARED, handle.ToInt32(), 0); } public static void UnmapSharedMemory(IntPtr address, ulong size) @@ -200,12 +200,12 @@ namespace Ryujinx.Memory public static void MapView(IntPtr sharedMemory, ulong srcOffset, IntPtr location, ulong size) { - mmap(location, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, MmapFlags.MAP_FIXED | MmapFlags.MAP_SHARED, (int)sharedMemory, (long)srcOffset); + Mmap(location, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE, MmapFlags.MAP_FIXED | MmapFlags.MAP_SHARED, sharedMemory.ToInt32(), (long)srcOffset); } public static void UnmapView(IntPtr location, ulong size) { - mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED | MmapFlags.MAP_PRIVATE | MmapFlags.MAP_ANONYMOUS | MmapFlags.MAP_NORESERVE, -1, 0); + Mmap(location, size, MmapProts.PROT_NONE, MmapFlags.MAP_FIXED | MmapFlags.MAP_PRIVATE | MmapFlags.MAP_ANONYMOUS | MmapFlags.MAP_NORESERVE, -1, 0); } } -}
\ No newline at end of file +} |