//
// Member Variables
//
- internal char m_value;
+ private char _value;
//
// Public Constants
// 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.
{
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
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.
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != null);
- return Char.ToString(m_value);
+ return Char.ToString(_value);
}
[Pure]
public String ToString(IFormatProvider provider)
{
Contract.Ensures(Contract.Result<String>() != null);
- return Char.ToString(m_value);
+ return Char.ToString(_value);
}
//
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)
//
// Member Variables
//
- private bool m_value;
+ private bool _value;
// The true value.
//
// Provides a hash code for this instance.
public override int GetHashCode()
{
- return (m_value) ? True : False;
+ return (_value) ? True : False;
}
/*===================================ToString===================================
// Converts the boolean value of this instance to a String.
public override String ToString()
{
- if (false == m_value)
+ if (false == _value)
{
return FalseLiteral;
}
public String ToString(IFormatProvider provider)
{
- if (false == m_value)
+ if (false == _value)
{
return FalseLiteral;
}
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
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;
}
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;
}
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return m_value;
+ return _value;
}
char IConvertible.ToChar(IFormatProvider provider)
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)
public struct Byte : IComparable, IFormattable, IConvertible
, IComparable<Byte>, IEquatable<Byte>
{
- private byte m_value;
+ private byte _value;
// The maximum value that a Byte may represent: 255.
public const byte MaxValue = (byte)0xFF;
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.
{
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]
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider));
}
//
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)
public struct Double : IComparable, IFormattable, IConvertible
, IComparable<Double>, IEquatable<Double>
{
- internal double m_value;
+ private double _value;
//
// Public Constants
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;
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;
{
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]
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
//
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
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatDouble(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatDouble(_value, format, NumberFormatInfo.GetInstance(provider));
}
public static double Parse(String s)
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(m_value);
+ return Convert.ToBoolean(_value);
}
char IConvertible.ToChar(IFormatProvider provider)
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)
public struct Int16 : IComparable, IFormattable, IConvertible
, IComparable<Int16>, IEquatable<Int16>
{
- internal short m_value;
+ private short _value;
public const short MaxValue = (short)0x7FFF;
public const short MinValue = unchecked((short)0x8000);
if (value is Int16)
{
- return m_value - ((Int16)value).m_value;
+ return _value - ((Int16)value)._value;
}
throw new ArgumentException(SR.Arg_MustBeInt16);
public int CompareTo(Int16 value)
{
- return m_value - value;
+ return _value - value;
}
public override bool Equals(Object obj)
{
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<String>() != 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<String>() != null);
- return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != 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)
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)
public struct Int32 : IComparable, IFormattable, IConvertible
, IComparable<Int32>, IEquatable<Int32>
{
- internal int m_value;
+ private int _value;
public const int MaxValue = 0x7fffffff;
public const int MinValue = unchecked((int)0x80000000);
// 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);
{
// 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;
}
{
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<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(_value, format, NumberFormatInfo.GetInstance(provider));
}
[Pure]
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)
public struct Int64 : IComparable, IFormattable, IConvertible
, IComparable<Int64>, IEquatable<Int64>
{
- internal long m_value;
+ private long _value;
public const long MaxValue = 0x7fffffffffffffffL;
public const long MinValue = unchecked((long)0x8000000000000000L);
// 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);
{
// 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;
}
{
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<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatInt64(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt64(_value, format, NumberFormatInfo.GetInstance(provider));
}
public static long Parse(String s)
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)
[Serializable]
public struct IntPtr : IEquatable<IntPtr>, 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;
[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
}
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
}
[System.Runtime.Versioning.NonVersionable]
public unsafe IntPtr(void* value)
{
- m_value = value;
+ _value = value;
}
private unsafe IntPtr(SerializationInfo info, StreamingContext context)
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
- m_value = (void*)l;
+ _value = (void*)l;
}
unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
}
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
}
{
if (obj is IntPtr)
{
- return (m_value == ((IntPtr)obj).m_value);
+ return (_value == ((IntPtr)obj)._value);
}
return false;
}
unsafe bool IEquatable<IntPtr>.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
}
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
}
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
}
Contract.Ensures(Contract.Result<String>() != 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
}
[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
}
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]
[System.Runtime.Versioning.NonVersionable]
public unsafe void* ToPointer()
{
- return m_value;
+ return _value;
}
}
}
public struct SByte : IComparable, IFormattable, IConvertible
, IComparable<SByte>, IEquatable<SByte>
{
- private sbyte m_value;
+ private sbyte _value;
// The maximum value that a Byte may represent: 127.
public const sbyte MaxValue = (sbyte)0x7F;
{
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.
{
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);
}
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != 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<String>() != null);
- return Number.FormatInt32(m_value, null, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatInt32(_value, null, NumberFormatInfo.GetInstance(provider));
}
public String ToString(String format)
{
Contract.Ensures(Contract.Result<String>() != 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)]
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)
public struct Single : IComparable, IFormattable, IConvertible
, IComparable<Single>, IEquatable<Single>
{
- internal float m_value;
+ private float _value;
//
// Public constants
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;
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;
{
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
public override String ToString()
{
Contract.Ensures(Contract.Result<String>() != 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<String>() != 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<String>() != 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<String>() != 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
bool IConvertible.ToBoolean(IFormatProvider provider)
{
- return Convert.ToBoolean(m_value);
+ return Convert.ToBoolean(_value);
}
char IConvertible.ToChar(IFormatProvider provider)
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)
public struct UInt16 : IComparable, IFormattable, IConvertible
, IComparable<UInt16>, IEquatable<UInt16>
{
- private ushort m_value;
+ private ushort _value;
public const ushort MaxValue = (ushort)0xFFFF;
public const ushort MinValue = 0;
}
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)
{
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<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
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)
public struct UInt32 : IComparable, IFormattable, IConvertible
, IComparable<UInt32>, IEquatable<UInt32>
{
- private uint m_value;
+ private uint _value;
public const uint MaxValue = (uint)0xffffffff;
public const uint MinValue = 0U;
// 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);
{
// 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;
}
{
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<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatUInt32(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt32(_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
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)
public struct UInt64 : IComparable, IFormattable, IConvertible
, IComparable<UInt64>, IEquatable<UInt64>
{
- private ulong m_value;
+ private ulong _value;
public const ulong MaxValue = (ulong)0xffffffffffffffffL;
public const ulong MinValue = 0x0;
// 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);
{
// 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;
}
{
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<String>() != 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<String>() != 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<String>() != 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<String>() != null);
- return Number.FormatUInt64(m_value, format, NumberFormatInfo.GetInstance(provider));
+ return Number.FormatUInt64(_value, format, NumberFormatInfo.GetInstance(provider));
}
[CLSCompliant(false)]
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)
[CLSCompliant(false)]
public struct UIntPtr : IEquatable<UIntPtr>, ISerializable
{
- unsafe private void* m_value;
+ unsafe private void* _value;
public static readonly UIntPtr Zero;
[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
}
[System.Runtime.Versioning.NonVersionable]
public unsafe UIntPtr(void* value)
{
- m_value = value;
+ _value = value;
}
private unsafe UIntPtr(SerializationInfo info, StreamingContext context)
throw new ArgumentException(SR.Serialization_InvalidPtrValue);
}
- m_value = (void*)l;
+ _value = (void*)l;
}
unsafe void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context)
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<UIntPtr>.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
}
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()
Contract.Ensures(Contract.Result<String>() != 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
}
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)]
[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]
[System.Runtime.Versioning.NonVersionable]
public unsafe void* ToPointer()
{
- return m_value;
+ return _value;
}
}
}