Disable another warning on fixed array structs

This commit is contained in:
Alex Barney 2022-01-06 11:12:07 -07:00
parent d412c15387
commit 6cae86eb9c
39 changed files with 69 additions and 69 deletions

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,12 +8,12 @@ public struct Array1<T>
{
public const int Length = 1;
private T _1;
private T _0;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array1<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,6 +8,7 @@ public struct Array11<T>
{
public const int Length = 11;
private T _0;
private T _1;
private T _2;
private T _3;
@ -18,12 +19,11 @@ public struct Array11<T>
private T _8;
private T _9;
private T _10;
private T _11;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array11<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,6 +8,7 @@ public struct Array12<T>
{
public const int Length = 12;
private T _0;
private T _1;
private T _2;
private T _3;
@ -19,12 +20,11 @@ public struct Array12<T>
private T _9;
private T _10;
private T _11;
private T _12;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array12<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,13 +8,13 @@ public struct Array2<T>
{
public const int Length = 2;
private T _0;
private T _1;
private T _2;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array2<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,14 +8,14 @@ public struct Array3<T>
{
public const int Length = 3;
private T _0;
private T _1;
private T _2;
private T _3;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array3<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,15 +8,15 @@ public struct Array4<T>
{
public const int Length = 4;
private T _0;
private T _1;
private T _2;
private T _3;
private T _4;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array4<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,16 +8,16 @@ public struct Array5<T>
{
public const int Length = 5;
private T _0;
private T _1;
private T _2;
private T _3;
private T _4;
private T _5;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array5<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,17 +8,17 @@ public struct Array6<T>
{
public const int Length = 6;
private T _0;
private T _1;
private T _2;
private T _3;
private T _4;
private T _5;
private T _6;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array6<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,18 +8,18 @@ public struct Array7<T>
{
public const int Length = 7;
private T _0;
private T _1;
private T _2;
private T _3;
private T _4;
private T _5;
private T _6;
private T _7;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array7<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
@ -8,6 +8,7 @@ public struct Array8<T>
{
public const int Length = 8;
private T _0;
private T _1;
private T _2;
private T _3;
@ -15,12 +16,11 @@ public struct Array8<T>
private T _5;
private T _6;
private T _7;
private T _8;
public ref T this[int i] => ref Items[i];
public Span<T> Items => SpanHelpers.CreateSpan(ref _1, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _1, Length);
public Span<T> Items => SpanHelpers.CreateSpan(ref _0, Length);
public readonly ReadOnlySpan<T> ItemsRo => SpanHelpers.CreateReadOnlySpan(in _0, Length);
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static implicit operator ReadOnlySpan<T>(in Array8<T> value) => value.ItemsRo;

View file

@ -1,4 +1,4 @@
#pragma warning disable CS0169, IDE0051 // Remove unused private members
#pragma warning disable CS0169, CS0649, IDE0051 // Field is never used, Field is never assigned to, Remove unused private members
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;