Added more SkipLocalsInit

This commit is contained in:
Darth Affe 2024-07-06 19:38:34 +02:00
parent 822d9fa6f1
commit 3ccb62538d
13 changed files with 37 additions and 5 deletions

View File

@ -30,6 +30,7 @@ internal class Colors : IGeneratorFeature
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -44,6 +45,7 @@ internal class Colors : IGeneratorFeature
/// <param name="{{colorFormat.SecondEntry}}">The {{colorFormat.SecondEntryName}}-component of the color.</param>
/// <param name="{{colorFormat.ThirdEntry}}">The {{colorFormat.ThirdEntryName}}-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct {{colorFormat.TypeName}}(byte {{colorFormat.FirstEntry}}, byte {{colorFormat.SecondEntry}}, byte {{colorFormat.ThirdEntry}}): IColor
{
@ -89,6 +91,7 @@ internal class Colors : IGeneratorFeature
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -104,6 +107,7 @@ internal class Colors : IGeneratorFeature
/// <param name="{{colorFormat.ThirdEntry}}">The {{colorFormat.ThirdEntryName}}-component of the color.</param>
/// <param name="{{colorFormat.FourthEntry}}">The {{colorFormat.FourthEntryName}}-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct {{colorFormat.TypeName}}(byte {{colorFormat.FirstEntry}}, byte {{colorFormat.SecondEntry}}, byte {{colorFormat.ThirdEntry}}, byte {{colorFormat.FourthEntry}}) : IColor
{

View File

@ -1,5 +1,8 @@
namespace HPPH;
using System.Runtime.CompilerServices;
namespace HPPH;
[SkipLocalsInit]
internal readonly struct Generic3ByteData(byte b1, byte b2, byte b3)
{
public readonly byte B1 = b1;

View File

@ -1,5 +1,8 @@
namespace HPPH;
using System.Runtime.CompilerServices;
namespace HPPH;
[SkipLocalsInit]
internal readonly struct Generic3ByteMinMax(byte b1Min, byte b1Max, byte b2Min, byte b2Max, byte b3Min, byte b3Max)
{
public readonly byte B1Min = b1Min;

View File

@ -1,5 +1,8 @@
namespace HPPH;
using System.Runtime.CompilerServices;
namespace HPPH;
[SkipLocalsInit]
internal readonly struct Generic4ByteData(byte b1, byte b2, byte b3, byte b4)
{
public readonly byte B1 = b1;

View File

@ -1,5 +1,8 @@
namespace HPPH;
using System.Runtime.CompilerServices;
namespace HPPH;
[SkipLocalsInit]
internal readonly struct Generic4ByteMinMax(byte b1Min, byte b1Max, byte b2Min, byte b2Max, byte b3Min, byte b3Max, byte b4Min, byte b4Max)
{
public readonly byte B1Min = b1Min;

View File

@ -1,5 +1,8 @@
namespace HPPH;
using System.Runtime.CompilerServices;
namespace HPPH;
[SkipLocalsInit]
internal readonly struct Generic4LongData(long l1, long l2, long l3, long l4)
{
public readonly long L1 = l1;

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -18,6 +19,7 @@ namespace HPPH;
/// <param name="g">The Green-component of the color.</param>
/// <param name="r">The Red-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorABGR(byte a, byte b, byte g, byte r) : IColor
{

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -18,6 +19,7 @@ namespace HPPH;
/// <param name="g">The Green-component of the color.</param>
/// <param name="b">The Blue-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorARGB(byte a, byte r, byte g, byte b) : IColor
{

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -17,6 +18,7 @@ namespace HPPH;
/// <param name="g">The Green-component of the color.</param>
/// <param name="r">The Red-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorBGR(byte b, byte g, byte r): IColor
{

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -18,6 +19,7 @@ namespace HPPH;
/// <param name="r">The Red-component of the color.</param>
/// <param name="a">The Alpha-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorBGRA(byte b, byte g, byte r, byte a) : IColor
{

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -17,6 +18,7 @@ namespace HPPH;
/// <param name="g">The Green-component of the color.</param>
/// <param name="b">The Blue-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorRGB(byte r, byte g, byte b): IColor
{

View File

@ -3,6 +3,7 @@
// ReSharper disable ReplaceWithPrimaryConstructorParameter
using System.Diagnostics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace HPPH;
@ -18,6 +19,7 @@ namespace HPPH;
/// <param name="b">The Blue-component of the color.</param>
/// <param name="a">The Alpha-component of the color.</param>
[DebuggerDisplay("[A: {A}, R: {R}, G: {G}, B: {B}]")]
[SkipLocalsInit]
[StructLayout(LayoutKind.Sequential)]
public readonly partial struct ColorRGBA(byte r, byte g, byte b, byte a) : IColor
{

View File

@ -5,6 +5,7 @@ using System.Runtime.InteropServices;
namespace HPPH;
/// <inheritdoc />
[SkipLocalsInit]
public sealed class Image<TColor> : IImage
where TColor : struct, IColor
{