Fix more analyzer warnings (mostly missing readonly)

このコミットが含まれているのは:
Sergio Pedri committed 2022-10-22 19:11:38 +02:00
1 親 e96f217af2
コミット 0ff4d41a0a
11ファイル変更
+15 -16

検索条件に一致するファイルはありません

+3 -4
ファイルの表示
@@ -340,8 +340,6 @@ public static unsafe class D2D1PixelShaderEffect
public static ReadOnlyMemory<byte> GetRegistrationBlob<T>(ID2D1TransformMapperFactory<T>? mapperFactory, out Guid effectId)
where T : unmanaged, ID2D1PixelShader
{
effectId = default;
PixelShaderEffect.For<T>.Initialize(mapperFactory);
ArrayPoolBufferWriter<byte> writer = new(ArrayPoolBinaryWriter.DefaultInitialBufferSize);
@@ -514,12 +512,13 @@ public static unsafe class D2D1PixelShaderEffect
// Effect factory
writer.WriteRaw((nint)PixelShaderEffect.For<T>.Factory);
effectId = PixelShaderEffect.For<T>.Id;
byte[] registrationBlob = writer.WrittenSpan.ToArray();
writer.Dispose();
// Extract the effect id (the same that was encoded in the registration blob)
effectId = PixelShaderEffect.For<T>.Id;
return registrationBlob;
}
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal partial struct BOOL : IComparable, IComparable<BOOL>, IEquatable<BOOL>, IFormattable
internal readonly partial struct BOOL : IComparable, IComparable<BOOL>, IEquatable<BOOL>, IFormattable
{
public readonly int Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal unsafe partial struct HANDLE : IComparable, IComparable<HANDLE>, IEquatable<HANDLE>, IFormattable
internal readonly unsafe partial struct HANDLE : IComparable, IComparable<HANDLE>, IEquatable<HANDLE>, IFormattable
{
public readonly void* Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal unsafe partial struct HRESULT : IComparable, IComparable<HRESULT>, IEquatable<HRESULT>, IFormattable
internal readonly unsafe partial struct HRESULT : IComparable, IComparable<HRESULT>, IEquatable<HRESULT>, IFormattable
{
public readonly int Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal unsafe partial struct HWND : IComparable, IComparable<HWND>, IEquatable<HWND>, IFormattable
internal readonly unsafe partial struct HWND : IComparable, IComparable<HWND>, IEquatable<HWND>, IFormattable
{
public readonly void* Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal unsafe partial struct LPARAM : IComparable, IComparable<LPARAM>, IEquatable<LPARAM>, IFormattable
internal readonly unsafe partial struct LPARAM : IComparable, IComparable<LPARAM>, IEquatable<LPARAM>, IFormattable
{
public readonly nint Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal partial struct LRESULT : IComparable, IComparable<LRESULT>, IEquatable<LRESULT>, IFormattable
internal readonly partial struct LRESULT : IComparable, IComparable<LRESULT>, IEquatable<LRESULT>, IFormattable
{
public readonly nint Value;
+1 -1
ファイルの表示
@@ -4,7 +4,7 @@ using System;
namespace TerraFX.Interop.Windows
{
internal unsafe partial struct WPARAM : IComparable, IComparable<WPARAM>, IEquatable<WPARAM>, IFormattable
internal readonly unsafe partial struct WPARAM : IComparable, IComparable<WPARAM>, IEquatable<WPARAM>, IFormattable
{
public readonly nuint Value;
+2 -2
ファイルの表示
@@ -508,7 +508,7 @@ public sealed partial class BokehBlurEffect
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[D2DRequiresScenePosition]
[AutoConstructor]
public partial struct Shader : ID2D1PixelShader
public readonly partial struct Shader : ID2D1PixelShader
{
public readonly int kernelLength;
@@ -557,7 +557,7 @@ public sealed partial class BokehBlurEffect
[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
[D2DRequiresScenePosition]
[AutoConstructor]
public partial struct Shader : ID2D1PixelShader
public readonly partial struct Shader : ID2D1PixelShader
{
public readonly int kernelLength;
private readonly float z;
+2 -2
ファイルの表示
@@ -5,10 +5,10 @@ namespace ComputeSharp.D2D1.Tests.Effects;
[D2DRequiresScenePosition]
[D2DShaderProfile(D2D1ShaderProfile.PixelShader40)]
[AutoConstructor]
public partial struct PixelateEffect : ID2D1PixelShader
public readonly partial struct PixelateEffect : ID2D1PixelShader
{
[AutoConstructor]
public partial struct Constants
public readonly partial struct Constants
{
public readonly int inputWidth;
public readonly int inputHeight;
+1 -1
ファイルの表示
@@ -133,7 +133,7 @@ public partial class DeviceDisposalTests
[EmbeddedBytecode(DispatchAxis.X)]
[AutoConstructor]
private partial struct InitializeShader : IComputeShader
private readonly partial struct InitializeShader : IComputeShader
{
private readonly ReadWriteBuffer<float> buffer;