mirror of
https://github.com/Ryujinx/ChocolArm64.git
synced 2024-12-22 14:55:29 +00:00
Misc cleanup (#708)
* Fix typos * Remove unneeded using statements * Enforce var style more * Remove redundant qualifiers * Fix some indentation * Disable naming warnings on files with external enum names * Fix build * Mass find & replace for comments with no spacing * Standardize todo capitalization and for/if spacing
This commit is contained in:
parent
a250878bfe
commit
25e6a2e0ea
|
@ -10,7 +10,7 @@ namespace ChocolArm64.Decoders
|
|||
{
|
||||
uint pc = GetPc();
|
||||
|
||||
//When the codition is never, the instruction is BLX to Thumb mode.
|
||||
// When the condition is never, the instruction is BLX to Thumb mode.
|
||||
if (Cond != Condition.Nv)
|
||||
{
|
||||
pc &= ~3u;
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace ChocolArm64.Instructions
|
|||
}
|
||||
else
|
||||
{
|
||||
context.EmitLdint(InstEmit32Helper.GetRegisterAlias(context.Mode, register));
|
||||
context.EmitLdint(GetRegisterAlias(context.Mode, register));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ namespace ChocolArm64.Instructions
|
|||
|
||||
context.Emit(OpCodes.Br, lblEnd);
|
||||
|
||||
//Address check passsed.
|
||||
// Address check passed.
|
||||
context.MarkLabel(lblEx);
|
||||
|
||||
context.EmitLdarg(TranslatedSub.MemoryArgIdx);
|
||||
|
|
|
@ -30,22 +30,22 @@ namespace ChocolArm64.Memory
|
|||
return ptr;
|
||||
}
|
||||
|
||||
public static bool Reprotect(IntPtr address, ulong size, Memory.MemoryProtection protection)
|
||||
public static bool Reprotect(IntPtr address, ulong size, MemoryProtection protection)
|
||||
{
|
||||
MmapProts prot = GetProtection(protection);
|
||||
|
||||
return Syscall.mprotect(address, size, prot) == 0;
|
||||
}
|
||||
|
||||
private static MmapProts GetProtection(Memory.MemoryProtection protection)
|
||||
private static MmapProts GetProtection(MemoryProtection protection)
|
||||
{
|
||||
switch (protection)
|
||||
{
|
||||
case Memory.MemoryProtection.None: return MmapProts.PROT_NONE;
|
||||
case Memory.MemoryProtection.Read: return MmapProts.PROT_READ;
|
||||
case Memory.MemoryProtection.ReadAndWrite: return MmapProts.PROT_READ | MmapProts.PROT_WRITE;
|
||||
case Memory.MemoryProtection.ReadAndExecute: return MmapProts.PROT_READ | MmapProts.PROT_EXEC;
|
||||
case Memory.MemoryProtection.Execute: return MmapProts.PROT_EXEC;
|
||||
case MemoryProtection.None: return MmapProts.PROT_NONE;
|
||||
case MemoryProtection.Read: return MmapProts.PROT_READ;
|
||||
case MemoryProtection.ReadAndWrite: return MmapProts.PROT_READ | MmapProts.PROT_WRITE;
|
||||
case MemoryProtection.ReadAndExecute: return MmapProts.PROT_READ | MmapProts.PROT_EXEC;
|
||||
case MemoryProtection.Execute: return MmapProts.PROT_EXEC;
|
||||
|
||||
default: throw new ArgumentException($"Invalid permission \"{protection}\".");
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace ChocolArm64.Translation
|
|||
|
||||
public TranslatedSub(DynamicMethod method, TranslationTier tier, bool rejit)
|
||||
{
|
||||
Method = method ?? throw new ArgumentNullException(nameof(method));;
|
||||
Method = method ?? throw new ArgumentNullException(nameof(method));
|
||||
Tier = tier;
|
||||
_rejit = rejit;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue