diff options
Diffstat (limited to 'src/System.Private.CoreLib/shared/System/UInt64.cs')
-rw-r--r-- | src/System.Private.CoreLib/shared/System/UInt64.cs | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/System.Private.CoreLib/shared/System/UInt64.cs b/src/System.Private.CoreLib/shared/System/UInt64.cs index d30fbe1e4..6abd76da2 100644 --- a/src/System.Private.CoreLib/shared/System/UInt64.cs +++ b/src/System.Private.CoreLib/shared/System/UInt64.cs @@ -13,9 +13,9 @@ namespace System [CLSCompliant(false)] [StructLayout(LayoutKind.Sequential)] [TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] - public struct UInt64 : IComparable, IConvertible, IFormattable, IComparable<UInt64>, IEquatable<UInt64>, ISpanFormattable + public readonly struct UInt64 : IComparable, IConvertible, IFormattable, IComparable<ulong>, IEquatable<ulong>, ISpanFormattable { - private ulong m_value; // Do not rename (binary serialization) + private readonly ulong m_value; // Do not rename (binary serialization) public const ulong MaxValue = (ulong)0xffffffffffffffffL; public const ulong MinValue = 0x0; @@ -26,13 +26,13 @@ namespace System // null is considered to be less than any instance. // If object is not of type UInt64, this method throws an ArgumentException. // - public int CompareTo(Object value) + public int CompareTo(object value) { if (value == null) { return 1; } - if (value is UInt64) + if (value is ulong) { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. @@ -44,7 +44,7 @@ namespace System throw new ArgumentException(SR.Arg_MustBeUInt64); } - public int CompareTo(UInt64 value) + public int CompareTo(ulong value) { // Need to use compare because subtraction will wrap // to positive for very large neg numbers, etc. @@ -53,17 +53,17 @@ namespace System return 0; } - public override bool Equals(Object obj) + public override bool Equals(object obj) { - if (!(obj is UInt64)) + if (!(obj is ulong)) { return false; } - return m_value == ((UInt64)obj).m_value; + return m_value == ((ulong)obj).m_value; } [NonVersionable] - public bool Equals(UInt64 obj) + public bool Equals(ulong obj) { return m_value == obj; } @@ -74,22 +74,22 @@ namespace System return ((int)m_value) ^ (int)(m_value >> 32); } - public override String ToString() + public override string ToString() { return Number.FormatUInt64(m_value, null, null); } - public String ToString(IFormatProvider provider) + public string ToString(IFormatProvider provider) { return Number.FormatUInt64(m_value, null, provider); } - public String ToString(String format) + public string ToString(string format) { return Number.FormatUInt64(m_value, format, null); } - public String ToString(String format, IFormatProvider provider) + public string ToString(string format, IFormatProvider provider) { return Number.FormatUInt64(m_value, format, provider); } @@ -100,14 +100,14 @@ namespace System } [CLSCompliant(false)] - public static ulong Parse(String s) + public static ulong Parse(string s) { if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s); return Number.ParseUInt64(s, NumberStyles.Integer, NumberFormatInfo.CurrentInfo); } [CLSCompliant(false)] - public static ulong Parse(String s, NumberStyles style) + public static ulong Parse(string s, NumberStyles style) { NumberFormatInfo.ValidateParseStyleInteger(style); if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s); @@ -122,7 +122,7 @@ namespace System } [CLSCompliant(false)] - public static ulong Parse(String s, NumberStyles style, IFormatProvider provider) + public static ulong Parse(string s, NumberStyles style, IFormatProvider provider) { NumberFormatInfo.ValidateParseStyleInteger(style); if (s == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.s); @@ -137,7 +137,7 @@ namespace System } [CLSCompliant(false)] - public static Boolean TryParse(String s, out UInt64 result) + public static bool TryParse(string s, out ulong result) { if (s == null) { @@ -155,7 +155,7 @@ namespace System } [CLSCompliant(false)] - public static Boolean TryParse(String s, NumberStyles style, IFormatProvider provider, out UInt64 result) + public static bool TryParse(string s, NumberStyles style, IFormatProvider provider, out ulong result) { NumberFormatInfo.ValidateParseStyleInteger(style); @@ -244,7 +244,7 @@ namespace System return Convert.ToDouble(m_value); } - Decimal IConvertible.ToDecimal(IFormatProvider provider) + decimal IConvertible.ToDecimal(IFormatProvider provider) { return Convert.ToDecimal(m_value); } @@ -254,7 +254,7 @@ namespace System throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt64", "DateTime")); } - Object IConvertible.ToType(Type type, IFormatProvider provider) + object IConvertible.ToType(Type type, IFormatProvider provider) { return Convert.DefaultToType((IConvertible)this, type, provider); } |