Imported Upstream version 5.18.0.142

Former-commit-id: 7467d4b717762eeaf652d77f1486dd11ffb1ff1f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2018-10-09 08:20:59 +00:00
parent e52655b4dc
commit 0abdbe5a7d
1547 changed files with 93792 additions and 47893 deletions

View File

@ -483,6 +483,10 @@ namespace System.Globalization {
return (InternalGetUnicodeCategory(ch)) ;
}
#if MONO
public static UnicodeCategory GetUnicodeCategory(int codePoint) => GetUnicodeCategory((char)codePoint);
#endif
public static UnicodeCategory GetUnicodeCategory(String s, int index)
{
if (s==null)

View File

@ -357,6 +357,22 @@ namespace System {
return ((int)format[pos+1]);
}
#if MONO // internal Span API
internal static int ParseNextChar(ReadOnlySpan<char> format, int pos)
{
return ParseNextChar(new string(format), pos);
}
internal static int ParseQuoteString(ReadOnlySpan<char> format, int pos, StringBuilder result)
{
return ParseQuoteString(new string(format), pos, result);
}
internal static int ParseRepeatPattern(ReadOnlySpan<char> format, int pos, char patternChar)
{
return ParseRepeatPattern(new string(format), pos, patternChar);
}
#endif
//
// IsUseGenitiveForm
//

View File

@ -1 +1 @@
fae16b956da6410c5b95d3b1965eef390dc1cdeb
6151722b5aa7029cf4a52f32ca44fa3dfa3b334b

View File

@ -241,7 +241,9 @@ namespace System.IO {
public virtual decimal ReadDecimal() {
FillBuffer(16);
try {
return Decimal.ToDecimal(m_buffer);
int[] ints = new int[4];
Buffer.BlockCopy(m_buffer, 0, ints, 0, 16);
return new decimal(ints);
}
catch (ArgumentException e) {
// ReadDecimal cannot leak out ArgumentException

View File

@ -559,7 +559,11 @@ namespace System {
public static Decimal Abs(Decimal value)
{
#if MONO
return Decimal.Abs(ref value);
#else
return Decimal.Abs(value);
#endif
}
/*================================MAX=========================================
@ -641,7 +645,11 @@ namespace System {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static Decimal Max(Decimal val1, Decimal val2) {
#if MONO
return Decimal.Max(ref val1, ref val2);
#else
return Decimal.Max(val1,val2);
#endif
}
/*================================MIN=========================================
@ -723,7 +731,7 @@ namespace System {
[ReliabilityContract(Consistency.WillNotCorruptState, Cer.Success)]
public static Decimal Min(Decimal val1, Decimal val2) {
return Decimal.Min(val1,val2);
return Decimal.Min(ref val1, ref val2);
}
/*=====================================Log======================================

View File

@ -1370,8 +1370,8 @@ namespace System.Text
#if MONO
public virtual unsafe int GetChars(ReadOnlySpan<byte> bytes, Span<char> chars)
{
fixed (byte* bytesPtr = &System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes))
fixed (char* charsPtr = &System.Runtime.InteropServices.MemoryMarshal.GetReference(chars))
fixed (byte* bytesPtr = &System.Runtime.InteropServices.MemoryMarshal.GetNonNullPinnableReference(bytes))
fixed (char* charsPtr = &System.Runtime.InteropServices.MemoryMarshal.GetNonNullPinnableReference(chars))
{
return GetChars(bytesPtr, bytes.Length, charsPtr, chars.Length);
}
@ -1379,7 +1379,7 @@ namespace System.Text
public unsafe string GetString(ReadOnlySpan<byte> bytes)
{
fixed (byte* bytesPtr = &bytes.GetPinnableReference())
fixed (byte* bytesPtr = &System.Runtime.InteropServices.MemoryMarshal.GetNonNullPinnableReference(bytes))
{
return GetString(bytesPtr, bytes.Length);
}

View File

@ -148,6 +148,11 @@ namespace System {
throw new InvalidOperationException(SR.InvalidOperation_EnumEnded);
}
internal static void ThrowInvalidOperationException_InvalidOperation_NoValue()
{
throw new InvalidOperationException(SR.InvalidOperation_NoValue);
}
private static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, string resource)
{
return new ArgumentOutOfRangeException(GetArgumentName(argument), resource);
@ -622,6 +627,7 @@ namespace System {
offset,
values,
comparisonType,
s
#endif
}