From: Jan Kotas Date: Mon, 1 May 2017 05:52:25 +0000 (-0700) Subject: Rename internal field of primitive type structs and make it private (dotnet/coreclr... X-Git-Tag: submit/tizen/20210909.063632~11030^2~7067 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4cb6c8199f9b7adef0228e90d759c4b41f6084dc;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Rename internal field of primitive type structs and make it private (dotnet/coreclr#11312) Reduce diffs with CoreRT and conform to coding conventions Commit migrated from https://github.com/dotnet/coreclr/commit/0310a1e18c3322b0f1e582583f6597094e6da1cb --- diff --git a/src/coreclr/src/mscorlib/shared/System/Char.cs b/src/coreclr/src/mscorlib/shared/System/Char.cs index 2b3133a..cb2a512 100644 --- a/src/coreclr/src/mscorlib/shared/System/Char.cs +++ b/src/coreclr/src/mscorlib/shared/System/Char.cs @@ -26,7 +26,7 @@ namespace System // // Member Variables // - internal char m_value; + private char _value; // // Public Constants @@ -102,7 +102,7 @@ namespace System // Calculate a hashcode for a 2 byte Unicode character. public override int GetHashCode() { - return (int)m_value | ((int)m_value << 16); + return (int)_value | ((int)_value << 16); } // Used for comparing two boxed Char objects. @@ -113,13 +113,13 @@ namespace System { return false; } - return (m_value == ((Char)obj).m_value); + return (_value == ((Char)obj)._value); } [System.Runtime.Versioning.NonVersionable] public bool Equals(Char obj) { - return m_value == obj; + return _value == obj; } // Compares this object to another object, returning an integer that @@ -140,13 +140,13 @@ namespace System throw new ArgumentException(SR.Arg_MustBeChar); } - return (m_value - ((Char)value).m_value); + return (_value - ((Char)value)._value); } [Pure] public int CompareTo(Char value) { - return (m_value - value); + return (_value - value); } // Overrides System.Object.ToString. @@ -154,14 +154,14 @@ namespace System public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Char.ToString(m_value); + return Char.ToString(_value); } [Pure] public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Char.ToString(m_value); + return Char.ToString(_value); } // @@ -477,47 +477,47 @@ namespace System char IConvertible.ToChar(IFormatProvider provider) { - return m_value; + return _value; } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Boolean.cs b/src/coreclr/src/mscorlib/src/System/Boolean.cs index fe25e22..dda1427 100644 --- a/src/coreclr/src/mscorlib/src/System/Boolean.cs +++ b/src/coreclr/src/mscorlib/src/System/Boolean.cs @@ -26,7 +26,7 @@ namespace System // // Member Variables // - private bool m_value; + private bool _value; // The true value. // @@ -74,7 +74,7 @@ namespace System // Provides a hash code for this instance. public override int GetHashCode() { - return (m_value) ? True : False; + return (_value) ? True : False; } /*===================================ToString=================================== @@ -85,7 +85,7 @@ namespace System // Converts the boolean value of this instance to a String. public override String ToString() { - if (false == m_value) + if (false == _value) { return FalseLiteral; } @@ -94,7 +94,7 @@ namespace System public String ToString(IFormatProvider provider) { - if (false == m_value) + if (false == _value) { return FalseLiteral; } @@ -110,13 +110,13 @@ namespace System return false; } - return (m_value == ((Boolean)obj).m_value); + return (_value == ((Boolean)obj)._value); } [System.Runtime.Versioning.NonVersionable] public bool Equals(Boolean obj) { - return m_value == obj; + return _value == obj; } // Compares this object to another object, returning an integer that @@ -137,11 +137,11 @@ namespace System throw new ArgumentException(SR.Arg_MustBeBoolean); } - if (m_value == ((Boolean)obj).m_value) + if (_value == ((Boolean)obj)._value) { return 0; } - else if (m_value == false) + else if (_value == false) { return -1; } @@ -150,11 +150,11 @@ namespace System public int CompareTo(Boolean value) { - if (m_value == value) + if (_value == value) { return 0; } - else if (m_value == false) + else if (_value == false) { return -1; } @@ -261,7 +261,7 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return m_value; + return _value; } char IConvertible.ToChar(IFormatProvider provider) @@ -271,57 +271,57 @@ namespace System sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Byte.cs b/src/coreclr/src/mscorlib/src/System/Byte.cs index 27fdcd7..187e966 100644 --- a/src/coreclr/src/mscorlib/src/System/Byte.cs +++ b/src/coreclr/src/mscorlib/src/System/Byte.cs @@ -28,7 +28,7 @@ namespace System public struct Byte : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - private byte m_value; + private byte _value; // The maximum value that a Byte may represent: 255. public const byte MaxValue = (byte)0xFF; @@ -54,12 +54,12 @@ namespace System throw new ArgumentException(SR.Arg_MustBeByte); } - return m_value - (((Byte)value).m_value); + return _value - (((Byte)value)._value); } public int CompareTo(Byte value) { - return m_value - value; + return _value - value; } // Determines whether two Byte objects are equal. @@ -69,19 +69,19 @@ namespace System { return false; } - return m_value == ((Byte)obj).m_value; + return _value == ((Byte)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(Byte obj) { - return m_value == obj; + return _value == obj; } // Gets a hash code for this instance. public override int GetHashCode() { - return m_value; + return _value; } [Pure] @@ -161,28 +161,28 @@ namespace System public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo); } [Pure] public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, format, NumberFormatInfo.CurrentInfo); } [Pure] public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } [Pure] public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider)); } // @@ -197,67 +197,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return m_value; + return _value; } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Double.cs b/src/coreclr/src/mscorlib/src/System/Double.cs index f2c5cec..00a401b 100644 --- a/src/coreclr/src/mscorlib/src/System/Double.cs +++ b/src/coreclr/src/mscorlib/src/System/Double.cs @@ -26,7 +26,7 @@ namespace System public struct Double : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - internal double m_value; + private double _value; // // Public Constants @@ -110,12 +110,12 @@ namespace System if (value is Double) { double d = (double)value; - if (m_value < d) return -1; - if (m_value > d) return 1; - if (m_value == d) return 0; + if (_value < d) return -1; + if (_value > d) return 1; + if (_value == d) return 0; // At least one of the values is NaN. - if (IsNaN(m_value)) + if (IsNaN(_value)) return (IsNaN(d) ? 0 : -1); else return 1; @@ -125,12 +125,12 @@ namespace System public int CompareTo(Double value) { - if (m_value < value) return -1; - if (m_value > value) return 1; - if (m_value == value) return 0; + if (_value < value) return -1; + if (_value > value) return 1; + if (_value == value) return 0; // At least one of the values is NaN. - if (IsNaN(m_value)) + if (IsNaN(_value)) return (IsNaN(value) ? 0 : -1); else return 1; @@ -144,13 +144,13 @@ namespace System { return false; } - double temp = ((Double)obj).m_value; + double temp = ((Double)obj)._value; // This code below is written this way for performance reasons i.e the != and == check is intentional. - if (temp == m_value) + if (temp == _value) { return true; } - return IsNaN(temp) && IsNaN(m_value); + return IsNaN(temp) && IsNaN(_value); } [System.Runtime.Versioning.NonVersionable] @@ -191,11 +191,11 @@ namespace System public bool Equals(Double obj) { - if (obj == m_value) + if (obj == _value) { return true; } - return IsNaN(obj) && IsNaN(m_value); + return IsNaN(obj) && IsNaN(_value); } //The hashcode for a double is the absolute value of the integer representation @@ -203,7 +203,7 @@ namespace System // public unsafe override int GetHashCode() { - double d = m_value; + double d = _value; if (d == 0) { // Ensure that 0 and -0 have the same hash code @@ -216,25 +216,25 @@ namespace System public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatDouble(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatDouble(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatDouble(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatDouble(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatDouble(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatDouble(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatDouble(_value, format, NumberFormatInfo.GetInstance(provider)); } public static double Parse(String s) @@ -323,7 +323,7 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) @@ -333,57 +333,57 @@ namespace System sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return m_value; + return _value; } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Int16.cs b/src/coreclr/src/mscorlib/src/System/Int16.cs index 69f71af..4fc9e6b 100644 --- a/src/coreclr/src/mscorlib/src/System/Int16.cs +++ b/src/coreclr/src/mscorlib/src/System/Int16.cs @@ -25,7 +25,7 @@ namespace System public struct Int16 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - internal short m_value; + private short _value; public const short MaxValue = (short)0x7FFF; public const short MinValue = unchecked((short)0x8000); @@ -45,7 +45,7 @@ namespace System if (value is Int16) { - return m_value - ((Int16)value).m_value; + return _value - ((Int16)value)._value; } throw new ArgumentException(SR.Arg_MustBeInt16); @@ -53,7 +53,7 @@ namespace System public int CompareTo(Int16 value) { - return m_value - value; + return _value - value; } public override bool Equals(Object obj) @@ -62,32 +62,32 @@ namespace System { return false; } - return m_value == ((Int16)obj).m_value; + return _value == ((Int16)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(Int16 obj) { - return m_value == obj; + return _value == obj; } // Returns a HashCode for the Int16 public override int GetHashCode() { - return ((int)((ushort)m_value) | (((int)m_value) << 16)); + return ((int)((ushort)_value) | (((int)_value) << 16)); } public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) @@ -106,12 +106,12 @@ namespace System { Contract.Ensures(Contract.Result() != null); - if (m_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x')) + if (_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x')) { - uint temp = (uint)(m_value & 0x0000FFFF); + uint temp = (uint)(_value & 0x0000FFFF); return Number.FormatUInt32(temp, format, info); } - return Number.FormatInt32(m_value, format, info); + return Number.FormatInt32(_value, format, info); } public static short Parse(String s) @@ -215,67 +215,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return m_value; + return _value; } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Int32.cs b/src/coreclr/src/mscorlib/src/System/Int32.cs index 90b70a9..05b02a7 100644 --- a/src/coreclr/src/mscorlib/src/System/Int32.cs +++ b/src/coreclr/src/mscorlib/src/System/Int32.cs @@ -25,7 +25,7 @@ namespace System public struct Int32 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - internal int m_value; + private int _value; public const int MaxValue = 0x7fffffff; public const int MinValue = unchecked((int)0x80000000); @@ -47,8 +47,8 @@ namespace System // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. int i = (int)value; - if (m_value < i) return -1; - if (m_value > i) return 1; + if (_value < i) return -1; + if (_value > i) return 1; return 0; } throw new ArgumentException(SR.Arg_MustBeInt32); @@ -58,8 +58,8 @@ namespace System { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. - if (m_value < value) return -1; - if (m_value > value) return 1; + if (_value < value) return -1; + if (_value > value) return 1; return 0; } @@ -69,47 +69,47 @@ namespace System { return false; } - return m_value == ((Int32)obj).m_value; + return _value == ((Int32)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(Int32 obj) { - return m_value == obj; + return _value == obj; } // The absolute value of the int contained. public override int GetHashCode() { - return m_value; + return _value; } [Pure] public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo); } [Pure] public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, format, NumberFormatInfo.CurrentInfo); } [Pure] public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } [Pure] public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider)); } [Pure] @@ -177,67 +177,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return m_value; + return _value; } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Int64.cs b/src/coreclr/src/mscorlib/src/System/Int64.cs index 3d64362..045c212 100644 --- a/src/coreclr/src/mscorlib/src/System/Int64.cs +++ b/src/coreclr/src/mscorlib/src/System/Int64.cs @@ -24,7 +24,7 @@ namespace System public struct Int64 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - internal long m_value; + private long _value; public const long MaxValue = 0x7fffffffffffffffL; public const long MinValue = unchecked((long)0x8000000000000000L); @@ -46,8 +46,8 @@ namespace System // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. long i = (long)value; - if (m_value < i) return -1; - if (m_value > i) return 1; + if (_value < i) return -1; + if (_value > i) return 1; return 0; } throw new ArgumentException(SR.Arg_MustBeInt64); @@ -57,8 +57,8 @@ namespace System { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. - if (m_value < value) return -1; - if (m_value > value) return 1; + if (_value < value) return -1; + if (_value > value) return 1; return 0; } @@ -68,43 +68,43 @@ namespace System { return false; } - return m_value == ((Int64)obj).m_value; + return _value == ((Int64)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(Int64 obj) { - return m_value == obj; + return _value == obj; } // The value of the lower 32 bits XORed with the uppper 32 bits. public override int GetHashCode() { - return (unchecked((int)((long)m_value)) ^ (int)(m_value >> 32)); + return (unchecked((int)((long)_value)) ^ (int)(_value >> 32)); } public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt64(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatInt64(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt64(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt64(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt64(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatInt64(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt64(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt64(_value, format, NumberFormatInfo.GetInstance(provider)); } public static long Parse(String s) @@ -156,67 +156,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return m_value; + return _value; } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/IntPtr.cs b/src/coreclr/src/mscorlib/src/System/IntPtr.cs index 28f1b1b..55c86e3 100644 --- a/src/coreclr/src/mscorlib/src/System/IntPtr.cs +++ b/src/coreclr/src/mscorlib/src/System/IntPtr.cs @@ -25,7 +25,7 @@ namespace System [Serializable] public struct IntPtr : IEquatable, ISerializable { - unsafe private void* m_value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior + unsafe private void* _value; // The compiler treats void* closest to uint hence explicit casts are required to preserve int behavior public static readonly IntPtr Zero; @@ -33,16 +33,16 @@ namespace System [Pure] internal unsafe bool IsNull() { - return (m_value == null); + return (_value == null); } [System.Runtime.Versioning.NonVersionable] public unsafe IntPtr(int value) { #if BIT64 - m_value = (void*)(long)value; + _value = (void*)(long)value; #else // !BIT64 (32) - m_value = (void *)value; + _value = (void *)value; #endif } @@ -50,9 +50,9 @@ namespace System public unsafe IntPtr(long value) { #if BIT64 - m_value = (void*)value; + _value = (void*)value; #else // !BIT64 (32) - m_value = (void *)checked((int)value); + _value = (void *)checked((int)value); #endif } @@ -60,7 +60,7 @@ namespace System [System.Runtime.Versioning.NonVersionable] public unsafe IntPtr(void* value) { - m_value = value; + _value = value; } private unsafe IntPtr(SerializationInfo info, StreamingContext context) @@ -72,7 +72,7 @@ namespace System throw new ArgumentException(SR.Serialization_InvalidPtrValue); } - m_value = (void*)l; + _value = (void*)l; } unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) @@ -83,9 +83,9 @@ namespace System } Contract.EndContractBlock(); #if BIT64 - info.AddValue("value", (long)(m_value)); + info.AddValue("value", (long)(_value)); #else // !BIT64 (32) - info.AddValue("value", (long)((int)m_value)); + info.AddValue("value", (long)((int)_value)); #endif } @@ -93,23 +93,23 @@ namespace System { if (obj is IntPtr) { - return (m_value == ((IntPtr)obj).m_value); + return (_value == ((IntPtr)obj)._value); } return false; } unsafe bool IEquatable.Equals(IntPtr other) { - return m_value == other.m_value; + return _value == other._value; } public unsafe override int GetHashCode() { #if BIT64 - long l = (long)m_value; + long l = (long)_value; return (unchecked((int)l) ^ (int)(l >> 32)); #else // !BIT64 (32) - return unchecked((int)m_value); + return unchecked((int)_value); #endif } @@ -117,10 +117,10 @@ namespace System public unsafe int ToInt32() { #if BIT64 - long l = (long)m_value; + long l = (long)_value; return checked((int)l); #else // !BIT64 (32) - return (int)m_value; + return (int)_value; #endif } @@ -128,18 +128,18 @@ namespace System public unsafe long ToInt64() { #if BIT64 - return (long)m_value; + return (long)_value; #else // !BIT64 (32) - return (long)(int)m_value; + return (long)(int)_value; #endif } public unsafe override String ToString() { #if BIT64 - return ((long)m_value).ToString(CultureInfo.InvariantCulture); + return ((long)_value).ToString(CultureInfo.InvariantCulture); #else // !BIT64 (32) - return ((int)m_value).ToString(CultureInfo.InvariantCulture); + return ((int)_value).ToString(CultureInfo.InvariantCulture); #endif } @@ -148,9 +148,9 @@ namespace System Contract.Ensures(Contract.Result() != null); #if BIT64 - return ((long)m_value).ToString(format, CultureInfo.InvariantCulture); + return ((long)_value).ToString(format, CultureInfo.InvariantCulture); #else // !BIT64 (32) - return ((int)m_value).ToString(format, CultureInfo.InvariantCulture); + return ((int)_value).ToString(format, CultureInfo.InvariantCulture); #endif } @@ -178,17 +178,17 @@ namespace System [System.Runtime.Versioning.NonVersionable] public static unsafe explicit operator void* (IntPtr value) { - return value.m_value; + return value._value; } [System.Runtime.Versioning.NonVersionable] public unsafe static explicit operator int(IntPtr value) { #if BIT64 - long l = (long)value.m_value; + long l = (long)value._value; return checked((int)l); #else // !BIT64 (32) - return (int)value.m_value; + return (int)value._value; #endif } @@ -196,22 +196,22 @@ namespace System public unsafe static explicit operator long(IntPtr value) { #if BIT64 - return (long)value.m_value; + return (long)value._value; #else // !BIT64 (32) - return (long)(int)value.m_value; + return (long)(int)value._value; #endif } [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator ==(IntPtr value1, IntPtr value2) { - return value1.m_value == value2.m_value; + return value1._value == value2._value; } [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator !=(IntPtr value1, IntPtr value2) { - return value1.m_value != value2.m_value; + return value1._value != value2._value; } [System.Runtime.Versioning.NonVersionable] @@ -265,7 +265,7 @@ namespace System [System.Runtime.Versioning.NonVersionable] public unsafe void* ToPointer() { - return m_value; + return _value; } } } diff --git a/src/coreclr/src/mscorlib/src/System/SByte.cs b/src/coreclr/src/mscorlib/src/System/SByte.cs index 2f1b2da..ee64e9c 100644 --- a/src/coreclr/src/mscorlib/src/System/SByte.cs +++ b/src/coreclr/src/mscorlib/src/System/SByte.cs @@ -24,7 +24,7 @@ namespace System public struct SByte : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - private sbyte m_value; + private sbyte _value; // The maximum value that a Byte may represent: 127. public const sbyte MaxValue = (sbyte)0x7F; @@ -49,12 +49,12 @@ namespace System { throw new ArgumentException(SR.Arg_MustBeSByte); } - return m_value - ((SByte)obj).m_value; + return _value - ((SByte)obj)._value; } public int CompareTo(SByte value) { - return m_value - value; + return _value - value; } // Determines whether two Byte objects are equal. @@ -64,19 +64,19 @@ namespace System { return false; } - return m_value == ((SByte)obj).m_value; + return _value == ((SByte)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(SByte obj) { - return m_value == obj; + return _value == obj; } // Gets a hash code for this instance. public override int GetHashCode() { - return ((int)m_value ^ (int)m_value << 8); + return ((int)_value ^ (int)_value << 8); } @@ -84,13 +84,13 @@ namespace System public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatInt32(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) @@ -109,12 +109,12 @@ namespace System { Contract.Ensures(Contract.Result() != null); - if (m_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x')) + if (_value < 0 && format != null && format.Length > 0 && (format[0] == 'X' || format[0] == 'x')) { - uint temp = (uint)(m_value & 0x000000FF); + uint temp = (uint)(_value & 0x000000FF); return Number.FormatUInt32(temp, format, info); } - return Number.FormatInt32(m_value, format, info); + return Number.FormatInt32(_value, format, info); } [CLSCompliant(false)] @@ -224,67 +224,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return m_value; + return _value; } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return m_value; + return _value; } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/Single.cs b/src/coreclr/src/mscorlib/src/System/Single.cs index 1c39df7..6041867 100644 --- a/src/coreclr/src/mscorlib/src/System/Single.cs +++ b/src/coreclr/src/mscorlib/src/System/Single.cs @@ -25,7 +25,7 @@ namespace System public struct Single : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - internal float m_value; + private float _value; // // Public constants @@ -88,12 +88,12 @@ namespace System if (value is Single) { float f = (float)value; - if (m_value < f) return -1; - if (m_value > f) return 1; - if (m_value == f) return 0; + if (_value < f) return -1; + if (_value > f) return 1; + if (_value == f) return 0; // At least one of the values is NaN. - if (IsNaN(m_value)) + if (IsNaN(_value)) return (IsNaN(f) ? 0 : -1); else // f is NaN. return 1; @@ -104,12 +104,12 @@ namespace System public int CompareTo(Single value) { - if (m_value < value) return -1; - if (m_value > value) return 1; - if (m_value == value) return 0; + if (_value < value) return -1; + if (_value > value) return 1; + if (_value == value) return 0; // At least one of the values is NaN. - if (IsNaN(m_value)) + if (IsNaN(_value)) return (IsNaN(value) ? 0 : -1); else // f is NaN. return 1; @@ -157,28 +157,28 @@ namespace System { return false; } - float temp = ((Single)obj).m_value; - if (temp == m_value) + float temp = ((Single)obj)._value; + if (temp == _value) { return true; } - return IsNaN(temp) && IsNaN(m_value); + return IsNaN(temp) && IsNaN(_value); } public bool Equals(Single obj) { - if (obj == m_value) + if (obj == _value) { return true; } - return IsNaN(obj) && IsNaN(m_value); + return IsNaN(obj) && IsNaN(_value); } public unsafe override int GetHashCode() { - float f = m_value; + float f = _value; if (f == 0) { // Ensure that 0 and -0 have the same hash code @@ -191,25 +191,25 @@ namespace System public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatSingle(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatSingle(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatSingle(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatSingle(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatSingle(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatSingle(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatSingle(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatSingle(_value, format, NumberFormatInfo.GetInstance(provider)); } // Parses a float from a String in the given style. If @@ -299,7 +299,7 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) @@ -309,57 +309,57 @@ namespace System sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return m_value; + return _value; } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/UInt16.cs b/src/coreclr/src/mscorlib/src/System/UInt16.cs index e4a6837..fcd7ab9 100644 --- a/src/coreclr/src/mscorlib/src/System/UInt16.cs +++ b/src/coreclr/src/mscorlib/src/System/UInt16.cs @@ -24,7 +24,7 @@ namespace System public struct UInt16 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - private ushort m_value; + private ushort _value; public const ushort MaxValue = (ushort)0xFFFF; public const ushort MinValue = 0; @@ -44,14 +44,14 @@ namespace System } if (value is UInt16) { - return ((int)m_value - (int)(((UInt16)value).m_value)); + return ((int)_value - (int)(((UInt16)value)._value)); } throw new ArgumentException(SR.Arg_MustBeUInt16); } public int CompareTo(UInt16 value) { - return ((int)m_value - (int)value); + return ((int)_value - (int)value); } public override bool Equals(Object obj) @@ -60,45 +60,45 @@ namespace System { return false; } - return m_value == ((UInt16)obj).m_value; + return _value == ((UInt16)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(UInt16 obj) { - return m_value == obj; + return _value == obj; } // Returns a HashCode for the UInt16 public override int GetHashCode() { - return (int)m_value; + return (int)_value; } // Converts the current value to a String in base-10 with no extra padding. public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt32(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt32(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider)); } [CLSCompliant(false)] @@ -184,67 +184,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return m_value; + return _value; } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/UInt32.cs b/src/coreclr/src/mscorlib/src/System/UInt32.cs index 7c27efe..83af625 100644 --- a/src/coreclr/src/mscorlib/src/System/UInt32.cs +++ b/src/coreclr/src/mscorlib/src/System/UInt32.cs @@ -26,7 +26,7 @@ namespace System public struct UInt32 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - private uint m_value; + private uint _value; public const uint MaxValue = (uint)0xffffffff; public const uint MinValue = 0U; @@ -49,8 +49,8 @@ namespace System // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. uint i = (uint)value; - if (m_value < i) return -1; - if (m_value > i) return 1; + if (_value < i) return -1; + if (_value > i) return 1; return 0; } throw new ArgumentException(SR.Arg_MustBeUInt32); @@ -60,8 +60,8 @@ namespace System { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. - if (m_value < value) return -1; - if (m_value > value) return 1; + if (_value < value) return -1; + if (_value > value) return 1; return 0; } @@ -71,44 +71,44 @@ namespace System { return false; } - return m_value == ((UInt32)obj).m_value; + return _value == ((UInt32)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(UInt32 obj) { - return m_value == obj; + return _value == obj; } // The absolute value of the int contained. public override int GetHashCode() { - return ((int)m_value); + return ((int)_value); } // The base 10 representation of the number with no extra padding. public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt32(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt32(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt32(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider)); } [CLSCompliant(false)] @@ -162,67 +162,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return m_value; + return _value; } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return Convert.ToUInt64(m_value); + return Convert.ToUInt64(_value); } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/UInt64.cs b/src/coreclr/src/mscorlib/src/System/UInt64.cs index 0b79b6a..d6a1625 100644 --- a/src/coreclr/src/mscorlib/src/System/UInt64.cs +++ b/src/coreclr/src/mscorlib/src/System/UInt64.cs @@ -24,7 +24,7 @@ namespace System public struct UInt64 : IComparable, IFormattable, IConvertible , IComparable, IEquatable { - private ulong m_value; + private ulong _value; public const ulong MaxValue = (ulong)0xffffffffffffffffL; public const ulong MinValue = 0x0; @@ -46,8 +46,8 @@ namespace System // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. ulong i = (ulong)value; - if (m_value < i) return -1; - if (m_value > i) return 1; + if (_value < i) return -1; + if (_value > i) return 1; return 0; } throw new ArgumentException(SR.Arg_MustBeUInt64); @@ -57,8 +57,8 @@ namespace System { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. - if (m_value < value) return -1; - if (m_value > value) return 1; + if (_value < value) return -1; + if (_value > value) return 1; return 0; } @@ -68,43 +68,43 @@ namespace System { return false; } - return m_value == ((UInt64)obj).m_value; + return _value == ((UInt64)obj)._value; } [System.Runtime.Versioning.NonVersionable] public bool Equals(UInt64 obj) { - return m_value == obj; + return _value == obj; } // The value of the lower 32 bits XORed with the uppper 32 bits. public override int GetHashCode() { - return ((int)m_value) ^ (int)(m_value >> 32); + return ((int)_value) ^ (int)(_value >> 32); } public override String ToString() { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt64(m_value, null, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt64(_value, null, NumberFormatInfo.CurrentInfo); } public String ToString(IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt64(m_value, null, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt64(_value, null, NumberFormatInfo.GetInstance(provider)); } public String ToString(String format) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt64(m_value, format, NumberFormatInfo.CurrentInfo); + return Number.FormatUInt64(_value, format, NumberFormatInfo.CurrentInfo); } public String ToString(String format, IFormatProvider provider) { Contract.Ensures(Contract.Result() != null); - return Number.FormatUInt64(m_value, format, NumberFormatInfo.GetInstance(provider)); + return Number.FormatUInt64(_value, format, NumberFormatInfo.GetInstance(provider)); } [CLSCompliant(false)] @@ -157,67 +157,67 @@ namespace System bool IConvertible.ToBoolean(IFormatProvider provider) { - return Convert.ToBoolean(m_value); + return Convert.ToBoolean(_value); } char IConvertible.ToChar(IFormatProvider provider) { - return Convert.ToChar(m_value); + return Convert.ToChar(_value); } sbyte IConvertible.ToSByte(IFormatProvider provider) { - return Convert.ToSByte(m_value); + return Convert.ToSByte(_value); } byte IConvertible.ToByte(IFormatProvider provider) { - return Convert.ToByte(m_value); + return Convert.ToByte(_value); } short IConvertible.ToInt16(IFormatProvider provider) { - return Convert.ToInt16(m_value); + return Convert.ToInt16(_value); } ushort IConvertible.ToUInt16(IFormatProvider provider) { - return Convert.ToUInt16(m_value); + return Convert.ToUInt16(_value); } int IConvertible.ToInt32(IFormatProvider provider) { - return Convert.ToInt32(m_value); + return Convert.ToInt32(_value); } uint IConvertible.ToUInt32(IFormatProvider provider) { - return Convert.ToUInt32(m_value); + return Convert.ToUInt32(_value); } long IConvertible.ToInt64(IFormatProvider provider) { - return Convert.ToInt64(m_value); + return Convert.ToInt64(_value); } ulong IConvertible.ToUInt64(IFormatProvider provider) { - return m_value; + return _value; } float IConvertible.ToSingle(IFormatProvider provider) { - return Convert.ToSingle(m_value); + return Convert.ToSingle(_value); } double IConvertible.ToDouble(IFormatProvider provider) { - return Convert.ToDouble(m_value); + return Convert.ToDouble(_value); } Decimal IConvertible.ToDecimal(IFormatProvider provider) { - return Convert.ToDecimal(m_value); + return Convert.ToDecimal(_value); } DateTime IConvertible.ToDateTime(IFormatProvider provider) diff --git a/src/coreclr/src/mscorlib/src/System/UIntPtr.cs b/src/coreclr/src/mscorlib/src/System/UIntPtr.cs index 09b7e51..08e4942 100644 --- a/src/coreclr/src/mscorlib/src/System/UIntPtr.cs +++ b/src/coreclr/src/mscorlib/src/System/UIntPtr.cs @@ -23,7 +23,7 @@ namespace System [CLSCompliant(false)] public struct UIntPtr : IEquatable, ISerializable { - unsafe private void* m_value; + unsafe private void* _value; public static readonly UIntPtr Zero; @@ -31,16 +31,16 @@ namespace System [System.Runtime.Versioning.NonVersionable] public unsafe UIntPtr(uint value) { - m_value = (void*)value; + _value = (void*)value; } [System.Runtime.Versioning.NonVersionable] public unsafe UIntPtr(ulong value) { #if BIT64 - m_value = (void*)value; + _value = (void*)value; #else // 32 - m_value = (void*)checked((uint)value); + _value = (void*)checked((uint)value); #endif } @@ -48,7 +48,7 @@ namespace System [System.Runtime.Versioning.NonVersionable] public unsafe UIntPtr(void* value) { - m_value = value; + _value = value; } private unsafe UIntPtr(SerializationInfo info, StreamingContext context) @@ -60,7 +60,7 @@ namespace System throw new ArgumentException(SR.Serialization_InvalidPtrValue); } - m_value = (void*)l; + _value = (void*)l; } unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) @@ -70,30 +70,30 @@ namespace System throw new ArgumentNullException(nameof(info)); } Contract.EndContractBlock(); - info.AddValue("value", (ulong)m_value); + info.AddValue("value", (ulong)_value); } public unsafe override bool Equals(Object obj) { if (obj is UIntPtr) { - return (m_value == ((UIntPtr)obj).m_value); + return (_value == ((UIntPtr)obj)._value); } return false; } unsafe bool IEquatable.Equals(UIntPtr other) { - return m_value == other.m_value; + return _value == other._value; } public unsafe override int GetHashCode() { #if BIT64 - ulong l = (ulong)m_value; + ulong l = (ulong)_value; return (unchecked((int)l) ^ (int)(l >> 32)); #else // 32 - return unchecked((int)m_value); + return unchecked((int)_value); #endif } @@ -101,16 +101,16 @@ namespace System public unsafe uint ToUInt32() { #if BIT64 - return checked((uint)m_value); + return checked((uint)_value); #else // 32 - return (uint)m_value; + return (uint)_value; #endif } [System.Runtime.Versioning.NonVersionable] public unsafe ulong ToUInt64() { - return (ulong)m_value; + return (ulong)_value; } public unsafe override String ToString() @@ -118,9 +118,9 @@ namespace System Contract.Ensures(Contract.Result() != null); #if BIT64 - return ((ulong)m_value).ToString(CultureInfo.InvariantCulture); + return ((ulong)_value).ToString(CultureInfo.InvariantCulture); #else // 32 - return ((uint)m_value).ToString(CultureInfo.InvariantCulture); + return ((uint)_value).ToString(CultureInfo.InvariantCulture); #endif } @@ -140,16 +140,16 @@ namespace System public unsafe static explicit operator uint(UIntPtr value) { #if BIT64 - return checked((uint)value.m_value); + return checked((uint)value._value); #else // 32 - return (uint)value.m_value; + return (uint)value._value; #endif } [System.Runtime.Versioning.NonVersionable] public unsafe static explicit operator ulong(UIntPtr value) { - return (ulong)value.m_value; + return (ulong)value._value; } [CLSCompliant(false)] @@ -163,21 +163,21 @@ namespace System [System.Runtime.Versioning.NonVersionable] public static unsafe explicit operator void* (UIntPtr value) { - return value.m_value; + return value._value; } [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator ==(UIntPtr value1, UIntPtr value2) { - return value1.m_value == value2.m_value; + return value1._value == value2._value; } [System.Runtime.Versioning.NonVersionable] public unsafe static bool operator !=(UIntPtr value1, UIntPtr value2) { - return value1.m_value != value2.m_value; + return value1._value != value2._value; } [System.Runtime.Versioning.NonVersionable] @@ -229,7 +229,7 @@ namespace System [System.Runtime.Versioning.NonVersionable] public unsafe void* ToPointer() { - return m_value; + return _value; } } }