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
10c74182ba
commit
b2b736abc2
205 changed files with 1020 additions and 1041 deletions
|
@ -93,7 +93,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
|||
throw new NotImplementedException($"{fdData.Name} {cmd:x4}");
|
||||
}
|
||||
|
||||
//TODO: Verify if the error codes needs to be translated.
|
||||
// TODO: Verify if the error codes needs to be translated.
|
||||
context.ResponseData.Write(result);
|
||||
|
||||
return 0;
|
||||
|
@ -127,7 +127,7 @@ namespace Ryujinx.HLE.HOS.Services.Nv
|
|||
int fd = context.RequestData.ReadInt32();
|
||||
int eventId = context.RequestData.ReadInt32();
|
||||
|
||||
//TODO: Use Fd/EventId, different channels have different events.
|
||||
// TODO: Use Fd/EventId, different channels have different events.
|
||||
if (context.Process.HandleTable.GenerateHandle(_event.ReadableEvent, out int handle) != KernelResult.Success)
|
||||
{
|
||||
throw new InvalidOperationException("Out of handles!");
|
||||
|
|
|
@ -50,25 +50,25 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
|
|||
{
|
||||
long mapEnd = position + size;
|
||||
|
||||
//Check if size is valid (0 is also not allowed).
|
||||
// Check if size is valid (0 is also not allowed).
|
||||
if ((ulong)mapEnd <= (ulong)position)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Check if address is page aligned.
|
||||
// Check if address is page aligned.
|
||||
if ((position & NvGpuVmm.PageMask) != 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Check if region is reserved.
|
||||
// Check if region is reserved.
|
||||
if (BinarySearch(_reservations, position) == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
//Check for overlap with already mapped buffers.
|
||||
// Check for overlap with already mapped buffers.
|
||||
Range map = BinarySearchLt(_maps, mapEnd);
|
||||
|
||||
if (map != null && map.End > (ulong)position)
|
||||
|
|
|
@ -64,8 +64,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
|
|||
|
||||
lock (asCtx)
|
||||
{
|
||||
//Note: When the fixed offset flag is not set,
|
||||
//the Offset field holds the alignment size instead.
|
||||
// Note: When the fixed offset flag is not set,
|
||||
// the Offset field holds the alignment size instead.
|
||||
if ((args.Flags & FlagFixedOffset) != 0)
|
||||
{
|
||||
args.Offset = asCtx.Vmm.ReserveFixed(args.Offset, (long)size);
|
||||
|
@ -218,8 +218,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvGpuAS
|
|||
|
||||
lock (asCtx)
|
||||
{
|
||||
//Note: When the fixed offset flag is not set,
|
||||
//the Offset field holds the alignment size instead.
|
||||
// Note: When the fixed offset flag is not set,
|
||||
// the Offset field holds the alignment size instead.
|
||||
bool vaAllocated = (args.Flags & FlagFixedOffset) == 0;
|
||||
|
||||
if (!vaAllocated)
|
||||
|
|
|
@ -69,14 +69,14 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostChannel
|
|||
context.Device.Gpu.PushCommandBuffer(vmm, cmdBufData);
|
||||
}
|
||||
|
||||
//TODO: Relocation, waitchecks, etc.
|
||||
// TODO: Relocation, waitchecks, etc.
|
||||
|
||||
return NvResult.Success;
|
||||
}
|
||||
|
||||
private static int GetSyncpoint(ServiceCtx context)
|
||||
{
|
||||
//TODO
|
||||
// TODO
|
||||
long inputPosition = context.Request.GetBufferType0x21().Position;
|
||||
long outputPosition = context.Request.GetBufferType0x22().Position;
|
||||
|
||||
|
|
|
@ -208,8 +208,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvHostCtrl
|
|||
{
|
||||
syncpt.AddWaiter(args.Thresh, waitEvent);
|
||||
|
||||
//Note: Negative (> INT_MAX) timeouts aren't valid on .NET,
|
||||
//in this case we just use the maximum timeout possible.
|
||||
// Note: Negative (> INT_MAX) timeouts aren't valid on .NET,
|
||||
// in this case we just use the maximum timeout possible.
|
||||
int timeout = args.Timeout;
|
||||
|
||||
if (timeout < -1)
|
||||
|
|
|
@ -128,9 +128,9 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
|
|||
|
||||
if (address == 0)
|
||||
{
|
||||
//When the address is zero, we need to allocate
|
||||
//our own backing memory for the NvMap.
|
||||
//TODO: Is this allocation inside the transfer memory?
|
||||
// When the address is zero, we need to allocate
|
||||
// our own backing memory for the NvMap.
|
||||
// TODO: Is this allocation inside the transfer memory?
|
||||
result = NvResult.OutOfMemory;
|
||||
}
|
||||
|
||||
|
@ -208,8 +208,8 @@ namespace Ryujinx.HLE.HOS.Services.Nv.NvMap
|
|||
case NvMapHandleParam.Kind: args.Result = map.Kind; break;
|
||||
case NvMapHandleParam.Compr: args.Result = 0; break;
|
||||
|
||||
//Note: Base is not supported and returns an error.
|
||||
//Any other value also returns an error.
|
||||
// Note: Base is not supported and returns an error.
|
||||
// Any other value also returns an error.
|
||||
default: return NvResult.InvalidInput;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue