Skip to content

Commit

Permalink
Rerun dotnet format after manual fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TiKevin83 committed Aug 28, 2023
1 parent 486ba0d commit 0808bed
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 25 deletions.
4 changes: 2 additions & 2 deletions src/BizHawk.Client.Common/Api/ClientWebSocketWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public readonly Task<WebSocketReceiveResult> Receive(ArraySegment<byte> buffer,
?? throw new ObjectDisposedException(nameof(_w));

/// <summary>calls <see cref="ClientWebSocket.ReceiveAsync"/></summary>
public string Receive(int bufferCap, CancellationToken? cancellationToken = null)
public readonly string Receive(int bufferCap, CancellationToken? cancellationToken = null)
{
if (_w == null) throw new ObjectDisposedException(nameof(_w));
var buffer = new byte[bufferCap];
Expand All @@ -52,7 +52,7 @@ public readonly Task Send(ArraySegment<byte> buffer, WebSocketMessageType messag
?? throw new ObjectDisposedException(nameof(_w));

/// <summary>calls <see cref="ClientWebSocket.SendAsync"/></summary>
public Task Send(string message, bool endOfMessage, CancellationToken? cancellationToken = null)
public readonly Task Send(string message, bool endOfMessage, CancellationToken? cancellationToken = null)
{
if (_w == null) throw new ObjectDisposedException(nameof(_w));
return Send(
Expand Down
8 changes: 4 additions & 4 deletions src/BizHawk.Client.Common/tools/Watch/Watch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
/// <returns>True if both watch are equals; otherwise, false</returns>
public static bool operator ==(Watch a, Watch b)
{
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
if (a is null || b is null)
{
return false;
}
Expand All @@ -171,7 +171,7 @@ public static Watch GenerateWatch(MemoryDomain domain, long address, WatchSize s
/// <returns>True if they are equals; otherwise, false</returns>
public static bool operator ==(Watch a, Cheat b)
{
if (ReferenceEquals(a, null) || ReferenceEquals(b, null))
if (a is null || b is null)
{
return false;
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public void ClearChangeCount()
/// <returns>True if both object are equals; otherwise, false</returns>
public bool Equals(Watch other)
{
if (ReferenceEquals(other, null))
if (other is null)
{
return false;
}
Expand All @@ -342,7 +342,7 @@ public bool Equals(Watch other)
/// <returns>True if both object are equals; otherwise, false</returns>
public bool Equals(Cheat other)
{
return !ReferenceEquals(other, null)
return other is not null
&& _domain == other.Domain
&& Address == other.Address
&& Size == other.Size;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ private class WatchEqualityComparer : IEqualityComparer<Watch>
/// <returns>True if <see cref="Watch"/> are equal; otherwise, false</returns>
public bool Equals(Watch x, Watch y)
{
if (ReferenceEquals(x, null))
if (x is null)
{
return ReferenceEquals(y, null);
return y is null;
}

if (ReferenceEquals(y, null))
if (y is null)
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override int GetHashCode()

public static bool operator ==(Cell a, Cell b)
{
return a?.Equals(b) ?? ReferenceEquals(b, null);
return a?.Equals(b) ?? b is null;
}

public static bool operator !=(Cell a, Cell b)
Expand Down
6 changes: 2 additions & 4 deletions src/BizHawk.Common/EndiannessUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ public static void MutatingByteSwap32(Span<byte> a)
fixed (byte* p = &a[0]) for (var i = 0; i < l; i += 4)
{
(p[i + 3], p[i]) = (p[i], p[i + 3]);
var b = p[i + 1];
p[i + 1] = p[i + 2];
p[i + 2] = b;
}
(p[i + 2], p[i + 1]) = (p[i + 1], p[i + 2]);
}
#else
Debug.Assert(a.Length % 4 == 0);
var ints = MemoryMarshal.Cast<byte, uint>(a);
Expand Down
4 changes: 1 addition & 3 deletions src/BizHawk.Emulation.Cores/CPUs/Z80A/Operations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -651,9 +651,7 @@ public void ADDS_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
public void EXCH_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
{
(Regs[src_l], Regs[dest_l]) = (Regs[dest_l], Regs[src_l]);
var temp = Regs[dest_h];
Regs[dest_h] = Regs[src_h];
Regs[src_h] = temp;
(Regs[src_h], Regs[dest_h]) = (Regs[dest_h], Regs[src_h]);
}

public void SBC_16_Func(ushort dest_l, ushort dest_h, ushort src_l, ushort src_h)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ private long CurrentCPUCycle
}
#pragma warning restore IDE0051

/// <summary>
/// The last CPU cycle when the FDC accepted an IO read/write
/// </summary>
private long LastCPUCycle;
/// <summary>
/// The last CPU cycle when the FDC accepted an IO read/write
/// </summary>
private long LastCPUCycle;

/// <summary>
/// The current delay figure (in Z80 t-states)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ private struct CommStruct

//utilities
//TODO: make internal, wrap on the API instead of the comm
public string GetAscii() => _getAscii(str);
public readonly string GetAscii() => _getAscii(str);
public readonly bool GetBool() { return value != 0; }

private readonly string _getAscii(sbyte* ptr)
Expand Down
4 changes: 2 additions & 2 deletions src/BizHawk.Emulation.DiscSystem/DiscSubQ.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public struct SubchannelQ
/// Retrieves the initial set of timestamps (min,sec,frac) as a convenient Timestamp
/// </summary>
public int Timestamp {
get => MSF.ToInt(min.DecimalValue, sec.DecimalValue, frame.DecimalValue);
readonly get => MSF.ToInt(min.DecimalValue, sec.DecimalValue, frame.DecimalValue);
set {
var ts = new Timestamp(value);
min.DecimalValue = ts.MIN; sec.DecimalValue = ts.SEC; frame.DecimalValue = ts.FRAC;
Expand All @@ -103,7 +103,7 @@ public int Timestamp {
/// TODO - rename everything AP here, it's nonsense. (the P is)
/// </summary>
public int AP_Timestamp {
get => MSF.ToInt(ap_min.DecimalValue, ap_sec.DecimalValue, ap_frame.DecimalValue);
readonly get => MSF.ToInt(ap_min.DecimalValue, ap_sec.DecimalValue, ap_frame.DecimalValue);
set {
var ts = new Timestamp(value);
ap_min.DecimalValue = ts.MIN; ap_sec.DecimalValue = ts.SEC; ap_frame.DecimalValue = ts.FRAC;
Expand Down
2 changes: 1 addition & 1 deletion src/BizHawk.Emulation.DiscSystem/DiscTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public readonly bool Equals(BCD2 other)
return BCDValue == other.BCDValue;
}

public override bool Equals(object obj)
public override readonly bool Equals(object obj)
{
return obj is BCD2 other && Equals(other);
}
Expand Down

0 comments on commit 0808bed

Please sign in to comment.