From 96c4bb23bd51213e58e18b6b189b2e73aefc64ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Thu, 2 Aug 2018 12:27:45 +0100 Subject: [PATCH] Fix warnings for all fields required/used in the native end MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: José Simões --- source/System/AppDomain.cs | 4 ++++ source/System/Boolean.cs | 3 +++ source/System/Byte.cs | 3 +++ source/System/Char.cs | 3 +++ source/System/Double.cs | 3 +++ source/System/Exception.cs | 3 +++ source/System/Int16.cs | 3 +++ source/System/SByte.cs | 3 +++ source/System/Threading/Thread.cs | 3 +++ source/System/Threading/Timer.cs | 3 +++ source/System/UInt16.cs | 3 +++ source/System/UInt32.cs | 3 +++ 12 files changed, 37 insertions(+) diff --git a/source/System/AppDomain.cs b/source/System/AppDomain.cs index 48c4db55..9605cbaa 100644 --- a/source/System/AppDomain.cs +++ b/source/System/AppDomain.cs @@ -15,9 +15,13 @@ namespace System /// public sealed class AppDomain : MarshalByRefObject { + // these fields are required in the native end +#pragma warning disable 0649, 0169 [FieldNoReflection] private object _appDomain; private string _friendlyName; +#pragma warning restore 0649 +#pragma warning restore 0169 private AppDomain() { diff --git a/source/System/Boolean.cs b/source/System/Boolean.cs index 32adfc86..a879e5c6 100644 --- a/source/System/Boolean.cs +++ b/source/System/Boolean.cs @@ -21,7 +21,10 @@ public struct Boolean /// public static readonly string TrueString = "True"; + // this field is required in the native end +#pragma warning disable 0649 private bool _value; +#pragma warning restore 0649 /// /// Converts the value of this instance to its equivalent string representation (either "True" or "False"). diff --git a/source/System/Byte.cs b/source/System/Byte.cs index 1c6aadfe..aff480e8 100644 --- a/source/System/Byte.cs +++ b/source/System/Byte.cs @@ -14,7 +14,10 @@ namespace System [Serializable] public struct Byte { + // this field is required in the native end +#pragma warning disable 0649 private byte _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of a Byte. This field is constant. diff --git a/source/System/Char.cs b/source/System/Char.cs index 7f05e223..8024db8c 100644 --- a/source/System/Char.cs +++ b/source/System/Char.cs @@ -12,7 +12,10 @@ namespace System [Serializable] public struct Char { + // this field is required in the native end +#pragma warning disable 0649 private char _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of a Char. This field is constant. diff --git a/source/System/Double.cs b/source/System/Double.cs index 920a5925..4c9013a5 100644 --- a/source/System/Double.cs +++ b/source/System/Double.cs @@ -15,7 +15,10 @@ namespace System [Serializable] public struct Double { + // this field is required in the native end +#pragma warning disable 0649 internal double _value; +#pragma warning restore 0649 /// /// Represents the smallest possible value of a Double. This field is constant. diff --git a/source/System/Exception.cs b/source/System/Exception.cs index 026096ea..c5732bce 100644 --- a/source/System/Exception.cs +++ b/source/System/Exception.cs @@ -17,7 +17,10 @@ public class Exception private readonly string _message; private readonly Exception _innerException; + // this field is required in the native end +#pragma warning disable 0169 private object _stackTrace; +#pragma warning restore 0169 /// /// Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. diff --git a/source/System/Int16.cs b/source/System/Int16.cs index 46009bf4..8c8848e0 100644 --- a/source/System/Int16.cs +++ b/source/System/Int16.cs @@ -14,7 +14,10 @@ namespace System [Serializable] public struct Int16 { + // this field is required in the native end +#pragma warning disable 0649 internal short _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of an Int16. This field is constant. diff --git a/source/System/SByte.cs b/source/System/SByte.cs index 7ce2e29d..f717e12d 100644 --- a/source/System/SByte.cs +++ b/source/System/SByte.cs @@ -14,7 +14,10 @@ namespace System [Serializable, CLSCompliant(false)] public struct SByte { + // this field is required in the native end +#pragma warning disable 0649 private sbyte _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of SByte. This field is constant. diff --git a/source/System/Threading/Thread.cs b/source/System/Threading/Thread.cs index 809a0a46..94829953 100644 --- a/source/System/Threading/Thread.cs +++ b/source/System/Threading/Thread.cs @@ -14,6 +14,8 @@ namespace System.Threading /// public sealed class Thread { + // these fields are required in the native end +#pragma warning disable 0169 private Delegate _delegate; private int _priority; [Reflection.FieldNoReflection] @@ -21,6 +23,7 @@ public sealed class Thread [Reflection.FieldNoReflection] private object _appDomain; private int _id; +#pragma warning restore 0169 /// /// Initializes a new instance of the Thread class. diff --git a/source/System/Threading/Timer.cs b/source/System/Threading/Timer.cs index 66d8e96f..d8b18f5b 100644 --- a/source/System/Threading/Timer.cs +++ b/source/System/Threading/Timer.cs @@ -20,10 +20,13 @@ namespace System.Threading /// public sealed class Timer : MarshalByRefObject, IDisposable { + // these fields are required in the native end +#pragma warning disable 0169 [Reflection.FieldNoReflection] private object _timer; private object _state; private TimerCallback _callback; +#pragma warning restore 0169 /// /// Initializes a new instance of the Timer class, using a 32-bit signed integer to specify the time interval. diff --git a/source/System/UInt16.cs b/source/System/UInt16.cs index 44091e67..b6dacaa3 100644 --- a/source/System/UInt16.cs +++ b/source/System/UInt16.cs @@ -14,7 +14,10 @@ namespace System [Serializable, CLSCompliant(false)] public struct UInt16 { + // this field is required in the native end +#pragma warning disable 0649 private ushort _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of UInt16. This field is constant. diff --git a/source/System/UInt32.cs b/source/System/UInt32.cs index 360f2e11..d6077516 100644 --- a/source/System/UInt32.cs +++ b/source/System/UInt32.cs @@ -14,7 +14,10 @@ namespace System [Serializable, CLSCompliant(false)] public struct UInt32 { + // this field is required in the native end +#pragma warning disable 0649 private uint _value; +#pragma warning restore 0649 /// /// Represents the largest possible value of UInt32. This field is constant.