Remove unnecessary DebuggerDisplayAttributes

This commit is contained in:
Alex Barney 2021-12-30 20:49:36 -07:00
parent ec38f80066
commit 9a358a4e30
21 changed files with 17 additions and 58 deletions

View file

@ -1,10 +1,8 @@
using System.Diagnostics;
using LibHac.Common.FixedArrays;
using LibHac.Common.FixedArrays;
using LibHac.Util;
namespace LibHac.Bcat;
[DebuggerDisplay("{ToString()}")]
public struct Digest
{
public Array16<byte> Value;

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using LibHac.Common.FixedArrays;
using LibHac.Util;
namespace LibHac.Bcat;
[DebuggerDisplay("{ToString()}")]
public struct DirectoryName
{
private const int MaxSize = 0x20;

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using LibHac.Common.FixedArrays;
using LibHac.Util;
namespace LibHac.Bcat;
[DebuggerDisplay("{ToString()}")]
public struct FileName
{
private const int MaxSize = 0x20;

View file

@ -10,7 +10,6 @@ namespace LibHac.Common;
/// Represents a buffer of 16 bytes.
/// Contains functions that assist with common operations on small buffers.
/// </summary>
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 16)]
public struct Buffer16
{
@ -67,7 +66,6 @@ public struct Buffer16
}
}
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 32)]
public struct Buffer32
{
@ -124,4 +122,4 @@ public struct Buffer32
{
return Bytes.ToHexString();
}
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using LibHac.Util;
@ -8,7 +7,6 @@ namespace LibHac.Common;
/// <summary>
/// A generic 128-bit ID value.
/// </summary>
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct Id128 : IEquatable<Id128>, IComparable<Id128>, IComparable
{
@ -81,4 +79,4 @@ public struct Id128 : IEquatable<Id128>, IComparable<Id128>, IComparable
public static bool operator >(Id128 left, Id128 right) => left.CompareTo(right) > 0;
public static bool operator <=(Id128 left, Id128 right) => left.CompareTo(right) <= 0;
public static bool operator >=(Id128 left, Id128 right) => left.CompareTo(right) >= 0;
}
}

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct Key128 : IEquatable<Key128>
{
@ -42,4 +40,4 @@ public struct Key128 : IEquatable<Key128>
public static bool operator ==(Key128 left, Key128 right) => left.Equals(right);
public static bool operator !=(Key128 left, Key128 right) => !(left == right);
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@ -7,7 +6,6 @@ using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
public readonly ref struct U8Span
{
private readonly ReadOnlySpan<byte> _buffer;
@ -51,7 +49,7 @@ public readonly ref struct U8Span
#if DEBUG
return _buffer[i];
#else
return Unsafe.Add(ref MemoryMarshal.GetReference(_buffer), i);
return Unsafe.Add(ref MemoryMarshal.GetReference(_buffer), i);
#endif
}
@ -99,4 +97,4 @@ public readonly ref struct U8Span
/// <returns><see langword="true"/> if the span has no buffer or begins with a null terminator.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0;
}
}

View file

@ -1,5 +1,4 @@
using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
@ -7,7 +6,6 @@ using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
public readonly ref struct U8SpanMutable
{
private readonly Span<byte> _buffer;
@ -50,7 +48,7 @@ public readonly ref struct U8SpanMutable
#if DEBUG
return _buffer[i];
#else
return Unsafe.Add(ref MemoryMarshal.GetReference(_buffer), i);
return Unsafe.Add(ref MemoryMarshal.GetReference(_buffer), i);
#endif
}
@ -95,4 +93,4 @@ public readonly ref struct U8SpanMutable
/// <returns><see langword="true"/> if the span has no buffer or begins with a null terminator.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer.IsEmpty || MemoryMarshal.GetReference(_buffer) == 0;
}
}

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Text;
using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
public readonly struct U8String
{
private readonly byte[] _buffer;
@ -60,4 +58,4 @@ public readonly struct U8String
/// <returns><see langword="true"/> if the string has no buffer or begins with a null terminator.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0;
}
}

View file

@ -1,14 +1,12 @@
using System;
using System.Buffers;
using System.Buffers.Text;
using System.Diagnostics;
using System.Runtime.CompilerServices;
using LibHac.Diag;
using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
public ref struct U8StringBuilder
{
private const int NullTerminatorLength = 1;

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Text;
using LibHac.Util;
namespace LibHac.Common;
[DebuggerDisplay("{ToString()}")]
public readonly struct U8StringMutable
{
private readonly byte[] _buffer;
@ -67,4 +65,4 @@ public readonly struct U8StringMutable
/// <returns><see langword="true"/> if the string has no buffer or begins with a null terminator.
/// Otherwise, <see langword="false"/>.</returns>
public bool IsEmpty() => _buffer == null || _buffer.Length < 1 || _buffer[0] == 0;
}
}

View file

@ -8,7 +8,6 @@ using LibHac.Util;
namespace LibHac.Crypto;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Explicit, Size = Size)]
public struct AesKey
{
@ -36,7 +35,6 @@ public struct AesKey
#endif
}
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Explicit, Size = Size)]
public struct AesXtsKey
{
@ -64,7 +62,6 @@ public struct AesXtsKey
public readonly override string ToString() => DataRo.ToHexString();
}
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Explicit, Size = Size)]
public struct AesIv
{
@ -91,7 +88,6 @@ public struct AesIv
#endif
}
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Explicit, Size = Size)]
public struct AesCmac
{

View file

@ -1,10 +1,8 @@
using System.Diagnostics;
using LibHac.Common.FixedArrays;
using LibHac.Common.FixedArrays;
using LibHac.Util;
namespace LibHac.Fs;
[DebuggerDisplay("{ToString()}")]
public struct EncryptionSeed
{
public Array16<byte> Value;

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using LibHac.Common;
using LibHac.Common.FixedArrays;
namespace LibHac.Fs;
[DebuggerDisplay("{ToString()}")]
internal struct MountName
{
private Array16<byte> _nameArray;

View file

@ -8,7 +8,6 @@ using LibHac.Util;
namespace LibHac.FsSrv.Sf;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = MaxLength + 1)]
public readonly struct FspPath
{
@ -48,4 +47,4 @@ public readonly struct FspPath
public static implicit operator U8Span(in FspPath value) => new U8Span(SpanHelpers.AsReadOnlyByteSpan(in value));
public override string ToString() => StringUtils.Utf8ZToString(Str);
}
}

View file

@ -8,7 +8,6 @@ using LibHac.Util;
namespace LibHac.FsSystem;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = MaxLength + 1)]
public struct FsPath
{
@ -40,4 +39,4 @@ public struct FsPath
public static implicit operator U8Span(in FsPath value) => new U8Span(SpanHelpers.AsReadOnlyByteSpan(in value));
public override string ToString() => StringUtils.Utf8ZToString(Str);
}
}

View file

@ -8,7 +8,6 @@ using LibHac.Util;
namespace LibHac.Lr;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = PathTool.EntryNameLengthMax)]
public struct Path
{

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using LibHac.Common;
namespace LibHac.Ncm;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct ContentId : IEquatable<ContentId>, IComparable<ContentId>, IComparable
{
@ -50,4 +48,4 @@ public struct ContentId : IEquatable<ContentId>, IComparable<ContentId>, ICompar
public static bool operator >(ContentId left, ContentId right) => left.CompareTo(right) > 0;
public static bool operator <=(ContentId left, ContentId right) => left.CompareTo(right) <= 0;
public static bool operator >=(ContentId left, ContentId right) => left.CompareTo(right) >= 0;
}
}

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using LibHac.Common;
namespace LibHac.Ncm;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct PlaceHolderId : IEquatable<PlaceHolderId>, IComparable<PlaceHolderId>, IComparable
{
@ -50,4 +48,4 @@ public struct PlaceHolderId : IEquatable<PlaceHolderId>, IComparable<PlaceHolder
public static bool operator >(PlaceHolderId left, PlaceHolderId right) => left.CompareTo(right) > 0;
public static bool operator <=(PlaceHolderId left, PlaceHolderId right) => left.CompareTo(right) <= 0;
public static bool operator >=(PlaceHolderId left, PlaceHolderId right) => left.CompareTo(right) >= 0;
}
}

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using LibHac.Common;
using LibHac.Util;
namespace LibHac.Sm;
[DebuggerDisplay("{ToString()}")]
public readonly struct ServiceName : IEquatable<ServiceName>
{
private const int MaxLength = 8;
@ -40,4 +38,4 @@ public readonly struct ServiceName : IEquatable<ServiceName>
ulong name = Name;
return StringUtils.Utf8ZToString(SpanHelpers.AsReadOnlyByteSpan(in name));
}
}
}

View file

@ -1,11 +1,9 @@
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using LibHac.Common;
namespace LibHac.Spl;
[DebuggerDisplay("{ToString()}")]
[StructLayout(LayoutKind.Sequential, Size = 0x10)]
public struct AccessKey : IEquatable<AccessKey>
{
@ -25,4 +23,4 @@ public struct AccessKey : IEquatable<AccessKey>
public override int GetHashCode() => Key.GetHashCode();
public static bool operator ==(AccessKey left, AccessKey right) => left.Equals(right);
public static bool operator !=(AccessKey left, AccessKey right) => !(left == right);
}
}