From d3817c93025c24c62b3b8c7424b2ce4106ef05ba Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Tue, 20 Aug 2019 12:22:38 -0400 Subject: [PATCH] Fix StyleCop warning SA1006 (empty statements) This is just running the rule and auto-fixing everything. I undid changes that converted e.g. `while (...);` to `while (...) { }`. Signed-off-by: dotnet-bot --- .../shared/System/DateTime.Windows.cs | 2 +- .../shared/System/Diagnostics/Tracing/EventProvider.cs | 6 +++--- .../shared/System/Diagnostics/Tracing/EventSource.cs | 6 +++--- .../Tracing/TraceLogging/TraceLoggingEventTypes.cs | 2 +- .../shared/System/Diagnostics/Tracing/Winmeta.cs | 3 +-- .../shared/System/Globalization/CalendarWeekRule.cs | 2 +- .../System/Globalization/CalendricalCalculationsHelper.cs | 2 +- .../shared/System/Globalization/CharUnicodeInfo.cs | 4 ++-- .../shared/System/Globalization/DateTimeFormat.cs | 4 ++-- .../shared/System/Globalization/DateTimeFormatInfo.cs | 4 ++-- .../shared/System/Globalization/DateTimeParse.cs | 4 ++-- .../shared/System/Globalization/GregorianCalendarHelper.cs | 4 ++-- .../shared/System/Globalization/HebrewNumber.cs | 4 ++-- .../shared/System/Globalization/TimeSpanParse.cs | 4 ++-- .../shared/System/Runtime/GCSettings.cs | 2 +- .../System/Runtime/InteropServices/ComTypes/ITypeInfo.cs | 4 ++-- .../shared/System/Runtime/InteropServices/Marshal.cs | 2 +- .../shared/System/Runtime/InteropServices/SafeHandle.cs | 2 +- .../System.Private.CoreLib/shared/System/TimeZoneInfo.cs | 6 +++--- netcore/System.Private.CoreLib/shared/System/Tuple.cs | 14 +++++++------- 20 files changed, 40 insertions(+), 41 deletions(-) diff --git a/netcore/System.Private.CoreLib/shared/System/DateTime.Windows.cs b/netcore/System.Private.CoreLib/shared/System/DateTime.Windows.cs index 9a68b2d3787..7628d339bda 100644 --- a/netcore/System.Private.CoreLib/shared/System/DateTime.Windows.cs +++ b/netcore/System.Private.CoreLib/shared/System/DateTime.Windows.cs @@ -110,7 +110,7 @@ namespace System systemTime.Milliseconds = (ushort)dt.Millisecond; hundredNanoSecond = 0; } - }; + } #if !CORECLR internal static readonly bool s_systemSupportsPreciseSystemTime = SystemSupportsPreciseSystemTime(); diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventProvider.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventProvider.cs index 4f441543afd..2167758ee67 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventProvider.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventProvider.cs @@ -32,7 +32,7 @@ namespace System.Diagnostics.Tracing None = 0, ETW, EventPipe - }; + } // New in CLR4.0 internal enum ControllerCommand @@ -43,7 +43,7 @@ namespace System.Diagnostics.Tracing SendManifest = -1, Enable = -2, Disable = -3, - }; + } /// /// Only here because System.Diagnostics.EventProvider needs one more extensibility hook (when it gets a @@ -111,7 +111,7 @@ namespace System.Diagnostics.Tracing NullInput = 3, TooManyArgs = 4, Other = 5, - }; + } // Because callbacks happen on registration, and we need the callbacks for those setup // we can't call Register in the constructor. diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs index d120828f65e..531c279464b 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -2491,7 +2491,7 @@ namespace System.Diagnostics.Tracing #if ES_BUILD_PN public EventParameterType[] ParameterTypes; #endif - }; + } #if !ES_BUILD_PN private int GetParameterCount(EventMetadata eventData) @@ -5189,7 +5189,7 @@ namespace System.Diagnostics.Tracing /// Disable event /// Disable = -3 - }; + } #region private classes @@ -6290,7 +6290,7 @@ namespace System.Diagnostics.Tracing public ushort TotalChunks; public ushort ChunkNumber; #endif - }; + } #endregion } diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs index 6866769ecb9..bcbc236d31b 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/TraceLogging/TraceLoggingEventTypes.cs @@ -230,7 +230,7 @@ namespace System.Diagnostics.Tracing throw new ArgumentNullException(nameof(typeInfos)); } - return (TraceLoggingTypeInfo[])typeInfos.Clone(); ; + return (TraceLoggingTypeInfo[])typeInfos.Clone(); } #if FEATURE_PERFTRACING diff --git a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/Winmeta.cs b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/Winmeta.cs index 5c23c8232ee..a230f541ee4 100644 --- a/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/Winmeta.cs +++ b/netcore/System.Private.CoreLib/shared/System/Diagnostics/Tracing/Winmeta.cs @@ -133,8 +133,7 @@ namespace System.Diagnostics.Tracing Analytic = 18, /// The debug channel Debug = 19, - - }; + } /// /// EventOpcode diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/CalendarWeekRule.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/CalendarWeekRule.cs index 659824238a2..13567afba1a 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/CalendarWeekRule.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/CalendarWeekRule.cs @@ -11,5 +11,5 @@ namespace System.Globalization FirstFullWeek = 1, // Week 1 begins on first FirstDayOfWeek not before the first day of the year FirstFourDayWeek = 2 // Week 1 begins on first FirstDayOfWeek such that FirstDayOfWeek+3 is not before the first day of the year - }; + } } diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/CalendricalCalculationsHelper.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/CalendricalCalculationsHelper.cs index 90449443956..e7851cb0793 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/CalendricalCalculationsHelper.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/CalendricalCalculationsHelper.cs @@ -95,7 +95,7 @@ namespace System.Globalization internal int _lowestYear; internal CorrectionAlgorithm _algorithm; - }; + } private static readonly EphemerisCorrectionAlgorithmMap[] s_ephemerisCorrectionTable = new EphemerisCorrectionAlgorithmMap[] { diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs index 3df4ffdb20d..5d66a70508a 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/CharUnicodeInfo.cs @@ -290,7 +290,7 @@ namespace System.Globalization internal static BidiCategory GetBidiCategory(StringBuilder s, int index) { Debug.Assert(s != null, "s can not be null"); - Debug.Assert(index >= 0 && index < s.Length, "invalid index"); ; + Debug.Assert(index >= 0 && index < s.Length, "invalid index"); return ((BidiCategory)InternalGetCategoryValue(InternalConvertToUtf32(s, index), BIDI_CATEGORY_OFFSET)); } @@ -302,7 +302,7 @@ namespace System.Globalization internal static UnicodeCategory InternalGetUnicodeCategory(string str, int index, out int charLength) { Debug.Assert(str != null, "str can not be null"); - Debug.Assert(str.Length > 0, "str.Length > 0"); ; + Debug.Assert(str.Length > 0, "str.Length > 0"); Debug.Assert(index >= 0 && index < str.Length, "index >= 0 && index < str.Length"); return GetUnicodeCategory(InternalConvertToUtf32(str, index, out charLength)); diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs index ba3c8a3f307..c20f629f80c 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormat.cs @@ -391,7 +391,7 @@ namespace System // // Find first "d". - for (i = index - 1; i >= 0 && format[i] != patternToMatch; i--) { /*Do nothing here */ }; + for (i = index - 1; i >= 0 && format[i] != patternToMatch; i--) { /*Do nothing here */ } if (i >= 0) { @@ -417,7 +417,7 @@ namespace System // // Find first "d" - for (i = index + tokenLen; i < format.Length && format[i] != patternToMatch; i++) { /* Do nothing here */ }; + for (i = index + tokenLen; i < format.Length && format[i] != patternToMatch; i++) { /* Do nothing here */ } if (i < format.Length) { diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormatInfo.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormatInfo.cs index ce36ce4e642..438fbea2576 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormatInfo.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeFormatInfo.cs @@ -2635,7 +2635,7 @@ namespace System.Globalization TokenHashValue previousNode = hashTable[hashcode]; // Insert the new node into the current slot. - hashTable[hashcode] = new TokenHashValue(str, tokenType, tokenValue); ; + hashTable[hashcode] = new TokenHashValue(str, tokenType, tokenValue); while (++pos < TOKEN_HASH_SIZE) { @@ -2656,7 +2656,7 @@ namespace System.Globalization return; } previousNode = temp; - }; + } Debug.Fail("The hashtable is full. This should not happen."); } diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs index 5d408629012..ec693bd6557 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/DateTimeParse.cs @@ -1590,7 +1590,7 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR, } int n1 = raw.GetNumber(0); - int n2 = raw.GetNumber(1); ; + int n2 = raw.GetNumber(1); int n3 = raw.GetNumber(2); int order; @@ -5937,7 +5937,7 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR, FormatWithFormatSpecifier = 5, FormatWithOriginalDateTimeAndParameter = 6, FormatBadDateTimeCalendar = 7, // FormatException when ArgumentOutOfRange is thrown by a Calendar.TryToDateTime(). - }; + } [Flags] internal enum ParseFlags diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs index 59ea93900ba..a874a999a69 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/GregorianCalendarHelper.cs @@ -111,7 +111,7 @@ namespace System.Globalization m_Cal = cal; m_EraInfo = eraInfo; m_maxYear = m_EraInfo[0].maxEraYear; - m_minYear = m_EraInfo[0].minEraYear; ; + m_minYear = m_EraInfo[0].minEraYear; } // EraInfo.yearOffset: The offset to Gregorian year when the era starts. Gregorian Year = Era Year + yearOffset @@ -319,7 +319,7 @@ namespace System.Globalization 0, MillisPerSecond - 1)); } - return (InternalGlobalizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond); ; + return (InternalGlobalizationHelper.TimeToTicks(hour, minute, second) + millisecond * TicksPerMillisecond); } throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond); } diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/HebrewNumber.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/HebrewNumber.cs index 6fd200d8839..aa0e6fc2345 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/HebrewNumber.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/HebrewNumber.cs @@ -98,7 +98,7 @@ namespace System.Globalization Number -= 5000; } - Debug.Assert(Number > 0 && Number <= 999, "Number is out of range."); ; + Debug.Assert(Number > 0 && Number <= 999, "Number is out of range."); // // Get the Hundreds. @@ -228,7 +228,7 @@ namespace System.Globalization Digit9 = 7, SingleQuote = 8, DoubleQuote = 9, - }; + } //////////////////////////////////////////////////////////////////////////// // diff --git a/netcore/System.Private.CoreLib/shared/System/Globalization/TimeSpanParse.cs b/netcore/System.Private.CoreLib/shared/System/Globalization/TimeSpanParse.cs index 4e9811c8086..4be47d1e11d 100644 --- a/netcore/System.Private.CoreLib/shared/System/Globalization/TimeSpanParse.cs +++ b/netcore/System.Private.CoreLib/shared/System/Globalization/TimeSpanParse.cs @@ -1519,7 +1519,7 @@ namespace System.Globalization if (!ParseTime(out time, ref result)) { return false; - }; + } } else { @@ -1538,7 +1538,7 @@ namespace System.Globalization if (!ParseTime(out remainingTime, ref result)) { return false; - }; + } time += remainingTime; } } diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/GCSettings.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/GCSettings.cs index 86d10f4b534..77303ae07d7 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/GCSettings.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/GCSettings.cs @@ -28,7 +28,7 @@ namespace System.Runtime { Succeeded = 0, NoGCInProgress = 1 // NoGCRegion is in progress, can't change pause mode. - }; + } public static GCLatencyMode LatencyMode { diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs index a12c220a260..0b00fdceab8 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/ComTypes/ITypeInfo.cs @@ -146,7 +146,7 @@ namespace System.Runtime.InteropServices.ComTypes public IDLDESC idldesc; [FieldOffset(0)] public PARAMDESC paramdesc; - }; + } public DESCUNION desc; } @@ -172,7 +172,7 @@ namespace System.Runtime.InteropServices.ComTypes public int oInst; [FieldOffset(0)] public IntPtr lpvarValue; - }; + } public DESCUNION desc; diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/Marshal.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/Marshal.cs index 4c67ca55b22..ba6f9bf4f5a 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/Marshal.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/Marshal.cs @@ -662,7 +662,7 @@ namespace System.Runtime.InteropServices throw new ArgumentNullException(nameof(s)); } - return s.MarshalToString(globalAlloc: true, unicode: true); ; + return s.MarshalToString(globalAlloc: true, unicode: true); } public static unsafe IntPtr StringToHGlobalAnsi(string? s) diff --git a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeHandle.cs b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeHandle.cs index 9234e2751ac..234446ce480 100644 --- a/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeHandle.cs +++ b/netcore/System.Private.CoreLib/shared/System/Runtime/InteropServices/SafeHandle.cs @@ -50,7 +50,7 @@ namespace System.Runtime.InteropServices public const int Disposed = 0b10; public const int RefCount = unchecked(~0b11); // 2 bits reserved for closed/disposed; ref count gets 30 bits public const int RefCountOne = 1 << 2; - }; + } /// Creates a SafeHandle class. protected SafeHandle(IntPtr invalidHandleValue, bool ownsHandle) diff --git a/netcore/System.Private.CoreLib/shared/System/TimeZoneInfo.cs b/netcore/System.Private.CoreLib/shared/System/TimeZoneInfo.cs index 88189c9fbe5..f3994b81afd 100644 --- a/netcore/System.Private.CoreLib/shared/System/TimeZoneInfo.cs +++ b/netcore/System.Private.CoreLib/shared/System/TimeZoneInfo.cs @@ -26,7 +26,7 @@ namespace System { None = 1, NoThrowOnInvalidTime = 2 - }; + } [Serializable] [System.Runtime.CompilerServices.TypeForwardedFrom("System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] @@ -42,7 +42,7 @@ namespace System TimeZoneNotFoundException = 1, InvalidTimeZoneException = 2, SecurityException = 3 - }; + } private readonly string _id; private readonly string? _displayName; @@ -142,7 +142,7 @@ namespace System public Dictionary? _systemTimeZones; public ReadOnlyCollection? _readOnlySystemTimeZones; public bool _allSystemTimeZonesRead; - }; + } // used by GetUtcOffsetFromUtc (DateTime.Now, DateTime.ToLocalTime) for max/min whole-day range checks private static readonly DateTime s_maxDateOnly = new DateTime(9999, 12, 31); diff --git a/netcore/System.Private.CoreLib/shared/System/Tuple.cs b/netcore/System.Private.CoreLib/shared/System/Tuple.cs index 4915777b23d..8ef95d2f673 100644 --- a/netcore/System.Private.CoreLib/shared/System/Tuple.cs +++ b/netcore/System.Private.CoreLib/shared/System/Tuple.cs @@ -216,7 +216,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -327,7 +327,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -448,7 +448,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -579,7 +579,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -720,7 +720,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -871,7 +871,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) @@ -1037,7 +1037,7 @@ namespace System public override bool Equals(object? obj) { - return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); ; + return ((IStructuralEquatable)this).Equals(obj, EqualityComparer.Default); } bool IStructuralEquatable.Equals(object? other, IEqualityComparer comparer) -- 2.11.4.GIT