File: Use-single-argument-BigInteger.Parse-calls.patch

package info (click to toggle)
newtonsoft-json 6.0.8%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 15,976 kB
  • ctags: 10,201
  • sloc: cs: 88,735; xml: 31,774; makefile: 44
file content (52 lines) | stat: -rw-r--r-- 2,055 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
From: Chow Loong Jin <hyperair@debian.org>
Date: Sun, 30 Jun 2013 23:11:36 +0800
Subject: Use single-argument BigInteger.Parse() calls

BigInteger.Parse is supposed to accept two arguments in .NET 4.0, but apparently
only supports one in Mono. This patch reverts to the single-argument call to let
it compile.
---
 Src/Newtonsoft.Json/JsonTextReader.cs         | 4 ++--
 Src/Newtonsoft.Json/Utilities/ConvertUtils.cs | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: newtonsoft-json/Src/Newtonsoft.Json/JsonTextReader.cs
===================================================================
--- newtonsoft-json.orig/Src/Newtonsoft.Json/JsonTextReader.cs
+++ newtonsoft-json/Src/Newtonsoft.Json/JsonTextReader.cs
@@ -1357,7 +1357,7 @@ namespace Newtonsoft.Json
         [MethodImpl(MethodImplOptions.NoInlining)]
         private static object BigIntegerParse(string number, CultureInfo culture)
         {
-            return System.Numerics.BigInteger.Parse(number, culture);
+            return System.Numerics.BigInteger.Parse(number);
         }
 #endif
 
@@ -1668,4 +1668,4 @@ namespace Newtonsoft.Json
             get { return _charPos - _lineStartPos; }
         }
     }
-}
\ No newline at end of file
+}
Index: newtonsoft-json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
===================================================================
--- newtonsoft-json.orig/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
+++ newtonsoft-json/Src/Newtonsoft.Json/Utilities/ConvertUtils.cs
@@ -310,7 +310,7 @@ namespace Newtonsoft.Json.Utilities
             if (value is BigInteger)
                 return (BigInteger)value;
             if (value is string)
-                return BigInteger.Parse((string)value, CultureInfo.InvariantCulture);
+                return BigInteger.Parse((string)value);
             if (value is float)
                 return new BigInteger((float)value);
             if (value is double)
@@ -798,4 +798,4 @@ namespace Newtonsoft.Json.Utilities
 #endif
         }
     }
-}
\ No newline at end of file
+}