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
This commit is contained in:
parent
c86aacde76
commit
85dbb9559a
299 changed files with 12268 additions and 12276 deletions
|
@ -5,87 +5,87 @@ namespace Ryujinx.HLE.HOS.Ipc
|
|||
{
|
||||
class IpcHandleDesc
|
||||
{
|
||||
public bool HasPId { get; private set; }
|
||||
public bool HasPId { get; }
|
||||
|
||||
public long PId { get; private set; }
|
||||
public long PId { get; }
|
||||
|
||||
public int[] ToCopy { get; private set; }
|
||||
public int[] ToMove { get; private set; }
|
||||
public int[] ToCopy { get; }
|
||||
public int[] ToMove { get; }
|
||||
|
||||
public IpcHandleDesc(BinaryReader Reader)
|
||||
public IpcHandleDesc(BinaryReader reader)
|
||||
{
|
||||
int Word = Reader.ReadInt32();
|
||||
int word = reader.ReadInt32();
|
||||
|
||||
HasPId = (Word & 1) != 0;
|
||||
HasPId = (word & 1) != 0;
|
||||
|
||||
ToCopy = new int[(Word >> 1) & 0xf];
|
||||
ToMove = new int[(Word >> 5) & 0xf];
|
||||
ToCopy = new int[(word >> 1) & 0xf];
|
||||
ToMove = new int[(word >> 5) & 0xf];
|
||||
|
||||
PId = HasPId ? Reader.ReadInt64() : 0;
|
||||
PId = HasPId ? reader.ReadInt64() : 0;
|
||||
|
||||
for (int Index = 0; Index < ToCopy.Length; Index++)
|
||||
for (int index = 0; index < ToCopy.Length; index++)
|
||||
{
|
||||
ToCopy[Index] = Reader.ReadInt32();
|
||||
ToCopy[index] = reader.ReadInt32();
|
||||
}
|
||||
|
||||
for (int Index = 0; Index < ToMove.Length; Index++)
|
||||
for (int index = 0; index < ToMove.Length; index++)
|
||||
{
|
||||
ToMove[Index] = Reader.ReadInt32();
|
||||
ToMove[index] = reader.ReadInt32();
|
||||
}
|
||||
}
|
||||
|
||||
public IpcHandleDesc(int[] Copy, int[] Move)
|
||||
public IpcHandleDesc(int[] copy, int[] move)
|
||||
{
|
||||
ToCopy = Copy ?? throw new ArgumentNullException(nameof(Copy));
|
||||
ToMove = Move ?? throw new ArgumentNullException(nameof(Move));
|
||||
ToCopy = copy ?? throw new ArgumentNullException(nameof(copy));
|
||||
ToMove = move ?? throw new ArgumentNullException(nameof(move));
|
||||
}
|
||||
|
||||
public IpcHandleDesc(int[] Copy, int[] Move, long PId) : this(Copy, Move)
|
||||
public IpcHandleDesc(int[] copy, int[] move, long pId) : this(copy, move)
|
||||
{
|
||||
this.PId = PId;
|
||||
PId = pId;
|
||||
|
||||
HasPId = true;
|
||||
}
|
||||
|
||||
public static IpcHandleDesc MakeCopy(params int[] Handles)
|
||||
public static IpcHandleDesc MakeCopy(params int[] handles)
|
||||
{
|
||||
return new IpcHandleDesc(Handles, new int[0]);
|
||||
return new IpcHandleDesc(handles, new int[0]);
|
||||
}
|
||||
|
||||
public static IpcHandleDesc MakeMove(params int[] Handles)
|
||||
public static IpcHandleDesc MakeMove(params int[] handles)
|
||||
{
|
||||
return new IpcHandleDesc(new int[0], Handles);
|
||||
return new IpcHandleDesc(new int[0], handles);
|
||||
}
|
||||
|
||||
public byte[] GetBytes()
|
||||
{
|
||||
using (MemoryStream MS = new MemoryStream())
|
||||
using (MemoryStream ms = new MemoryStream())
|
||||
{
|
||||
BinaryWriter Writer = new BinaryWriter(MS);
|
||||
BinaryWriter writer = new BinaryWriter(ms);
|
||||
|
||||
int Word = HasPId ? 1 : 0;
|
||||
int word = HasPId ? 1 : 0;
|
||||
|
||||
Word |= (ToCopy.Length & 0xf) << 1;
|
||||
Word |= (ToMove.Length & 0xf) << 5;
|
||||
word |= (ToCopy.Length & 0xf) << 1;
|
||||
word |= (ToMove.Length & 0xf) << 5;
|
||||
|
||||
Writer.Write(Word);
|
||||
writer.Write(word);
|
||||
|
||||
if (HasPId)
|
||||
{
|
||||
Writer.Write((long)PId);
|
||||
writer.Write(PId);
|
||||
}
|
||||
|
||||
foreach (int Handle in ToCopy)
|
||||
foreach (int handle in ToCopy)
|
||||
{
|
||||
Writer.Write(Handle);
|
||||
writer.Write(handle);
|
||||
}
|
||||
|
||||
foreach (int Handle in ToMove)
|
||||
foreach (int handle in ToMove)
|
||||
{
|
||||
Writer.Write(Handle);
|
||||
writer.Write(handle);
|
||||
}
|
||||
|
||||
return MS.ToArray();
|
||||
return ms.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue