From 1fddb020356e982f13195da9dd6dfc34ac2b03f1 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 20 Aug 2019 09:29:48 -0400 Subject: [PATCH] Fix (mostly) StyleCop warning SA1003 (operator symbol spacing) The "mostly" here is that I undid changes where it was forcing formatting around a `: this` or `: base` call for a ctor, in particular where it was moving one up from the next line to be at the end of the current line. Commit migrated from https://github.com/dotnet/coreclr/commit/f3ca042455a4a1cfa3063b68eeeb698a1201d6f4 --- .../Eventing/EventPipeEventDispatcher.cs | 4 +-- .../Diagnostics/Eventing/EventPipeEventProvider.cs | 2 +- .../Eventing/EventPipePayloadDecoder.cs | 8 ++--- .../Diagnostics/Eventing/RuntimeEventSource.cs | 10 +++--- .../Runtime/InteropServices/ComEventsSink.cs | 2 +- .../InteropServices/NativeLibrary.CoreCLR.cs | 2 +- .../src/System/Collections/Generic/Dictionary.cs | 2 +- .../src/System/DateTime.Win32.cs | 2 +- .../src/System/DateTime.Windows.cs | 30 ++++++++--------- .../System/Diagnostics/Tracing/ActivityTracker.cs | 2 +- .../System/Diagnostics/Tracing/EventDescriptor.cs | 2 +- .../src/System/Diagnostics/Tracing/EventSource.cs | 2 +- .../Tracing/TraceLogging/DataCollector.cs | 2 +- .../TraceLogging/TraceLoggingEventSource.cs | 6 ++-- .../src/System/Globalization/CharUnicodeInfo.cs | 4 +-- .../System/Globalization/CompareInfo.Invariant.cs | 6 ++-- .../System/Globalization/CultureData.Windows.cs | 4 +-- .../src/System/Globalization/CultureData.cs | 2 +- .../src/System/Globalization/DateTimeParse.cs | 26 +++++++-------- .../src/System/Globalization/ISOWeek.cs | 2 +- .../src/System/Globalization/IdnMapping.cs | 8 ++--- .../src/System/Globalization/TextInfo.cs | 38 +++++++++++----------- .../src/System/Globalization/TimeSpanParse.cs | 6 ++-- .../src/System/Text/UTF32Encoding.cs | 16 ++++----- .../src/System/Threading/Tasks/Task.cs | 3 +- 25 files changed, 95 insertions(+), 96 deletions(-) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs index db6304f..7553374 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventDispatcher.cs @@ -112,7 +112,7 @@ namespace System.Diagnostics.Tracing // Enable the EventPipe session. EventPipeProviderConfiguration[] providerConfiguration = new EventPipeProviderConfiguration[] { - new EventPipeProviderConfiguration(NativeRuntimeEventSource.EventSourceName, (ulong) aggregatedKeywords, (uint) highestLevel, null) + new EventPipeProviderConfiguration(NativeRuntimeEventSource.EventSourceName, (ulong)aggregatedKeywords, (uint)highestLevel, null) }; m_sessionID = EventPipeInternal.Enable(null, EventPipeSerializationFormat.NetTrace, DefaultEventListenerCircularMBSize, providerConfiguration, 1); @@ -214,7 +214,7 @@ namespace System.Diagnostics.Tracing Debug.Assert((m_syncTimeUtc.Ticks != 0) && (m_syncTimeQPC != 0) && (m_timeQPCFrequency != 0)); long inTicks = (long)((timeStamp - m_syncTimeQPC) * 10000000.0 / m_timeQPCFrequency) + m_syncTimeUtc.Ticks; - if ((inTicks < 0)|| (DateTime.MaxTicks < inTicks)) + if ((inTicks < 0) || (DateTime.MaxTicks < inTicks)) { inTicks = DateTime.MaxTicks; } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs index 2949ef7..83dd95b 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipeEventProvider.cs @@ -68,7 +68,7 @@ namespace System.Diagnostics.Tracing userDataCount -= 3; Debug.Assert(userDataCount >= 0); } - EventPipeInternal.WriteEventData(eventHandle, eventID, userData, (uint) userDataCount, activityId, relatedActivityId); + EventPipeInternal.WriteEventData(eventHandle, eventID, userData, (uint)userDataCount, activityId, relatedActivityId); } return EventProvider.WriteEventErrorCode.NoError; } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs index 4f63807..4eca362 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/EventPipePayloadDecoder.cs @@ -114,11 +114,11 @@ namespace System.Diagnostics.Tracing // NOTE: we do this by hand instead of using IndexOf because payload may be unaligned due to // mixture of different types being stored in the same buffer. (see eventpipe.cpp:CopyData) int byteCount = -1; - for (int j = 1; j < payload.Length; j+=2) + for (int j = 1; j < payload.Length; j += 2) { - if (payload[j-1] == (byte)(0) && payload[j] == (byte)(0)) + if (payload[j - 1] == (byte)(0) && payload[j] == (byte)(0)) { - byteCount = j+1; + byteCount = j + 1; break; } } @@ -131,7 +131,7 @@ namespace System.Diagnostics.Tracing } else { - charPayload = MemoryMarshal.Cast(payload.Slice(0, byteCount-2)); + charPayload = MemoryMarshal.Cast(payload.Slice(0, byteCount - 2)); payload = payload.Slice(byteCount); } decodedFields[i] = BitConverter.IsLittleEndian ? new string(charPayload) : Encoding.Unicode.GetString(MemoryMarshal.Cast(charPayload)); diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs index 4181b41..bb7ffe2 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Diagnostics/Eventing/RuntimeEventSource.cs @@ -63,11 +63,11 @@ namespace System.Diagnostics.Tracing _threadPoolQueueCounter ??= new PollingCounter("threadpool-queue-length", this, () => ThreadPool.PendingWorkItemCount) { DisplayName = "ThreadPool Queue Length" }; _completedItemsCounter ??= new IncrementingPollingCounter("threadpool-completed-items-count", this, () => ThreadPool.CompletedWorkItemCount) { DisplayName = "ThreadPool Completed Work Item Count", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; _gcTimeCounter ??= new PollingCounter("time-in-gc", this, () => GC.GetLastGCPercentTimeInGC()) { DisplayName = "% Time in GC since last GC", DisplayUnits = "%" }; - _gen0SizeCounter ??= new PollingCounter("gen-0-size", this, () => GC.GetGenerationSize(0)) { DisplayName = "Gen 0 Size", DisplayUnits="B" }; - _gen1SizeCounter ??= new PollingCounter("gen-1-size", this, () => GC.GetGenerationSize(1)) { DisplayName = "Gen 1 Size", DisplayUnits="B" }; - _gen2SizeCounter ??= new PollingCounter("gen-2-size", this, () => GC.GetGenerationSize(2)) { DisplayName = "Gen 2 Size", DisplayUnits="B" }; - _lohSizeCounter ??= new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size", DisplayUnits="B" }; - _allocRateCounter ??= new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits="B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; + _gen0SizeCounter ??= new PollingCounter("gen-0-size", this, () => GC.GetGenerationSize(0)) { DisplayName = "Gen 0 Size", DisplayUnits = "B" }; + _gen1SizeCounter ??= new PollingCounter("gen-1-size", this, () => GC.GetGenerationSize(1)) { DisplayName = "Gen 1 Size", DisplayUnits = "B" }; + _gen2SizeCounter ??= new PollingCounter("gen-2-size", this, () => GC.GetGenerationSize(2)) { DisplayName = "Gen 2 Size", DisplayUnits = "B" }; + _lohSizeCounter ??= new PollingCounter("loh-size", this, () => GC.GetGenerationSize(3)) { DisplayName = "LOH Size", DisplayUnits = "B" }; + _allocRateCounter ??= new IncrementingPollingCounter("alloc-rate", this, () => GC.GetTotalAllocatedBytes()) { DisplayName = "Allocation Rate", DisplayUnits = "B", DisplayRateTimeScale = new TimeSpan(0, 0, 1) }; _assemblyCounter ??= new PollingCounter("assembly-count", this, () => System.Reflection.Assembly.GetAssemblyCount()) { DisplayName = "Number of Assemblies Loaded" }; _timerCounter ??= new PollingCounter("active-timer-count", this, () => Timer.ActiveCount) { DisplayName = "Number of Active Timers" }; } diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs index 6c943e1..86b1f1b 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/ComEventsSink.cs @@ -116,7 +116,7 @@ namespace System.Runtime.InteropServices } private const VarEnum VT_BYREF_VARIANT = VarEnum.VT_BYREF | VarEnum.VT_VARIANT; - private const VarEnum VT_TYPEMASK = (VarEnum) 0x0fff; + private const VarEnum VT_TYPEMASK = (VarEnum)0x0fff; private const VarEnum VT_BYREF_TYPEMASK = VT_TYPEMASK | VarEnum.VT_BYREF; private static unsafe ref Variant GetVariant(ref Variant pSrc) diff --git a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs index da23738..112e0c5 100644 --- a/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs +++ b/src/coreclr/src/System.Private.CoreLib/src/System/Runtime/InteropServices/NativeLibrary.CoreCLR.cs @@ -15,7 +15,7 @@ namespace System.Runtime.InteropServices return LoadByName(libraryName, JitHelpers.GetQCallAssemblyOnStack(ref rtAsm), searchPath.HasValue, - (uint) searchPath.GetValueOrDefault(), + (uint)searchPath.GetValueOrDefault(), throwOnError); } diff --git a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs index 0b2fc45..7253577 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Collections/Generic/Dictionary.cs @@ -146,7 +146,7 @@ namespace System.Collections.Generic } public IEqualityComparer Comparer => - (_comparer == null ||_comparer is NonRandomizedStringEqualityComparer) ? + (_comparer == null || _comparer is NonRandomizedStringEqualityComparer) ? EqualityComparer.Default : _comparer; diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.Win32.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.Win32.cs index 2a05437..69bb371 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTime.Win32.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.Win32.cs @@ -12,7 +12,7 @@ namespace System return Interop.NtDll.NtQuerySystemInformation( Interop.NtDll.SystemLeapSecondInformation, - (void *) &slsi, + (void *)&slsi, sizeof(Interop.NtDll.SYSTEM_LEAP_SECOND_INFORMATION), null) == 0 && slsi.Enabled; } diff --git a/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs b/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs index 81ca09d..9a68b2d 100644 --- a/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs +++ b/src/libraries/System.Private.CoreLib/src/System/DateTime.Windows.cs @@ -82,13 +82,13 @@ namespace System internal FullSystemTime(int year, int month, DayOfWeek dayOfWeek, int day, int hour, int minute, int second) { - systemTime.Year = (ushort) year; - systemTime.Month = (ushort) month; - systemTime.DayOfWeek = (ushort) dayOfWeek; - systemTime.Day = (ushort) day; - systemTime.Hour = (ushort) hour; - systemTime.Minute = (ushort) minute; - systemTime.Second = (ushort) second; + systemTime.Year = (ushort)year; + systemTime.Month = (ushort)month; + systemTime.DayOfWeek = (ushort)dayOfWeek; + systemTime.Day = (ushort)day; + systemTime.Hour = (ushort)hour; + systemTime.Minute = (ushort)minute; + systemTime.Second = (ushort)second; systemTime.Milliseconds = 0; hundredNanoSecond = 0; } @@ -100,14 +100,14 @@ namespace System int year, month, day; dt.GetDatePart(out year, out month, out day); - systemTime.Year = (ushort) year; - systemTime.Month = (ushort) month; - systemTime.DayOfWeek = (ushort) dt.DayOfWeek; - systemTime.Day = (ushort) day; - systemTime.Hour = (ushort) dt.Hour; - systemTime.Minute = (ushort) dt.Minute; - systemTime.Second = (ushort) dt.Second; - systemTime.Milliseconds = (ushort) dt.Millisecond; + systemTime.Year = (ushort)year; + systemTime.Month = (ushort)month; + systemTime.DayOfWeek = (ushort)dt.DayOfWeek; + systemTime.Day = (ushort)day; + systemTime.Hour = (ushort)dt.Hour; + systemTime.Minute = (ushort)dt.Minute; + systemTime.Second = (ushort)dt.Second; + systemTime.Milliseconds = (ushort)dt.Millisecond; hundredNanoSecond = 0; } }; diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs index 12553cf..5d45aa4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/ActivityTracker.cs @@ -230,7 +230,7 @@ namespace System.Diagnostics.Tracing m_current = new AsyncLocal(ActivityChanging); } catch (NotImplementedException) { -#if (!ES_BUILD_PCL && ! ES_BUILD_PN) +#if (!ES_BUILD_PCL && !ES_BUILD_PN) // send message to debugger without delay System.Diagnostics.Debugger.Log(0, null, "Activity Enabled() called but AsyncLocals Not Supported (pre V4.6). Ignoring Enable"); #endif diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventDescriptor.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventDescriptor.cs index 9ac2fbf..19ea483 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventDescriptor.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventDescriptor.cs @@ -126,7 +126,7 @@ namespace System.Diagnostics.Tracing if (!(obj is EventDescriptor)) return false; - return Equals((EventDescriptor) obj); + return Equals((EventDescriptor)obj); } public override int GetHashCode() diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs index 8dba3a8..69bde29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/EventSource.cs @@ -5780,7 +5780,7 @@ namespace System.Diagnostics.Tracing if (constantValObj is ulong) hexValue = (ulong)constantValObj; // This is the only integer type that can't be represented by a long. else - hexValue = (ulong) Convert.ToInt64(constantValObj); // Handles all integer types except ulong. + hexValue = (ulong)Convert.ToInt64(constantValObj); // Handles all integer types except ulong. // ETW requires all bitmap values to be powers of 2. Skip the ones that are not. // TODO: Warn people about the dropping of values. diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs index b7222f5..8e9b814 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/DataCollector.cs @@ -349,7 +349,7 @@ namespace System.Diagnostics.Tracing throw new IndexOutOfRangeException(SR.EventSource_DataDescriptorsOutOfRange); } - datasTemp->DataPointer = (IntPtr) this.scratch; + datasTemp->DataPointer = (IntPtr)this.scratch; this.writingScalars = true; } } diff --git a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs index 4eb2864..f20955a 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventSource.cs @@ -714,9 +714,9 @@ namespace System.Diagnostics.Tracing { EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this); eventCallbackArgs.EventName = eventName; - eventCallbackArgs.m_level = (EventLevel) eventDescriptor.Level; - eventCallbackArgs.m_keywords = (EventKeywords) eventDescriptor.Keywords; - eventCallbackArgs.m_opcode = (EventOpcode) eventDescriptor.Opcode; + eventCallbackArgs.m_level = (EventLevel)eventDescriptor.Level; + eventCallbackArgs.m_keywords = (EventKeywords)eventDescriptor.Keywords; + eventCallbackArgs.m_opcode = (EventOpcode)eventDescriptor.Opcode; eventCallbackArgs.m_tags = tags; // Self described events do not have an id attached. We mark it internally with -1. diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CharUnicodeInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CharUnicodeInfo.cs index da7fc88..3df4ffd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CharUnicodeInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CharUnicodeInfo.cs @@ -284,7 +284,7 @@ namespace System.Globalization throw new ArgumentOutOfRangeException(nameof(index)); } - return ((BidiCategory) InternalGetCategoryValue(InternalConvertToUtf32(s, index), BIDI_CATEGORY_OFFSET)); + return ((BidiCategory)InternalGetCategoryValue(InternalConvertToUtf32(s, index), BIDI_CATEGORY_OFFSET)); } internal static BidiCategory GetBidiCategory(StringBuilder s, int index) @@ -292,7 +292,7 @@ namespace System.Globalization Debug.Assert(s != null, "s can not be null"); Debug.Assert(index >= 0 && index < s.Length, "invalid index"); ; - return ((BidiCategory) InternalGetCategoryValue(InternalConvertToUtf32(s, index), BIDI_CATEGORY_OFFSET)); + return ((BidiCategory)InternalGetCategoryValue(InternalConvertToUtf32(s, index), BIDI_CATEGORY_OFFSET)); } /// diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Invariant.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Invariant.cs index d68c4f2..5076466 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Invariant.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.Invariant.cs @@ -231,10 +231,10 @@ namespace System.Globalization { if ((options & (CompareOptions.IgnoreCase | CompareOptions.OrdinalIgnoreCase)) != 0) { - short *pShort = (short *) pByte; - for (int i=0; i 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); n = m; - for (j = iAfterLastDot; j < iNextDot; j+= IsSupplementary(test) ? 2 : 1) + for (j = iAfterLastDot; j < iNextDot; j += IsSupplementary(test) ? 2 : 1) { // Make sure we're aware of surrogates test = char.ConvertToUtf32(unicode, j); @@ -662,7 +662,7 @@ namespace System.Globalization throw new ArgumentException(SR.Argument_IdnBadPunycode, nameof(ascii)); // When appending make sure they get lower cased - output.Append((char)(ascii[copyAscii] >= 'A' && ascii[copyAscii] <='Z' ? ascii[copyAscii] - 'A' + 'a' : ascii[copyAscii])); + output.Append((char)(ascii[copyAscii] >= 'A' && ascii[copyAscii] <= 'Z' ? ascii[copyAscii] - 'A' + 'a' : ascii[copyAscii])); } } @@ -809,8 +809,8 @@ namespace System.Globalization } // Throw if we're too long - if (output.Length > c_defaultNameLimit - (IsDot(output[output.Length-1]) ? 0 : 1)) - throw new ArgumentException(SR.Format(SR.Argument_IdnBadNameSize, c_defaultNameLimit - (IsDot(output[output.Length-1]) ? 0 : 1)), nameof(ascii)); + if (output.Length > c_defaultNameLimit - (IsDot(output[output.Length - 1]) ? 0 : 1)) + throw new ArgumentException(SR.Format(SR.Argument_IdnBadNameSize, c_defaultNameLimit - (IsDot(output[output.Length - 1]) ? 0 : 1)), nameof(ascii)); // Return our output string return output.ToString(); diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs index 29ad0ed..7fe69d6 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TextInfo.cs @@ -649,7 +649,7 @@ namespace System.Globalization { // Special case to check for Dutch specific titlecasing with "IJ" characters // at the beginning of a word - if (isDutchCulture && i < str.Length - 1 && (str[i] == 'i' || str[i] == 'I') && (str[i+1] == 'j' || str[i+1] == 'J')) + if (isDutchCulture && i < str.Length - 1 && (str[i] == 'i' || str[i] == 'I') && (str[i + 1] == 'j' || str[i + 1] == 'J')) { result.Append("IJ"); i += 2; @@ -702,7 +702,7 @@ namespace System.Globalization { // This category is considered to be part of the word. // This is any category that is marked as false in wordSeprator array. - i+= charLen; + i += charLen; } else { @@ -785,25 +785,25 @@ namespace System.Globalization switch (input[inputIndex]) { // For AppCompat, the Titlecase Case Mapping data from NDP 2.0 is used below. - case (char) 0x01C4: // DZ with Caron -> Dz with Caron - case (char) 0x01C5: // Dz with Caron -> Dz with Caron - case (char) 0x01C6: // dz with Caron -> Dz with Caron - result.Append((char) 0x01C5); + case (char)0x01C4: // DZ with Caron -> Dz with Caron + case (char)0x01C5: // Dz with Caron -> Dz with Caron + case (char)0x01C6: // dz with Caron -> Dz with Caron + result.Append((char)0x01C5); break; - case (char) 0x01C7: // LJ -> Lj - case (char) 0x01C8: // Lj -> Lj - case (char) 0x01C9: // lj -> Lj - result.Append((char) 0x01C8); + case (char)0x01C7: // LJ -> Lj + case (char)0x01C8: // Lj -> Lj + case (char)0x01C9: // lj -> Lj + result.Append((char)0x01C8); break; - case (char) 0x01CA: // NJ -> Nj - case (char) 0x01CB: // Nj -> Nj - case (char) 0x01CC: // nj -> Nj - result.Append((char) 0x01CB); + case (char)0x01CA: // NJ -> Nj + case (char)0x01CB: // Nj -> Nj + case (char)0x01CC: // nj -> Nj + result.Append((char)0x01CB); break; - case (char) 0x01F1: // DZ -> Dz - case (char) 0x01F2: // Dz -> Dz - case (char) 0x01F3: // dz -> Dz - result.Append((char) 0x01F2); + case (char)0x01F1: // DZ -> Dz + case (char)0x01F2: // Dz -> Dz + case (char)0x01F3: // dz -> Dz + result.Append((char)0x01F2); break; default: result.Append(ToUpper(input[inputIndex])); @@ -850,7 +850,7 @@ namespace System.Globalization private static bool IsWordSeparator(UnicodeCategory category) { - return (c_wordSeparatorMask & (1 << (int) category)) != 0; + return (c_wordSeparatorMask & (1 << (int)category)) != 0; } private static bool IsLetterCategory(UnicodeCategory uc) diff --git a/src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs b/src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs index c9e97d6..c834eac 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Globalization/TimeSpanParse.cs @@ -115,7 +115,7 @@ namespace System.Globalization if (_zeroes == 0 && _num > MaxFraction) return false; - int totalDigitsCount = ((int) Math.Floor(Math.Log10(_num))) + 1 + _zeroes; + int totalDigitsCount = ((int)Math.Floor(Math.Log10(_num))) + 1 + _zeroes; if (totalDigitsCount == MaxFractionDigits) { @@ -133,7 +133,7 @@ namespace System.Globalization // .000001 normalize to 10 ticks // .1 normalize to 1,000,000 ticks - _num *= (int) Pow10(MaxFractionDigits - totalDigitsCount); + _num *= (int)Pow10(MaxFractionDigits - totalDigitsCount); return true; } @@ -144,7 +144,7 @@ namespace System.Globalization // .099999999 normalize to 1,000,000 ticks Debug.Assert(_zeroes > 0); // Already validated that in the condition _zeroes == 0 && _num > MaxFraction - _num = (int) Math.Round((double)_num / Pow10(totalDigitsCount - MaxFractionDigits), MidpointRounding.AwayFromZero); + _num = (int)Math.Round((double)_num / Pow10(totalDigitsCount - MaxFractionDigits), MidpointRounding.AwayFromZero); Debug.Assert(_num < MaxFraction); return true; diff --git a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs index 3063a25..bf350c7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Text/UTF32Encoding.cs @@ -766,14 +766,14 @@ namespace System.Text if (_bigEndian) { fallbackBytes = new byte[] { - unchecked((byte)(iChar>>24)), unchecked((byte)(iChar>>16)), - unchecked((byte)(iChar>>8)), unchecked((byte)(iChar)) }; + unchecked((byte)(iChar >> 24)), unchecked((byte)(iChar >> 16)), + unchecked((byte)(iChar >> 8)), unchecked((byte)(iChar)) }; } else { fallbackBytes = new byte[] { - unchecked((byte)(iChar)), unchecked((byte)(iChar>>8)), - unchecked((byte)(iChar>>16)), unchecked((byte)(iChar>>24)) }; + unchecked((byte)(iChar)), unchecked((byte)(iChar >> 8)), + unchecked((byte)(iChar >> 16)), unchecked((byte)(iChar >> 24)) }; } charCount += fallbackBuffer.InternalFallback(fallbackBytes, bytes); @@ -915,14 +915,14 @@ namespace System.Text if (_bigEndian) { fallbackBytes = new byte[] { - unchecked((byte)(iChar>>24)), unchecked((byte)(iChar>>16)), - unchecked((byte)(iChar>>8)), unchecked((byte)(iChar)) }; + unchecked((byte)(iChar >> 24)), unchecked((byte)(iChar >> 16)), + unchecked((byte)(iChar >> 8)), unchecked((byte)(iChar)) }; } else { fallbackBytes = new byte[] { - unchecked((byte)(iChar)), unchecked((byte)(iChar>>8)), - unchecked((byte)(iChar>>16)), unchecked((byte)(iChar>>24)) }; + unchecked((byte)(iChar)), unchecked((byte)(iChar >> 8)), + unchecked((byte)(iChar >> 16)), unchecked((byte)(iChar >> 24)) }; } // Chars won't be updated unless this works. diff --git a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs index ef74639..f92140f 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Threading/Tasks/Task.cs @@ -5881,8 +5881,7 @@ namespace System.Threading.Tasks /// The number of tasks remaining to complete. private int m_count; - internal WhenAllPromise(Task[] tasks) : - base() + internal WhenAllPromise(Task[] tasks) { Debug.Assert(tasks != null, "Expected a non-null task array"); Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); -- 2.7.4