[corlib] Remove unused code
authorMarek Safar <marek.safar@gmail.com>
Thu, 14 May 2015 06:39:53 +0000 (08:39 +0200)
committerMarek Safar <marek.safar@gmail.com>
Thu, 14 May 2015 06:40:15 +0000 (08:40 +0200)
mcs/class/corlib/System/NumberFormatter.cs

index b15fa539e1e767216e8c24e0ea698cad413bd4dc..a9acde47d6bc9bb457a106750ed2a0ff6d73f019 100644 (file)
@@ -52,10 +52,6 @@ namespace System
 
                const int SingleDefPrecision = 7;
                const int DoubleDefPrecision = 15;
-               const int Int8DefPrecision = 3;
-               const int UInt8DefPrecision = 3;
-               const int Int16DefPrecision = 5;
-               const int UInt16DefPrecision = 5;
                const int Int32DefPrecision = 10;
                const int UInt32DefPrecision = 10;
                const int Int64DefPrecision = 19;
@@ -307,7 +303,7 @@ namespace System
 
                // Parse the given format and initialize the following fields:
                //   _isCustomFormat, _specifierIsUpper, _specifier & _precision.
-               public NumberFormatter (Thread current)
+               NumberFormatter (Thread current)
                {
                        _cbuf = EmptyArray<char>.Value;
                        if (current == null)
@@ -353,8 +349,6 @@ namespace System
                private void InitHex (ulong value)
                {
                        switch (_defPrecision) {
-                               case Int8DefPrecision:  value = (byte) value;    break;
-                               case Int16DefPrecision: value = (ushort) value;  break;
                                case Int32DefPrecision: value = (uint) value;    break;
                        }
                        _val1 = (uint)value;
@@ -580,7 +574,7 @@ namespace System
                        return NumberFormatInfo.GetInstance (fp);
                }
 
-               public CultureInfo CurrentCulture {
+               CultureInfo CurrentCulture {
                        set {
                                if (value != null && value.IsReadOnly)
                                        _nfi = value.NumberFormat;
@@ -787,42 +781,6 @@ namespace System
                                threadNumberFormatter = this;
                }
 
-               public static string NumberToString (string format, sbyte value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       inst.Init (format, value, Int8DefPrecision);
-                       string res = inst.IntegerToString (format, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (string format, byte value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       inst.Init (format, value, UInt8DefPrecision);
-                       string res = inst.IntegerToString (format, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (string format, ushort value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       inst.Init (format, value, Int16DefPrecision);
-                       string res = inst.IntegerToString (format, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (string format, short value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       inst.Init (format, value, UInt16DefPrecision);
-                       string res = inst.IntegerToString (format, fp);
-                       inst.Release();
-                       return res;
-               }
-
                public static string NumberToString (string format, uint value, IFormatProvider fp)
                {
                        NumberFormatter inst = GetInstance (fp);
@@ -910,88 +868,6 @@ namespace System
                        return res;
                }
 
-               public static string NumberToString (uint value, IFormatProvider fp)
-               {
-                       if (value >= HundredMillion)
-                               return NumberToString (null, value, fp);
-
-                       NumberFormatter inst = GetInstance (fp);
-                       string res = inst.FastIntegerToString ((int)value, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (int value, IFormatProvider fp)
-               {
-                       if (value >= HundredMillion || value <= -HundredMillion)
-                               return NumberToString (null, value, fp);
-
-                       NumberFormatter inst = GetInstance (fp);
-                       string res = inst.FastIntegerToString (value, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (ulong value, IFormatProvider fp)
-               {
-                       if (value >= HundredMillion)
-                               return NumberToString (null, value, fp);
-
-                       NumberFormatter inst = GetInstance (fp);
-                       string res = inst.FastIntegerToString ((int)value, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (long value, IFormatProvider fp)
-               {
-                       if (value >= HundredMillion || value <= -HundredMillion)
-                               return NumberToString (null, value, fp);
-
-                       NumberFormatter inst = GetInstance (fp);
-                       string res = inst.FastIntegerToString ((int)value, fp);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (float value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       inst.Init (null, value, SingleDefPrecision);
-                       NumberFormatInfo nfi = inst.GetNumberFormatInstance (fp);
-                       string res;
-                       if (inst._NaN)
-                               res = nfi.NaNSymbol;
-                       else if (inst._infinity)
-                               if (inst._positive)
-                                       res = nfi.PositiveInfinitySymbol;
-                               else
-                                       res = nfi.NegativeInfinitySymbol;
-                       else
-                               res = inst.FormatGeneral (-1, nfi);
-                       inst.Release();
-                       return res;
-               }
-
-               public static string NumberToString (double value, IFormatProvider fp)
-               {
-                       NumberFormatter inst = GetInstance (fp);
-                       NumberFormatInfo nfi = inst.GetNumberFormatInstance (fp);
-                       inst.Init (null, value, DoubleDefPrecision);
-                       string res;
-                       if (inst._NaN)
-                               res = nfi.NaNSymbol;
-                       else if (inst._infinity)
-                               if (inst._positive)
-                                       res = nfi.PositiveInfinitySymbol;
-                               else
-                                       res = nfi.NegativeInfinitySymbol;
-                       else
-                               res = inst.FormatGeneral (-1, nfi);
-                       inst.Release();
-                       return res;
-               }
-
                private string FastIntegerToString (int value, IFormatProvider fp)
                {
                        if (value < 0) {
@@ -1066,7 +942,7 @@ namespace System
                        }
                }
 
-               public string FormatCurrency (int precision, NumberFormatInfo nfi)
+               string FormatCurrency (int precision, NumberFormatInfo nfi)
                {
                        precision = (precision >= 0 ? precision : nfi.CurrencyDecimalDigits);
                        RoundDecimal (precision);
@@ -1236,7 +1112,7 @@ namespace System
                        return new string (_cbuf, 0, _ind);
                }
 
-               public string FormatFixedPoint (int precision, NumberFormatInfo nfi)
+               string FormatFixedPoint (int precision, NumberFormatInfo nfi)
                {
                        if (precision == -1)
                                precision = nfi.NumberDecimalDigits;
@@ -1322,7 +1198,7 @@ namespace System
                        return new string (_cbuf, 0, _ind);
                }
 
-               public string FormatNumber (int precision, NumberFormatInfo nfi)
+               string FormatNumber (int precision, NumberFormatInfo nfi)
                {
                        precision = (precision >= 0 ? precision : nfi.NumberDecimalDigits);
                        ResetCharBuf (IntegerDigits * 3 + precision);
@@ -1368,7 +1244,7 @@ namespace System
                        return new string (_cbuf, 0, _ind);
                }
 
-               public string FormatPercent (int precision, NumberFormatInfo nfi)
+               string FormatPercent (int precision, NumberFormatInfo nfi)
                {
                        precision = (precision >= 0 ? precision : nfi.PercentDecimalDigits);
                        Multiply10(2);
@@ -1427,7 +1303,7 @@ namespace System
                        return new string (_cbuf, 0, _ind);
                }
 
-               public string FormatExponential (int precision, NumberFormatInfo nfi)
+                string FormatExponential (int precision, NumberFormatInfo nfi)
                {
                        if (precision == -1)
                                precision = DefaultExpPrecision;
@@ -1460,7 +1336,7 @@ namespace System
                        return new string (_cbuf, 0, _ind);
                }
 
-               public string FormatCustom (string format, NumberFormatInfo nfi)
+               string FormatCustom (string format, NumberFormatInfo nfi)
                {
                        bool p = _positive;
                        int offset = 0;