diff --git a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs index b9357d7f017..9be36cfcbc9 100644 --- a/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs +++ b/src/libraries/Common/src/Interop/OSX/System.Security.Cryptography.Native.Apple/Interop.Ssl.cs @@ -341,7 +341,7 @@ internal static partial class Interop { if (cfProtocolsArrayRef != null) { - for (int i = 0; i < cfProtocolsArrayRef.Length ; i++) + for (int i = 0; i < cfProtocolsArrayRef.Length; i++) { cfProtocolsArrayRef[i]?.Dispose(); } diff --git a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs index 51eca4915c6..ff5830876e6 100644 --- a/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs +++ b/src/libraries/Common/src/Interop/Unix/System.Net.Security.Native/Interop.GssApiException.cs @@ -17,12 +17,12 @@ internal static partial class Interop public Status MajorStatus { - get { return (Status)HResult;} + get { return (Status)HResult; } } public Status MinorStatus { - get { return _minorStatus;} + get { return _minorStatus; } } public GssApiException(string message) : base(message) diff --git a/src/libraries/Common/src/Interop/Windows/WinSock/WSABuffer.cs b/src/libraries/Common/src/Interop/Windows/WinSock/WSABuffer.cs index f145d09361c..bfc55070f2a 100644 --- a/src/libraries/Common/src/Interop/Windows/WinSock/WSABuffer.cs +++ b/src/libraries/Common/src/Interop/Windows/WinSock/WSABuffer.cs @@ -10,6 +10,6 @@ namespace System.Net.Sockets internal struct WSABuffer { internal int Length; // Length of Buffer - internal IntPtr Pointer;// Pointer to Buffer + internal IntPtr Pointer; // Pointer to Buffer } } diff --git a/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs b/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs index a95cb8c7614..646b9504079 100644 --- a/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs +++ b/src/libraries/Common/src/System/Globalization/FormatProvider.Number.cs @@ -1222,7 +1222,7 @@ namespace System.Globalization fixed (char* pFormat = &MemoryMarshal.GetReference(format)) { int src = 0; - for (;;) + while (true) { if (src >= format.Length) { diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs index c77c7e2939e..8fff712b15b 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/RuntimeBinder.cs @@ -964,7 +964,7 @@ namespace Microsoft.CSharp.RuntimeBinder { if (pArg is ExprList list) { - for (;;) + while (true) { list.OptionalElement = StripNamedArgument(list.OptionalElement); diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs index 8711181177e..4941f162095 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Conversion.cs @@ -1033,7 +1033,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics private static void MarkAsIntermediateConversion(Expr pExpr) { - for (;;) + while (true) { Debug.Assert(pExpr != null); if (pExpr is ExprCall call) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs index f6ae4ba0b2e..c179ee40d84 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/ExpressionBinder.cs @@ -594,7 +594,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics MethodSymbol methCur = null; AggregateType atsCur = (AggregateType)typeSrc; - for (;;) + while (true) { // Find the next operator. methCur = (methCur == null diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs index 599931e446a..fa24d717c1c 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/GroupToArgsBinder.cs @@ -809,7 +809,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics while (_HiddenTypes.Contains(_pCurrentType)) { // Move through this type and get the next one. - for (; iterator.CurrentType == _pCurrentType; iterator.MoveNext()) ; + for (; iterator.CurrentType == _pCurrentType; iterator.MoveNext()); _pCurrentSym = iterator.CurrentSymbol; _pCurrentType = iterator.CurrentType; diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs index 6882fedffae..98fc77988d2 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MemberLookup.cs @@ -431,7 +431,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics Debug.Assert(typeCur != null); // Loop through the interfaces. - for (; ;) + while (true) { Debug.Assert(typeCur != null && typeCur.IsInterfaceType); diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs index be5d2a5599c..80b49b4e726 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/MethodIterator.cs @@ -121,7 +121,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics private bool FindNextMethod() { - for (;;) + while (true) { CurrentSymbol = (CurrentSymbol == null ? SymbolLoader.LookupAggMember(_name, CurrentType.OwningAggregate, _mask) diff --git a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs index cbf0f117302..8fb58bde66e 100644 --- a/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs +++ b/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Semantics/Types/TypeManager.cs @@ -608,7 +608,7 @@ namespace Microsoft.CSharp.RuntimeBinder.Semantics if (typeSrc is AggregateType aggSrc) { - for (;;) + while (true) { if ((aggSrc.IsInterfaceType || aggSrc.IsDelegateType) && TryVarianceAdjustmentToGetAccessibleType(context, aggSrc, out CType typeDst)) { diff --git a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs index 854413fcff0..e6d73f3b76c 100644 --- a/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs +++ b/src/libraries/System.Collections.Concurrent/src/System/Collections/Concurrent/PartitionerStatic.cs @@ -553,7 +553,7 @@ namespace System.Collections.Concurrent { //reader through which we access the source data private readonly IEnumerator _sharedReader; - private readonly SharedLong _sharedIndex;//initial value -1 + private readonly SharedLong _sharedIndex; //initial value -1 private volatile KeyValuePair[]? _fillBuffer; // intermediate buffer to reduce locking private volatile int _fillBufferSize; // actual number of elements in _FillBuffer. Will start @@ -566,7 +566,7 @@ namespace System.Collections.Concurrent private readonly SharedBool _sourceDepleted; // no elements left in the enumerator, but there may be elements in the Fill Buffer //shared synchronization lock, created by this Enumerable - private readonly object _sharedLock;//deferring allocation by enumerator + private readonly object _sharedLock; //deferring allocation by enumerator private bool _disposed; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs index ccbcf5d6332..57da31eb88c 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionContainer.cs @@ -325,7 +325,7 @@ namespace System.ComponentModel.Composition.Hosting disposableRootProvider = _disposableRootProvider; _disposableRootProvider = null; - disposableLocalExportProvider = _disposableLocalExportProvider ; + disposableLocalExportProvider = _disposableLocalExportProvider; _disposableLocalExportProvider = null; _localExportProvider = null; diff --git a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionServices.cs b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionServices.cs index f481ed2bcf7..38a03920c41 100644 --- a/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionServices.cs +++ b/src/libraries/System.ComponentModel.Composition/src/System/ComponentModel/Composition/Hosting/CompositionServices.cs @@ -224,7 +224,7 @@ internal static Type GetContractTypeFromImport(this IAttributedImport import, Im bool hasConstraints = false; object[] genericParameterConstraints = new object[genericArguments.Length]; GenericParameterAttributes[] genericParameterAttributes = new GenericParameterAttributes[genericArguments.Length]; - for (int i=0; i< genericArguments.Length ; i++) + for (int i=0; i< genericArguments.Length; i++) { Type genericArgument = genericArguments[i]; diff --git a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/StandardCommands.cs b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/StandardCommands.cs index 0c338973be7..67cca2b98bb 100644 --- a/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/StandardCommands.cs +++ b/src/libraries/System.ComponentModel.TypeConverter/src/System/ComponentModel/Design/StandardCommands.cs @@ -486,7 +486,7 @@ namespace System.ComponentModel.Design internal const int cmdidObjectVerbList6 = 143; internal const int cmdidObjectVerbList7 = 144; internal const int cmdidObjectVerbList8 = 145; - internal const int cmdidObjectVerbList9 = 146;// Unused on purpose! + internal const int cmdidObjectVerbList9 = 146; // Unused on purpose! internal const int cmdidConvertObject = 147; internal const int cmdidCustomControl = 148; @@ -515,49 +515,49 @@ namespace System.ComponentModel.Design internal const int cmdidRemove = 168; internal const int cmdidJoinLeftAll = 169; internal const int cmdidJoinRightAll = 170; - internal const int cmdidAddToOutput = 171;// Add selected fields to query output - internal const int cmdidOtherQuery = 172;// change query type to 'other' + internal const int cmdidAddToOutput = 171; // Add selected fields to query output + internal const int cmdidOtherQuery = 172; // change query type to 'other' internal const int cmdidGenerateChangeScript = 173; - internal const int cmdidSaveSelection = 174;// Save current selection - internal const int cmdidAutojoinCurrent = 175;// Autojoin current tables - internal const int cmdidAutojoinAlways = 176;// Toggle Autojoin state - internal const int cmdidEditPage = 177;// Launch editor for url - internal const int cmdidViewLinks = 178;// Launch new webscope for url - internal const int cmdidStop = 179;// Stope webscope rendering - internal const int cmdidPause = 180;// Pause webscope rendering - internal const int cmdidResume = 181;// Resume webscope rendering - internal const int cmdidFilterDiagram = 182;// Filter webscope diagram - internal const int cmdidShowAllObjects = 183;// Show All objects in webscope diagram - internal const int cmdidShowApplications = 184;// Show Application objects in webscope diagram - internal const int cmdidShowOtherObjects = 185;// Show other objects in webscope diagram - internal const int cmdidShowPrimRelationships = 186;// Show primary relationships - internal const int cmdidExpand = 187;// Expand links - internal const int cmdidCollapse = 188;// Collapse links - internal const int cmdidRefresh = 189;// Refresh Webscope diagram - internal const int cmdidLayout = 190;// Layout websope diagram - internal const int cmdidShowResources = 191;// Show resouce objects in webscope diagram - internal const int cmdidInsertHTMLWizard = 192;// Insert HTML using a Wizard - internal const int cmdidShowDownloads = 193;// Show download objects in webscope diagram - internal const int cmdidShowExternals = 194;// Show external objects in webscope diagram - internal const int cmdidShowInBoundLinks = 195;// Show inbound links in webscope diagram - internal const int cmdidShowOutBoundLinks = 196;// Show out bound links in webscope diagram - internal const int cmdidShowInAndOutBoundLinks = 197;// Show in and out bound links in webscope diagram - internal const int cmdidPreview = 198;// Preview page - internal const int cmdidOpen = 261;// Open - internal const int cmdidOpenWith = 199;// Open with - internal const int cmdidShowPages = 200;// Show HTML pages - internal const int cmdidRunQuery = 201;// Runs a query - internal const int cmdidClearQuery = 202;// Clears the query's associated cursor - internal const int cmdidRecordFirst = 203;// Go to first record in set - internal const int cmdidRecordLast = 204;// Go to last record in set - internal const int cmdidRecordNext = 205;// Go to next record in set - internal const int cmdidRecordPrevious = 206;// Go to previous record in set - internal const int cmdidRecordGoto = 207;// Go to record via dialog - internal const int cmdidRecordNew = 208;// Add a record to set + internal const int cmdidSaveSelection = 174; // Save current selection + internal const int cmdidAutojoinCurrent = 175; // Autojoin current tables + internal const int cmdidAutojoinAlways = 176; // Toggle Autojoin state + internal const int cmdidEditPage = 177; // Launch editor for url + internal const int cmdidViewLinks = 178; // Launch new webscope for url + internal const int cmdidStop = 179; // Stope webscope rendering + internal const int cmdidPause = 180; // Pause webscope rendering + internal const int cmdidResume = 181; // Resume webscope rendering + internal const int cmdidFilterDiagram = 182; // Filter webscope diagram + internal const int cmdidShowAllObjects = 183; // Show All objects in webscope diagram + internal const int cmdidShowApplications = 184; // Show Application objects in webscope diagram + internal const int cmdidShowOtherObjects = 185; // Show other objects in webscope diagram + internal const int cmdidShowPrimRelationships = 186; // Show primary relationships + internal const int cmdidExpand = 187; // Expand links + internal const int cmdidCollapse = 188; // Collapse links + internal const int cmdidRefresh = 189; // Refresh Webscope diagram + internal const int cmdidLayout = 190; // Layout websope diagram + internal const int cmdidShowResources = 191; // Show resouce objects in webscope diagram + internal const int cmdidInsertHTMLWizard = 192; // Insert HTML using a Wizard + internal const int cmdidShowDownloads = 193; // Show download objects in webscope diagram + internal const int cmdidShowExternals = 194; // Show external objects in webscope diagram + internal const int cmdidShowInBoundLinks = 195; // Show inbound links in webscope diagram + internal const int cmdidShowOutBoundLinks = 196; // Show out bound links in webscope diagram + internal const int cmdidShowInAndOutBoundLinks = 197; // Show in and out bound links in webscope diagram + internal const int cmdidPreview = 198; // Preview page + internal const int cmdidOpen = 261; // Open + internal const int cmdidOpenWith = 199; // Open with + internal const int cmdidShowPages = 200; // Show HTML pages + internal const int cmdidRunQuery = 201; // Runs a query + internal const int cmdidClearQuery = 202; // Clears the query's associated cursor + internal const int cmdidRecordFirst = 203; // Go to first record in set + internal const int cmdidRecordLast = 204; // Go to last record in set + internal const int cmdidRecordNext = 205; // Go to next record in set + internal const int cmdidRecordPrevious = 206; // Go to previous record in set + internal const int cmdidRecordGoto = 207; // Go to record via dialog + internal const int cmdidRecordNew = 208; // Add a record to set - internal const int cmdidInsertNewMenu = 209;// menu designer - internal const int cmdidInsertSeparator = 210;// menu designer - internal const int cmdidEditMenuNames = 211;// menu designer + internal const int cmdidInsertNewMenu = 209; // menu designer + internal const int cmdidInsertSeparator = 210; // menu designer + internal const int cmdidEditMenuNames = 211; // menu designer internal const int cmdidDebugExplorer = 212; internal const int cmdidDebugProcesses = 213; @@ -669,7 +669,7 @@ namespace System.ComponentModel.Design internal const int cmdidDockingViewFloater = 291; internal const int cmdidAutoHideWindow = 292; internal const int cmdidMoveToDropdownBar = 293; - internal const int cmdidFindCmd = 294;// internal Find commands + internal const int cmdidFindCmd = 294; // internal Find commands internal const int cmdidStart = 295; internal const int cmdidRestart = 296; @@ -754,8 +754,8 @@ namespace System.ComponentModel.Design internal const int cmdidFindHelp = 356; internal const int cmdidFindInFiles = 277; internal const int cmdidReplaceInFiles = 278; - internal const int cmdidNextLocation = 279;// next item in task list, find in files results, etc. - internal const int cmdidPreviousLocation = 280;// prev item " + internal const int cmdidNextLocation = 279; // next item in task list, find in files results, etc. + internal const int cmdidPreviousLocation = 280; // prev item " internal const int cmdidTaskListNextError = 357; internal const int cmdidTaskListPrevError = 358; @@ -799,7 +799,7 @@ namespace System.ComponentModel.Design internal const int cmdidMarkerCmd8 = 408; internal const int cmdidMarkerCmd9 = 409; internal const int cmdidMarkerLast = 409; - internal const int cmdidMarkerEnd = 410;// list terminator reserved + internal const int cmdidMarkerEnd = 410; // list terminator reserved // user-invoked project reload and unload internal const int cmdidReloadProject = 412; @@ -848,7 +848,7 @@ namespace System.ComponentModel.Design internal const int cmdidWindow22 = 591; internal const int cmdidWindow23 = 592; internal const int cmdidWindow24 = 593; - internal const int cmdidWindow25 = 594;// note cmdidWindow25 is unused on purpose! + internal const int cmdidWindow25 = 594; // note cmdidWindow25 is unused on purpose! internal const int cmdidMoreWindows = 595; //internal const int = 597;//UNUSED @@ -880,7 +880,7 @@ namespace System.ComponentModel.Design internal const int cmdidMRUProj22 = 621; internal const int cmdidMRUProj23 = 622; internal const int cmdidMRUProj24 = 623; - internal const int cmdidMRUProj25 = 624;// note cmdidMRUProj25 is unused on purpose! + internal const int cmdidMRUProj25 = 624; // note cmdidMRUProj25 is unused on purpose! internal const int cmdidSplitNext = 625; internal const int cmdidSplitPrev = 626; @@ -889,8 +889,8 @@ namespace System.ComponentModel.Design internal const int cmdidNextDocument = 628; internal const int cmdidPrevDocument = 629; - internal const int cmdidTool1 = 630;// note cmdidTool1 - cmdidTool24 must be - internal const int cmdidTool2 = 631;// consecutive + internal const int cmdidTool1 = 630; // note cmdidTool1 - cmdidTool24 must be + internal const int cmdidTool2 = 631; // consecutive internal const int cmdidTool3 = 632; internal const int cmdidTool4 = 633; internal const int cmdidTool5 = 634; @@ -921,30 +921,30 @@ namespace System.ComponentModel.Design internal const int cmdidCloseDocument = 658; internal const int cmdidToolboxSortItems = 659; - internal const int cmdidViewBarView1 = 660;//UNUSED - internal const int cmdidViewBarView2 = 661;//UNUSED - internal const int cmdidViewBarView3 = 662;//UNUSED - internal const int cmdidViewBarView4 = 663;//UNUSED - internal const int cmdidViewBarView5 = 664;//UNUSED - internal const int cmdidViewBarView6 = 665;//UNUSED - internal const int cmdidViewBarView7 = 666;//UNUSED - internal const int cmdidViewBarView8 = 667;//UNUSED - internal const int cmdidViewBarView9 = 668;//UNUSED - internal const int cmdidViewBarView10 = 669;//UNUSED - internal const int cmdidViewBarView11 = 670;//UNUSED - internal const int cmdidViewBarView12 = 671;//UNUSED - internal const int cmdidViewBarView13 = 672;//UNUSED - internal const int cmdidViewBarView14 = 673;//UNUSED - internal const int cmdidViewBarView15 = 674;//UNUSED - internal const int cmdidViewBarView16 = 675;//UNUSED - internal const int cmdidViewBarView17 = 676;//UNUSED - internal const int cmdidViewBarView18 = 677;//UNUSED - internal const int cmdidViewBarView19 = 678;//UNUSED - internal const int cmdidViewBarView20 = 679;//UNUSED - internal const int cmdidViewBarView21 = 680;//UNUSED - internal const int cmdidViewBarView22 = 681;//UNUSED - internal const int cmdidViewBarView23 = 682;//UNUSED - internal const int cmdidViewBarView24 = 683;//UNUSED + internal const int cmdidViewBarView1 = 660; //UNUSED + internal const int cmdidViewBarView2 = 661; //UNUSED + internal const int cmdidViewBarView3 = 662; //UNUSED + internal const int cmdidViewBarView4 = 663; //UNUSED + internal const int cmdidViewBarView5 = 664; //UNUSED + internal const int cmdidViewBarView6 = 665; //UNUSED + internal const int cmdidViewBarView7 = 666; //UNUSED + internal const int cmdidViewBarView8 = 667; //UNUSED + internal const int cmdidViewBarView9 = 668; //UNUSED + internal const int cmdidViewBarView10 = 669; //UNUSED + internal const int cmdidViewBarView11 = 670; //UNUSED + internal const int cmdidViewBarView12 = 671; //UNUSED + internal const int cmdidViewBarView13 = 672; //UNUSED + internal const int cmdidViewBarView14 = 673; //UNUSED + internal const int cmdidViewBarView15 = 674; //UNUSED + internal const int cmdidViewBarView16 = 675; //UNUSED + internal const int cmdidViewBarView17 = 676; //UNUSED + internal const int cmdidViewBarView18 = 677; //UNUSED + internal const int cmdidViewBarView19 = 678; //UNUSED + internal const int cmdidViewBarView20 = 679; //UNUSED + internal const int cmdidViewBarView21 = 680; //UNUSED + internal const int cmdidViewBarView22 = 681; //UNUSED + internal const int cmdidViewBarView23 = 682; //UNUSED + internal const int cmdidViewBarView24 = 683; //UNUSED internal const int cmdidSolutionCfg = 684; internal const int cmdidSolutionCfgGetList = 685; @@ -1006,7 +1006,7 @@ namespace System.ComponentModel.Design internal const int cmdidTaskListCustomView47 = 724; internal const int cmdidTaskListCustomView48 = 725; internal const int cmdidTaskListCustomView49 = 726; - internal const int cmdidTaskListCustomView50 = 727;//not used on purpose, ends the list + internal const int cmdidTaskListCustomView50 = 727; //not used on purpose, ends the list internal const int cmdidObjectSearch = 728; @@ -1059,7 +1059,7 @@ namespace System.ComponentModel.Design internal const int cmdidTaggedExp8 = 767; internal const int cmdidTaggedExp9 = 768; - internal const int cmdidEditorWidgetClick = 769;// param = 0;is the moniker as VT_BSTR, param = 1;is the buffer line as VT_I4, and param = 2;is the buffer index as VT_I4 + internal const int cmdidEditorWidgetClick = 769; // param = 0;is the moniker as VT_BSTR, param = 1;is the buffer line as VT_I4, and param = 2;is the buffer index as VT_I4 internal const int cmdidCmdWinUpdateAC = 770; internal const int cmdidSlnCfgMgr = 771; @@ -1101,7 +1101,7 @@ namespace System.ComponentModel.Design internal const int cmdidAutoHideContext30 = 805; internal const int cmdidAutoHideContext31 = 806; internal const int cmdidAutoHideContext32 = 807; - internal const int cmdidAutoHideContext33 = 808;// must remain unused + internal const int cmdidAutoHideContext33 = 808; // must remain unused internal const int cmdidShellNavBackward = 809; internal const int cmdidShellNavForward = 810; @@ -1138,7 +1138,7 @@ namespace System.ComponentModel.Design internal const int cmdidShellNavigate30 = 840; internal const int cmdidShellNavigate31 = 841; internal const int cmdidShellNavigate32 = 842; - internal const int cmdidShellNavigate33 = 843;// must remain unused + internal const int cmdidShellNavigate33 = 843; // must remain unused internal const int cmdidShellWindowNavigate1 = 844; internal const int cmdidShellWindowNavigate2 = 845; @@ -1172,7 +1172,7 @@ namespace System.ComponentModel.Design internal const int cmdidShellWindowNavigate30 = 873; internal const int cmdidShellWindowNavigate31 = 874; internal const int cmdidShellWindowNavigate32 = 875; - internal const int cmdidShellWindowNavigate33 = 876;// must remain unused + internal const int cmdidShellWindowNavigate33 = 876; // must remain unused // ObjectSearch cmds internal const int cmdidOBSDoFind = 877; @@ -1226,7 +1226,7 @@ namespace System.ComponentModel.Design internal const int cmdidMRUFile22 = 921; internal const int cmdidMRUFile23 = 922; internal const int cmdidMRUFile24 = 923; - internal const int cmdidMRUFile25 = 924;// note cmdidMRUFile25 is unused on purpose! + internal const int cmdidMRUFile25 = 924; // note cmdidMRUFile25 is unused on purpose! // Object Browsing & ClassView cmds // Shared shell cmds (for accessing Object Browsing functionality) @@ -1250,7 +1250,7 @@ namespace System.ComponentModel.Design internal const int cmdidCVShowPackages = 953; internal const int cmdidQryManageIndexes = 954; internal const int cmdidBrowseComponent = 955; - internal const int cmdidPrintDefault = 956;// quick print + internal const int cmdidPrintDefault = 956; // quick print internal const int cmdidBrowseDoc = 957; diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs index 25b0c1882b7..0283dc316de 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/BaseConfigurationRecord.cs @@ -3582,7 +3582,7 @@ namespace System.Configuration throw new ConfigurationErrorsException(SR.EncryptedNode_not_found, filename, lineNumber); // Find the node - for (;;) + while (true) { clone.Read(); // Keep reading till we find a relavant node diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/MgmtConfigurationRecord.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/MgmtConfigurationRecord.cs index c00ffa0febf..a45f60bbf16 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/MgmtConfigurationRecord.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/MgmtConfigurationRecord.cs @@ -614,7 +614,7 @@ namespace System.Configuration if (reader.Name != name) throw new ConfigurationErrorsException(SR.Format(SR.Config_unexpected_element_name, reader.Name)); - for (;;) + while (true) { if (!reader.Read()) { diff --git a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SafeBitVector32.cs b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SafeBitVector32.cs index 7b59fb43131..b976b5444f6 100644 --- a/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SafeBitVector32.cs +++ b/src/libraries/System.Configuration.ConfigurationManager/src/System/Configuration/SafeBitVector32.cs @@ -25,7 +25,7 @@ namespace System.Configuration } set { - for (;;) + while (true) { int oldData = _data; int newData; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/DataStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/DataStorage.cs index 34b262beaf7..585c48a4195 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/DataStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/DataStorage.cs @@ -277,7 +277,7 @@ namespace System.Data.Common public abstract string ConvertObjectToXml(object value); public virtual void ConvertObjectToXml(object value, XmlWriter xmlWriter, XmlRootAttribute xmlAttrib) { - xmlWriter.WriteString(ConvertObjectToXml(value));// should it be NO OP? + xmlWriter.WriteString(ConvertObjectToXml(value)); // should it be NO OP? } public static DataStorage CreateStorage(DataColumn column, Type dataType, StorageType typeCode) diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs index 999cbcfd2bf..a35248fa58c 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLByteStorage.cs @@ -139,7 +139,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs index c2979da06e3..609ea5414bf 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLBytesStorage.cs @@ -31,7 +31,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: int count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs index 7f0dc53b581..ffc131c36a5 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLCharsStorage.cs @@ -31,7 +31,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: int count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs index e3c7515e170..9ff763d6235 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDateTimeStorage.cs @@ -66,7 +66,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: int count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs index 491747dc012..273ebc680a0 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLDoubleStorage.cs @@ -139,7 +139,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs index 99ec0704671..a643e7e474c 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt16Storage.cs @@ -139,7 +139,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs index 2769e986060..42693ea9e1a 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Common/SQLTypes/SQLInt64Storage.cs @@ -140,7 +140,7 @@ namespace System.Data.Common { return _values[records[0]]; } - return null;// no data => null + return null; // no data => null case AggregateType.Count: count = 0; diff --git a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs index 614101c3c54..d44ec1e0b88 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataColumn.cs @@ -1280,7 +1280,7 @@ namespace System.Data // there is a change, since we are supporting hierarchy(bacause of Names Simple Type) old check (just one leel base check) is wrong if (value != null && value.CanHaveMaxLength()) { - _maxLength = _simpleType.MaxLength;// this is temp solution, since we dont let simple content to have + _maxLength = _simpleType.MaxLength; // this is temp solution, since we dont let simple content to have } //maxlength set but for simple type we want to set it, after coming to decision about it , we should @@ -1532,7 +1532,7 @@ namespace System.Data clone.DataType = DataType; clone._defaultValue = _defaultValue; clone._defaultValueIsNull = ((_defaultValue == DBNull.Value) || (clone.ImplementsINullable && DataStorage.IsObjectSqlNull(_defaultValue))) ? true : false; - clone._columnMapping = _columnMapping;// clone column Mapping since we dont let MaxLength to be set throu API + clone._columnMapping = _columnMapping; // clone column Mapping since we dont let MaxLength to be set throu API clone._readOnly = _readOnly; clone.MaxLength = MaxLength; clone.XmlDataType = XmlDataType; diff --git a/src/libraries/System.Data.Common/src/System/Data/DataColumnPropertyDescriptor.cs b/src/libraries/System.Data.Common/src/System/Data/DataColumnPropertyDescriptor.cs index 8669d8bb4f3..1bc27531842 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataColumnPropertyDescriptor.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataColumnPropertyDescriptor.cs @@ -76,7 +76,7 @@ namespace System.Data public override void ResetValue(object component) { DataRowView dataRowView = (DataRowView)component; - dataRowView.SetColumnValue(Column, DBNull.Value);// no need to ccheck for the col type and set Sql...Null! + dataRowView.SetColumnValue(Column, DBNull.Value); // no need to ccheck for the col type and set Sql...Null! } public override void SetValue(object component, object value) diff --git a/src/libraries/System.Data.Common/src/System/Data/DataRow.cs b/src/libraries/System.Data.Common/src/System/Data/DataRow.cs index 06938273f16..121de16dea7 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataRow.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataRow.cs @@ -889,7 +889,7 @@ namespace System.Data return row; } } - return null;// Rule 1: At all times, only ONE FK "(in a row) can be non-Null + return null; // Rule 1: At all times, only ONE FK "(in a row) can be non-Null } // No Nested in 1-many diff --git a/src/libraries/System.Data.Common/src/System/Data/DataSet.cs b/src/libraries/System.Data.Common/src/System/Data/DataSet.cs index 165d157bbf9..99f7c60949f 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataSet.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataSet.cs @@ -1127,7 +1127,7 @@ namespace System.Data ForeignKeyConstraint foreign = constraints[j] as ForeignKeyConstraint; if (foreign.Table == foreign.RelatedTable) { - continue;// we have already added this foreign key in while cloning the datatable + continue; // we have already added this foreign key in while cloning the datatable } ds.Tables[i].Constraints.Add(constraints[j].Clone(ds)); diff --git a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs index 9f065338e91..3cd42b5130e 100644 --- a/src/libraries/System.Data.Common/src/System/Data/DataTable.cs +++ b/src/libraries/System.Data.Common/src/System/Data/DataTable.cs @@ -484,7 +484,7 @@ namespace System.Data //Constraints if (isSingleTable) { - DeserializeConstraints(info, context, /*table index */ 0, /* serialize all constraints */false);// since single table, send table index as 0, meanwhile passing + DeserializeConstraints(info, context, /*table index */ 0, /* serialize all constraints */false); // since single table, send table index as 0, meanwhile passing // false for 'allConstraints' means, handle all the constraint related to the table } } @@ -761,9 +761,9 @@ namespace System.Data ArrayList storeList = (ArrayList)info.GetValue(string.Format(formatProvider, "DataTable_{0}.Records", serIndex), typeof(ArrayList)); ArrayList nullbitList = (ArrayList)info.GetValue(string.Format(formatProvider, "DataTable_{0}.NullBits", serIndex), typeof(ArrayList)); Hashtable rowErrors = (Hashtable)info.GetValue(string.Format(formatProvider, "DataTable_{0}.RowErrors", serIndex), typeof(Hashtable)); - rowErrors.OnDeserialization(this);//OnDeSerialization must be called since the hashtable gets deserialized after the whole graph gets deserialized + rowErrors.OnDeserialization(this); //OnDeSerialization must be called since the hashtable gets deserialized after the whole graph gets deserialized Hashtable colErrors = (Hashtable)info.GetValue(string.Format(formatProvider, "DataTable_{0}.ColumnErrors", serIndex), typeof(Hashtable)); - colErrors.OnDeserialization(this);//OnDeSerialization must be called since the hashtable gets deserialized after the whole graph gets deserialized + colErrors.OnDeserialization(this); //OnDeSerialization must be called since the hashtable gets deserialized after the whole graph gets deserialized if (recordCount <= 0) { @@ -969,7 +969,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() try { if (forceReset || ndx.HasRemoteAggregate) @@ -1846,7 +1846,7 @@ namespace System.Data DataTable parentTable = nestedRelations[j].ParentTable; if (!visitedTables.Contains(parentTable)) visitedTables.Add(parentTable); - return parentTable.GetInheritedNamespace(visitedTables);// this is the same as return parentTable.Namespace + return parentTable.GetInheritedNamespace(visitedTables); // this is the same as return parentTable.Namespace } } // dont put else @@ -2793,7 +2793,7 @@ namespace System.Data } finally { - row.ResetLastChangedColumn();// if expression is evaluated while adding, before return, we want to clear it + row.ResetLastChangedColumn(); // if expression is evaluated while adding, before return, we want to clear it } } @@ -3749,7 +3749,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() if (0 < ndx.RefCount) { ndx.RecordChanged(record); @@ -3775,7 +3775,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() if (0 < ndx.RefCount) { ndx.RecordChanged(oldIndex[i], newIndex[i]); @@ -3796,7 +3796,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() if (0 < ndx.RefCount) { ndx.RecordStateChanged(record, oldState, newState); @@ -3819,7 +3819,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() if (0 < ndx.RefCount) { if (record1 != -1 && record2 != -1) @@ -3926,9 +3926,9 @@ namespace System.Data // if expression has changed if (!equalValues) { - int[] oldIndex = dr.Table.RemoveRecordFromIndexes(dr, version);// conditional, if it exists it will try to remove with no event fired + int[] oldIndex = dr.Table.RemoveRecordFromIndexes(dr, version); // conditional, if it exists it will try to remove with no event fired dc.SetValue(record, newValue); - int[] newIndex = dr.Table.InsertRecordToIndexes(dr, version);// conditional, it will insert if it qualifies, no event will be fired + int[] newIndex = dr.Table.InsertRecordToIndexes(dr, version); // conditional, it will insert if it qualifies, no event will be fired if (dr.HasVersion(version)) { if (version != DataRowVersion.Original) @@ -4053,7 +4053,7 @@ namespace System.Data int numIndexes = _shadowIndexes.Count; for (int i = 0; i < numIndexes; i++) { - Index ndx = _shadowIndexes[i];// shadowindexes may change, see ShadowIndexCopy() + Index ndx = _shadowIndexes[i]; // shadowindexes may change, see ShadowIndexCopy() if (0 < ndx.RefCount) { if (null == column) @@ -4771,10 +4771,10 @@ namespace System.Data if (_inDataLoad && !AreIndexEventsSuspended) { // we do not want to fire any listchanged in new Load/Fill - SuspendIndexEvents();// so suspend events here(not suspended == table already has some rows initially) + SuspendIndexEvents(); // so suspend events here(not suspended == table already has some rows initially) } - DataRow dataRow = LoadRow(values, loadOption, indextoUse);// if indextoUse == null, it means we dont have PK, + DataRow dataRow = LoadRow(values, loadOption, indextoUse); // if indextoUse == null, it means we dont have PK, // so LoadRow will take care of just adding the row to end return dataRow; @@ -5518,7 +5518,7 @@ namespace System.Data } DataSet ds = null; - string tablenamespace = _tableNamespace;//SQL BU Defect Tracking 286968 + string tablenamespace = _tableNamespace; //SQL BU Defect Tracking 286968 // Generate SchemaTree and write it out if (null == DataSet) diff --git a/src/libraries/System.Data.Common/src/System/Data/Filter/Operators.cs b/src/libraries/System.Data.Common/src/System/Data/Filter/Operators.cs index 5e68f9da6b8..d070b88ea89 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Filter/Operators.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Filter/Operators.cs @@ -27,7 +27,7 @@ namespace System.Data internal const int EqualTo = 7; // = internal const int GreaterThen = 8; // > internal const int LessThen = 9; // < - internal const int GreaterOrEqual = 10;// >= + internal const int GreaterOrEqual = 10; // >= internal const int LessOrEqual = 11; // <= internal const int NotEqual = 12; // <> /* End of Comparison (relational) operators */ diff --git a/src/libraries/System.Data.Common/src/System/Data/ForeignKeyConstraint.cs b/src/libraries/System.Data.Common/src/System/Data/ForeignKeyConstraint.cs index ef771ca6250..650cac5d52f 100644 --- a/src/libraries/System.Data.Common/src/System/Data/ForeignKeyConstraint.cs +++ b/src/libraries/System.Data.Common/src/System/Data/ForeignKeyConstraint.cs @@ -699,7 +699,7 @@ namespace System.Data } else { - iDest = destination.Tables.IndexOf(RelatedTable.TableName, RelatedTable.Namespace, false);// pass false for last param + iDest = destination.Tables.IndexOf(RelatedTable.TableName, RelatedTable.Namespace, false); // pass false for last param } if (iDest < 0) { diff --git a/src/libraries/System.Data.Common/src/System/Data/Merger.cs b/src/libraries/System.Data.Common/src/System/Data/Merger.cs index 6f123b08c6b..702a0e159c6 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Merger.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Merger.cs @@ -48,7 +48,7 @@ namespace System.Data _IgnoreNSforTableLookup = (_dataSet._namespaceURI != source._namespaceURI); // if two DataSets have different // Namespaces, ignore NS for table lookups as we won't be able to find the right tables which inherits its NS - List existingColumns = null;// need to cache existing columns + List existingColumns = null; // need to cache existing columns if (MissingSchemaAction.Add == _missingSchemaAction) { @@ -93,7 +93,7 @@ namespace System.Data } else { - targetTable = _dataSet.Tables[sourceTable.TableName, sourceTable.Namespace];// we know that target table won't be null since MissingSchemaAction is Add , we have already added it! + targetTable = _dataSet.Tables[sourceTable.TableName, sourceTable.Namespace]; // we know that target table won't be null since MissingSchemaAction is Add , we have already added it! } foreach (DataColumn dc in sourceTable.Columns) diff --git a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs index 9d03eb4300a..0dd2400f061 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SQLTypes/SQLDecimal.cs @@ -930,7 +930,7 @@ namespace System.Data.SqlTypes //the decimal digits, from the //lowest significant to highest significant - int iDigits = 0;//Number of significant digits + int iDigits = 0; //Number of significant digits uint ulRem; //Remainder of a division by x_ulBase10, i.e.,least significant digit // Build the final numeric string by inserting the sign, reversing @@ -1445,7 +1445,7 @@ namespace System.Data.SqlTypes lScaleAdjust = ResScale - ActualScale; - fResPositive = (x.IsPositive == y.IsPositive);//positive if both signs same. + fResPositive = (x.IsPositive == y.IsPositive); //positive if both signs same. // II) Perform multiplication @@ -1484,7 +1484,7 @@ namespace System.Data.SqlTypes dwlNextAccum = 0; // Update result and accum - rgulRes[idRes++] = unchecked((uint)dwlAccum);// & x_ulInt32BaseForMod); // equiv to mod x_lInt32Base + rgulRes[idRes++] = unchecked((uint)dwlAccum); // & x_ulInt32BaseForMod); // equiv to mod x_lInt32Base dwlAccum = (dwlAccum >> 32) + dwlNextAccum; // equiv to div BaseUI4 + dwlNAccum // dwlNextAccum can't overflow next iteration @@ -1654,7 +1654,7 @@ namespace System.Data.SqlTypes throw new DivideByZeroException(SQLResource.DivideByZeroMessage); // 1) Figure out result prec,scale,sign.. - fResSignPos = (x.IsPositive == y.IsPositive);//sign of result + fResSignPos = (x.IsPositive == y.IsPositive); //sign of result //scale = max(s1 + p2 + 1, x_cNumeDivScaleMin); //precision = max(s1 + p2 + 1, x_cNumeDivScaleMin) + p1 + p2 + 1; @@ -2354,7 +2354,7 @@ namespace System.Data.SqlTypes SqlDecimal ret = n; - int lScaleAdjust = scale - ret._bScale;//Adjustment to scale + int lScaleAdjust = scale - ret._bScale; //Adjustment to scale //Adjust scale ret.AdjustScale(lScaleAdjust, true); diff --git a/src/libraries/System.Data.Common/src/System/Data/Select.cs b/src/libraries/System.Data.Common/src/System/Data/Select.cs index a9e8a36b384..5c273d1a47c 100644 --- a/src/libraries/System.Data.Common/src/System/Data/Select.cs +++ b/src/libraries/System.Data.Common/src/System/Data/Select.cs @@ -351,7 +351,7 @@ namespace System.Data if (_candidateColumns[i] != null) { ndxFields[j++] = new IndexField(_table.Columns[i], isDescending: false); - _candidateColumns[i].flag = false;// this means it is processed + _candidateColumns[i].flag = false; // this means it is processed } } for (i = 0; i < lenIndexDesc; i++) @@ -371,7 +371,7 @@ namespace System.Data { if (_candidateColumns[i] != null) { - _candidateColumns[i].flag = false;// same as before, it is false when it returns + _candidateColumns[i].flag = false; // same as before, it is false when it returns } } @@ -433,7 +433,7 @@ namespace System.Data { if (_candidateColumns[i] != null) { - _candidateColumns[i].flag = false;// same as before, it is false when it returns + _candidateColumns[i].flag = false; // same as before, it is false when it returns } } } diff --git a/src/libraries/System.Data.Common/src/System/Data/SimpleType.cs b/src/libraries/System.Data.Common/src/System/Data/SimpleType.cs index 61d4d9947b5..90d130f34d2 100644 --- a/src/libraries/System.Data.Common/src/System/Data/SimpleType.cs +++ b/src/libraries/System.Data.Common/src/System/Data/SimpleType.cs @@ -74,7 +74,7 @@ namespace System.Data if (_baseSimpleType != null && _baseSimpleType.Name != null && _baseSimpleType.Name.Length > 0) { - _xmlBaseType = _baseSimpleType.XmlBaseType;// SimpleTypeQualifiedName; + _xmlBaseType = _baseSimpleType.XmlBaseType; // SimpleTypeQualifiedName; } else { diff --git a/src/libraries/System.Data.Common/src/System/Data/UniqueConstraint.cs b/src/libraries/System.Data.Common/src/System/Data/UniqueConstraint.cs index 8d4b4ee7b7f..38b84a22efe 100644 --- a/src/libraries/System.Data.Common/src/System/Data/UniqueConstraint.cs +++ b/src/libraries/System.Data.Common/src/System/Data/UniqueConstraint.cs @@ -280,7 +280,7 @@ namespace System.Data } else { - iDest = destination.Tables.IndexOf(Table.TableName, Table.Namespace, false);// pass false for last param to be backward compatable + iDest = destination.Tables.IndexOf(Table.TableName, Table.Namespace, false); // pass false for last param to be backward compatable } if (iDest < 0) diff --git a/src/libraries/System.Data.Common/src/System/Data/XMLDiffLoader.cs b/src/libraries/System.Data.Common/src/System/Data/XMLDiffLoader.cs index 2e6a627b5ec..d45e90a1453 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XMLDiffLoader.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XMLDiffLoader.cs @@ -374,7 +374,7 @@ namespace System.Data row.Read(); // consume the current node row.Read(); // now points to the next column //SkipWhitespaces(row); seems no need, just in case if we see other issue , this will be here as hint - continue;// add a read here! + continue; // add a read here! } if (column.IsCustomType) diff --git a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs index 6ee2c62bea4..e88572c8f1f 100644 --- a/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs +++ b/src/libraries/System.Data.Common/src/System/Data/XMLSchema.cs @@ -532,7 +532,7 @@ namespace System.Data if (items == null) return false; // empty element, threat it as table - bool isChoice = FromInference && (pt is XmlSchemaChoice);// currently we add this support for choice, just for inference + bool isChoice = FromInference && (pt is XmlSchemaChoice); // currently we add this support for choice, just for inference foreach (XmlSchemaAnnotated el in items) @@ -952,7 +952,7 @@ namespace System.Data if (relation == null) { - tableChildren.Add(child);// how about prefix for this? + tableChildren.Add(child); // how about prefix for this? if (FromInference && table.UKColumnPositionForInference == -1) { // this is done for Inference int ukColumnPosition = -1; @@ -1709,7 +1709,7 @@ namespace System.Data DataColumn parentKey; if (FromInference) { - int position = table.UKColumnPositionForInference;// we keep posiotion of unique key column here, for inference + int position = table.UKColumnPositionForInference; // we keep posiotion of unique key column here, for inference if (position == -1) foreach (DataColumn dc in table.Columns) { @@ -2203,7 +2203,7 @@ namespace System.Data { // this means UDSimpleType strType = node.QualifiedName.ToString(); // use qualifed name - type = ParseDataType(node.QualifiedName.ToString());// search with QName + type = ParseDataType(node.QualifiedName.ToString()); // search with QName } else { @@ -2435,7 +2435,7 @@ namespace System.Data { return; // backward compatability } - column = new DataColumn(columnName, type, null, MappingType.Element);// this is to fix issue with Exception we used to throw for old inference engine if column + column = new DataColumn(columnName, type, null, MappingType.Element); // this is to fix issue with Exception we used to throw for old inference engine if column //exists with different namespace; while adding it to columncollection isToAdd = true; } diff --git a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs index a39a1b44d56..59c86728cfe 100644 --- a/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs +++ b/src/libraries/System.Data.Common/src/System/Data/xmlsaver.cs @@ -927,7 +927,7 @@ namespace System.Data { xmlWriter.Flush(); } - return;// rootSchema; + return; // rootSchema; } internal XmlElement SchemaTree(XmlDocument xd, DataTable dt) diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs index 7d9e03ac052..2a3da7ad336 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/Common/NameValuePermission.cs @@ -19,7 +19,7 @@ namespace System.Data.Common private NameValuePermission[] _tree; // with branches - internal static readonly NameValuePermission Default = null;// = new NameValuePermission(String.Empty, new string[] { "File Name" }, KeyRestrictionBehavior.AllowOnly); + internal static readonly NameValuePermission Default = null; // = new NameValuePermission(String.Empty, new string[] { "File Name" }, KeyRestrictionBehavior.AllowOnly); internal NameValuePermission() { // root node diff --git a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs index ac6842e4d19..4ecf414a136 100644 --- a/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs +++ b/src/libraries/System.Data.Odbc/src/Common/System/Data/ProviderBase/DbConnectionPool.cs @@ -322,7 +322,7 @@ namespace System.Data.ProviderBase // new stack to old stack. if (_waitHandles.PoolSemaphore.WaitOne(0)) { - for (;;) + while (true) { DbConnectionInternal obj; diff --git a/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs b/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs index ac1b2edf650..acf49eb6d0f 100644 --- a/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs +++ b/src/libraries/System.Data.OleDb/src/DbConnectionOptions.cs @@ -73,7 +73,7 @@ namespace System.Data.Common private static readonly Regex ConnectionStringRegexOdbc = new Regex(ConnectionStringPatternOdbc, RegexOptions.ExplicitCapture | RegexOptions.Compiled); private static readonly Regex ConnectionStringValidValueRegex = new Regex("^[^\u0000]*$", RegexOptions.Compiled); // value not allowed to contain embedded null #endif - private static readonly Regex ConnectionStringValidKeyRegex = new Regex("^(?![;\\s])[^\\p{Cc}]+(?IsConsistent == 0) Verify(currentCategoryPointer); @@ -930,7 +930,7 @@ namespace System.Diagnostics { CounterEntry* currentCounterPointer = (CounterEntry*)(ResolveOffset(instancePointer->FirstCounterOffset, s_counterEntrySize)); CounterEntry* previousCounterPointer = currentCounterPointer; - for (; ; ) + while (true) { if (currentCounterPointer->CounterNameHashCode == counterNameHashCode) { @@ -1006,7 +1006,7 @@ namespace System.Diagnostics try { - for (; ; ) + while (true) { bool verifiedLifetimeOfThisInstance = false; if (verifyLifeTime && (currentInstancePointer->RefCount != 0)) @@ -1116,7 +1116,7 @@ namespace System.Diagnostics // 2nd pass find a free instance slot InstanceEntry* currentInstancePointer = (InstanceEntry*)(ResolveOffset(categoryPointer->FirstInstanceOffset, s_instanceEntrySize)); InstanceEntry* previousInstancePointer = currentInstancePointer; - for (; ; ) + while (true) { if (currentInstancePointer->RefCount == 0) { @@ -1404,7 +1404,7 @@ namespace System.Diagnostics try { NetFrameworkUtils.EnterMutexWithoutGlobal(_categoryData.MutexName, ref mutex); - for (; ; ) + while (true) { RemoveOneInstance(instancePointer, true); diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs index 80a72c8cd82..3080a20e05f 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Win32.cs @@ -79,7 +79,7 @@ namespace System.Diagnostics IntPtr[] moduleHandles = new IntPtr[64]; GCHandle moduleHandlesArrayHandle = new GCHandle(); int moduleCount = 0; - for (;;) + while (true) { bool enumResult = false; try diff --git a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs index 48b9df44497..18d31b84f2a 100644 --- a/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs +++ b/src/libraries/System.Diagnostics.Process/src/System/Diagnostics/ProcessManager.Windows.cs @@ -280,7 +280,7 @@ namespace System.Diagnostics { int[] processIds = new int[256]; int size; - for (; ; ) + while (true) { if (!Interop.Kernel32.EnumProcesses(processIds, processIds.Length * 4, out size)) throw new Win32Exception(); diff --git a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs index 73d52dd8c4b..1fcfd4cea91 100644 --- a/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs +++ b/src/libraries/System.Diagnostics.Tracing/tests/BasicEventSourceTest/TestEventCounter.cs @@ -259,7 +259,7 @@ namespace BasicEventSourceTests private static void Sleep(int minMSec) { var startTime = DateTime.UtcNow; - for (; ; ) + while (true) { DateTime endTime = DateTime.UtcNow; double delta = (endTime - startTime).TotalMilliseconds; diff --git a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs index 05db925606c..62ef80c1f65 100644 --- a/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs +++ b/src/libraries/System.DirectoryServices/src/System/DirectoryServices/ActiveDirectory/Utils.cs @@ -1941,7 +1941,7 @@ namespace System.DirectoryServices.ActiveDirectory if (serverName.EndsWith("]")) { //[IPv6] - serverName = serverName.Substring(1, serverName.Length - 2);//2 for [] + serverName = serverName.Substring(1, serverName.Length - 2); //2 for [] return serverName; } int closingBrace = serverName.LastIndexOf("]:"); diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs index 281d1f02d6e..6bc6cbec451 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/GdiplusNative.cs @@ -1391,8 +1391,8 @@ namespace System.Drawing // dealing with function *'s and what not - so we make explicit calls // to gdi+ after the fact, via the GdiplusNotificationHook and // GdiplusNotificationUnhook methods. - public IntPtr hook;//not used - public IntPtr unhook;//not used. + public IntPtr hook; //not used + public IntPtr unhook; //not used. } } } diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/SystemColorTracker.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/SystemColorTracker.cs index 59b56541618..892bbde0eb7 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/SystemColorTracker.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Internal/SystemColorTracker.cs @@ -75,7 +75,7 @@ namespace System.Drawing.Internal // Loop invariant: everything to the left of "left" is a valid reference, // and anything to the right of "right" is broken. - for (;;) + while (true) { while (left < length && list[left].Target != null) left++; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/NativeMethods.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/NativeMethods.cs index bba4cf9a5ec..505a0d20ff9 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/NativeMethods.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/NativeMethods.cs @@ -32,7 +32,7 @@ namespace System.Drawing [StructLayout(LayoutKind.Sequential)] internal struct BITMAPINFO_FLAT { - public int bmiHeader_biSize;// = Marshal.SizeOf(typeof(BITMAPINFOHEADER)); + public int bmiHeader_biSize; // = Marshal.SizeOf(typeof(BITMAPINFOHEADER)); public int bmiHeader_biWidth; public int bmiHeader_biHeight; public short bmiHeader_biPlanes; diff --git a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintController.Windows.cs b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintController.Windows.cs index f2ed4fa3612..2780d945153 100644 --- a/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintController.Windows.cs +++ b/src/libraries/System.Drawing.Common/src/System/Drawing/Printing/PrintController.Windows.cs @@ -152,7 +152,7 @@ namespace System.Drawing.Printing private bool PrintLoop(PrintDocument document) { QueryPageSettingsEventArgs queryEvent = new QueryPageSettingsEventArgs((PageSettings)document.DefaultPageSettings.Clone()); - for (;;) + while (true) { document._OnQueryPageSettings(queryEvent); if (queryEvent.Cancel) @@ -194,7 +194,7 @@ namespace System.Drawing.Printing PrintPageEventArgs pageEvent = null; PageSettings documentPageSettings = (PageSettings)document.DefaultPageSettings.Clone(); QueryPageSettingsEventArgs queryEvent = new QueryPageSettingsEventArgs(documentPageSettings); - for (;;) + while (true) { queryEvent.PageSettingsChanged = false; document._OnQueryPageSettings(queryEvent); diff --git a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs index 6c961bffd34..8a5ed382de4 100644 --- a/src/libraries/System.IO.FileSystem/src/System/IO/File.cs +++ b/src/libraries/System.IO.FileSystem/src/System/IO/File.cs @@ -707,7 +707,7 @@ namespace System.IO cancellationToken.ThrowIfCancellationRequested(); buffer = ArrayPool.Shared.Rent(sr.CurrentEncoding.GetMaxCharCount(DefaultBufferSize)); StringBuilder sb = new StringBuilder(); - for (;;) + while (true) { #if MS_IO_REDIST int read = await sr.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false); diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs index a102acfe706..1d02d67d8c3 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/BindingRestrictions.cs @@ -213,7 +213,7 @@ namespace System.Dynamic // left most node each iteration. var stack = new Stack(); BindingRestrictions top = this; - for (;;) + while (true) { var m = top as MergedRestriction; if (m != null) @@ -370,7 +370,7 @@ namespace System.Dynamic // left most node each iteration. var stack = new Stack(); BindingRestrictions top = _node; - for (;;) + while (true) { var m = top as MergedRestriction; if (m != null) diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs index 8f158b24b56..60b50670106 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/UpdateDelegates.Generated.cs @@ -111,7 +111,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -257,7 +257,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -403,7 +403,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -549,7 +549,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -695,7 +695,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -841,7 +841,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -987,7 +987,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1133,7 +1133,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1279,7 +1279,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1425,7 +1425,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1570,7 +1570,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1715,7 +1715,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -1860,7 +1860,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2005,7 +2005,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2150,7 +2150,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2295,7 +2295,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2440,7 +2440,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2585,7 +2585,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2730,7 +2730,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); @@ -2875,7 +2875,7 @@ namespace System.Dynamic rule = null; var args = new object[] { arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9 }; - for (; ; ) + while (true) { @this.Target = originalRule; rule = @this.Target = @this.Binder.BindCore(@this, args); diff --git a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs index 72ba219e9c5..28572431eba 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Dynamic/Utils/TypeUtils.cs @@ -296,7 +296,7 @@ namespace System.Dynamic.Utils // This method catches the cases that were incorrectly disallowed, but when it needs to // examine possible conversions of element or type parameters it applies stricter rules. - for (;;) + while (true) { if (!skipNonArray) // Skip if we just came from HasReferenceConversionTo and have just tested these { diff --git a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs index f2f8d7fa92c..cab97eb9b68 100644 --- a/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs +++ b/src/libraries/System.Linq.Expressions/src/System/Linq/Expressions/Compiler/LambdaCompiler.Statements.cs @@ -529,7 +529,7 @@ namespace System.Linq.Expressions.Compiler private void EmitSwitchBuckets(SwitchInfo info, List> buckets, int first, int last) { - for (;;) + while (true) { if (first == last) { diff --git a/src/libraries/System.Linq.Expressions/tests/Dynamic/BindingRestrictionsProxyTests.cs b/src/libraries/System.Linq.Expressions/tests/Dynamic/BindingRestrictionsProxyTests.cs index 44df241ce15..e2b091a2893 100644 --- a/src/libraries/System.Linq.Expressions/tests/Dynamic/BindingRestrictionsProxyTests.cs +++ b/src/libraries/System.Linq.Expressions/tests/Dynamic/BindingRestrictionsProxyTests.cs @@ -170,7 +170,7 @@ namespace System.Dynamic.Tests Assert.Equal(ExpressionType.AndAlso, vExp.NodeType); Stack toSplit = new Stack(); - for (;;) + while (true) { if (vExp.NodeType == ExpressionType.AndAlso) { diff --git a/src/libraries/System.Linq.Expressions/tests/ILReader/SigParser.cs b/src/libraries/System.Linq.Expressions/tests/ILReader/SigParser.cs index b2f7c78181b..34bf64e340f 100644 --- a/src/libraries/System.Linq.Expressions/tests/ILReader/SigParser.cs +++ b/src/libraries/System.Linq.Expressions/tests/ILReader/SigParser.cs @@ -491,7 +491,7 @@ namespace System.Linq.Expressions.Tests bool ParseOptionalCustomModsOrConstraint() { - for (;;) + while (true) { if (pbCur >= pbEnd) return true; @@ -517,7 +517,7 @@ namespace System.Linq.Expressions.Tests bool ParseOptionalCustomMods() { - for (;;) + while (true) { if (pbCur >= pbEnd) return true; diff --git a/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs b/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs index 0c60d9c2421..583b85c6f81 100644 --- a/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs +++ b/src/libraries/System.Management/src/System/Management/InteropClasses/WMIInterop.cs @@ -138,7 +138,7 @@ namespace System.Management ppQualSet = null; else ppQualSet = new IWbemQualifierSetFreeThreaded(pQualSet); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int Get_(string wszName, int lFlags, ref object pVal, ref int pType, ref int plFlavor) @@ -160,7 +160,7 @@ namespace System.Management pVal = DBNull.Value; } } - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hr; } public int Put_(string wszName, int lFlags, ref object pVal, int Type) @@ -168,24 +168,24 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.Put_f(5, pWbemClassObject, wszName, lFlags, ref pVal, Type); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int Delete_(string wszName) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.Delete_f(6, pWbemClassObject, wszName); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetNames_(string wszQualifierName, int lFlags, ref object pQualifierVal, out string[] pNames) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.GetNames_f(7, pWbemClassObject, wszQualifierName, lFlags, ref pQualifierVal, out pNames); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int BeginEnumeration_(int lEnumFlags) @@ -193,8 +193,8 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.BeginEnumeration_f(8, pWbemClassObject, lEnumFlags); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int Next_(int lFlags, ref string strName, ref object pVal, ref int pType, ref int plFlavor) { @@ -203,16 +203,16 @@ namespace System.Management pVal = null; strName = null; int res = WmiNetUtilsHelper.Next_f(9, pWbemClassObject, lFlags, ref strName, ref pVal, ref pType, ref plFlavor); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int EndEnumeration_() { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.EndEnumeration_f(10, pWbemClassObject); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetPropertyQualifierSet_(string wszProperty, out IWbemQualifierSetFreeThreaded ppQualSet) { @@ -225,7 +225,7 @@ namespace System.Management else ppQualSet = new IWbemQualifierSetFreeThreaded(pQualSet); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int Clone_(out IWbemClassObjectFreeThreaded ppCopy) @@ -239,7 +239,7 @@ namespace System.Management else ppCopy = new IWbemClassObjectFreeThreaded(pWbemClassObjectNew); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int GetObjectText_(int lFlags, out string pstrObjectText) @@ -247,8 +247,8 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.GetObjectText_f(13, pWbemClassObject, lFlags, out pstrObjectText); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int SpawnDerivedClass_(int lFlags, out IWbemClassObjectFreeThreaded ppNewClass) { @@ -261,7 +261,7 @@ namespace System.Management else ppNewClass = new IWbemClassObjectFreeThreaded(pWbemClassObjectNew); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int SpawnInstance_(int lFlags, out IWbemClassObjectFreeThreaded ppNewInstance) @@ -275,7 +275,7 @@ namespace System.Management else ppNewInstance = new IWbemClassObjectFreeThreaded(pWbemClassObjectNew); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int CompareTo_(int lFlags, IWbemClassObjectFreeThreaded pCompareTo) @@ -283,24 +283,24 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.CompareTo_f(16, pWbemClassObject, lFlags, pCompareTo.pWbemClassObject); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetPropertyOrigin_(string wszName, out string pstrClassName) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.GetPropertyOrigin_f(17, pWbemClassObject, wszName, out pstrClassName); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int InheritsFrom_(string strAncestor) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.InheritsFrom_f(18, pWbemClassObject, strAncestor); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetMethod_(string wszName, int lFlags, out IWbemClassObjectFreeThreaded ppInSignature, out IWbemClassObjectFreeThreaded ppOutSignature) { @@ -320,7 +320,7 @@ namespace System.Management ppOutSignature = new IWbemClassObjectFreeThreaded(pOutSignature); } - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int PutMethod_(string wszName, int lFlags, IWbemClassObjectFreeThreaded pInSignature, IWbemClassObjectFreeThreaded pOutSignature) @@ -328,24 +328,24 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.PutMethod_f(20, pWbemClassObject, wszName, lFlags, pInSignature, pOutSignature); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int DeleteMethod_(string wszName) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.DeleteMethod_f(21, pWbemClassObject, wszName); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int BeginMethodEnumeration_(int lEnumFlags) { if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.BeginMethodEnumeration_f(22, pWbemClassObject, lEnumFlags); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int NextMethod_(int lFlags, out string pstrName, out IWbemClassObjectFreeThreaded ppInSignature, out IWbemClassObjectFreeThreaded ppOutSignature) { @@ -365,7 +365,7 @@ namespace System.Management if (pOutSignature != IntPtr.Zero) ppOutSignature = new IWbemClassObjectFreeThreaded(pOutSignature); } - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int EndMethodEnumeration_() @@ -373,8 +373,8 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.EndMethodEnumeration_f(24, pWbemClassObject); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetMethodQualifierSet_(string wszMethod, out IWbemQualifierSetFreeThreaded ppQualSet) { @@ -386,7 +386,7 @@ namespace System.Management ppQualSet = null; else ppQualSet = new IWbemQualifierSetFreeThreaded(pQualSet); - GC.KeepAlive ( this ) ; + GC.KeepAlive(this); return hResult; } public int GetMethodOrigin_(string wszMethodName, out string pstrClassName) @@ -394,8 +394,8 @@ namespace System.Management if (pWbemClassObject == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.GetMethodOrigin_f(26, pWbemClassObject, wszMethodName, out pstrClassName); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } private enum STATFLAG @@ -435,7 +435,7 @@ namespace System.Management public void Dispose() { - Dispose_(false) ; + Dispose_(false); } private void Dispose_( bool finalization ) @@ -463,8 +463,8 @@ namespace System.Management if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierGet_f(3, pWbemQualifierSet, wszName, lFlags, ref pVal, ref plFlavor); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int Put_(string wszName, ref object pVal, int lFlavor) @@ -472,48 +472,48 @@ namespace System.Management if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierPut_f(4, pWbemQualifierSet, wszName, ref pVal, lFlavor); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int Delete_(string wszName) { if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierDelete_f(5, pWbemQualifierSet, wszName); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int GetNames_(int lFlags, out string[] pNames) { if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierGetNames_f(6, pWbemQualifierSet, lFlags, out pNames); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int BeginEnumeration_(int lFlags) { if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierBeginEnumeration_f(7, pWbemQualifierSet, lFlags); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int Next_(int lFlags, out string pstrName, out object pVal, out int plFlavor) { if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierNext_f(8, pWbemQualifierSet, lFlags, out pstrName, out pVal, out plFlavor); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } public int EndEnumeration_() { if (pWbemQualifierSet == IntPtr.Zero) throw new ObjectDisposedException(name); int res = WmiNetUtilsHelper.QualifierEndEnumeration_f(9, pWbemQualifierSet); - GC.KeepAlive ( this ) ; - return res ; + GC.KeepAlive(this); + return res; } } @@ -1648,16 +1648,16 @@ namespace System.Management internal class ThreadDispatch { #region Private fields - private Thread thread ; - private Exception exception ; // Exception thrown from worker method (if any). Exposed as property. - private ThreadWorkerMethodWithReturn threadWorkerMethodWithReturn ; // Delegate to be called for worker method with return value - private ThreadWorkerMethodWithReturnAndParam threadWorkerMethodWithReturnAndParam ; // Delegate to be called for worker method with return value and parameter - private ThreadWorkerMethod threadWorkerMethod ; // Delegate to be called for worker method - private ThreadWorkerMethodWithParam threadWorkerMethodWithParam ; // Delegate to be called for worker method with parameter - private object threadReturn ; // Return data from worker method. - private object threadParams ; // Parameters to be passed to worker method - private bool backgroundThread ; // Is this a background thread? - private ApartmentState apartmentType ; // Apartment type of thread + private Thread thread; + private Exception exception; // Exception thrown from worker method (if any). Exposed as property. + private ThreadWorkerMethodWithReturn threadWorkerMethodWithReturn; // Delegate to be called for worker method with return value + private ThreadWorkerMethodWithReturnAndParam threadWorkerMethodWithReturnAndParam; // Delegate to be called for worker method with return value and parameter + private ThreadWorkerMethod threadWorkerMethod; // Delegate to be called for worker method + private ThreadWorkerMethodWithParam threadWorkerMethodWithParam; // Delegate to be called for worker method with parameter + private object threadReturn; // Return data from worker method. + private object threadParams; // Parameters to be passed to worker method + private bool backgroundThread; // Is this a background thread? + private ApartmentState apartmentType; // Apartment type of thread #endregion #region Properties @@ -1669,7 +1669,7 @@ namespace System.Management { get { - return this.exception ; + return this.exception; } } @@ -1680,11 +1680,11 @@ namespace System.Management { get { - return this.threadParams ; + return this.threadParams; } set { - this.threadParams = value ; + this.threadParams = value; } } @@ -1695,11 +1695,11 @@ namespace System.Management { get { - return this.backgroundThread ; + return this.backgroundThread; } set { - this.backgroundThread = value ; + this.backgroundThread = value; } } @@ -1710,7 +1710,7 @@ namespace System.Management { get { - return this.threadReturn ; + return this.threadReturn; } } @@ -1722,11 +1722,11 @@ namespace System.Management { get { - return this.apartmentType ; + return this.apartmentType; } set { - this.apartmentType = value ; + this.apartmentType = value; } } #endregion @@ -1735,22 +1735,22 @@ namespace System.Management /// /// Delegate declaration representing signature of worker method with return value. /// - public delegate object ThreadWorkerMethodWithReturn ( ) ; + public delegate object ThreadWorkerMethodWithReturn ( ); /// /// Delegate declaration representing signature of worker method with return value and parameter. /// - public delegate object ThreadWorkerMethodWithReturnAndParam ( object param ) ; + public delegate object ThreadWorkerMethodWithReturnAndParam ( object param ); /// /// Delegate declaration representing signature of worker method with no return value and no parameter /// - public delegate void ThreadWorkerMethod ( ) ; + public delegate void ThreadWorkerMethod ( ); /// /// Delegate declaration representing signature of worker method with parameter. /// - public delegate void ThreadWorkerMethodWithParam ( object param ) ; + public delegate void ThreadWorkerMethodWithParam ( object param ); #endregion #region Public methods @@ -1764,7 +1764,7 @@ namespace System.Management /// Delegate to be called to perform the work public ThreadDispatch ( ThreadWorkerMethodWithReturn workerMethod ) : this ( ) { - InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ) ; + InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ); } /// @@ -1777,7 +1777,7 @@ namespace System.Management /// Delegate to be called to perform the work public ThreadDispatch ( ThreadWorkerMethodWithReturnAndParam workerMethod ) : this ( ) { - InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ) ; + InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ); } /// @@ -1790,7 +1790,7 @@ namespace System.Management /// Delegate to be called to perform the work public ThreadDispatch ( ThreadWorkerMethodWithParam workerMethod ) : this ( ) { - InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ) ; + InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ); } /// @@ -1803,7 +1803,7 @@ namespace System.Management /// Delegate to be called to perform the work public ThreadDispatch ( ThreadWorkerMethod workerMethod ) : this ( ) { - InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ) ; + InitializeThreadState ( null, workerMethod, ApartmentState.MTA, false ); } /// @@ -1812,11 +1812,11 @@ namespace System.Management /// public void Start ( ) { - this.exception = null ; - DispatchThread ( ) ; + this.exception = null; + DispatchThread(); if ( this.Exception != null ) { - throw this.Exception ; + throw this.Exception; } } #endregion @@ -1828,16 +1828,16 @@ namespace System.Management /// private ThreadDispatch ( ) { - this.thread = null ; - this.exception = null ; - this.threadParams = null ; - this.threadWorkerMethodWithReturn = null ; - this.threadWorkerMethodWithReturnAndParam = null ; - this.threadWorkerMethod = null ; - this.threadWorkerMethodWithParam = null; - this.threadReturn = null ; - this.backgroundThread = false ; - this.apartmentType = ApartmentState.MTA ; + this.thread = null; + this.exception = null; + this.threadParams = null; + this.threadWorkerMethodWithReturn = null; + this.threadWorkerMethodWithReturnAndParam = null; + this.threadWorkerMethod = null; + this.threadWorkerMethodWithParam = null; + this.threadReturn = null; + this.backgroundThread = false; + this.apartmentType = ApartmentState.MTA; } /// @@ -1849,11 +1849,11 @@ namespace System.Management /// Thread is created as a background or not private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturn workerMethod, ApartmentState aptState, bool background ) { - this.threadParams = threadParams ; - this.threadWorkerMethodWithReturn = workerMethod ; - this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturn ) ) ; - this.thread.SetApartmentState(aptState) ; - this.backgroundThread = background ; + this.threadParams = threadParams; + this.threadWorkerMethodWithReturn = workerMethod; + this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturn ) ); + this.thread.SetApartmentState(aptState); + this.backgroundThread = background; } /// @@ -1865,11 +1865,11 @@ namespace System.Management /// Thread is created as a background or not private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithReturnAndParam workerMethod, ApartmentState aptState, bool background ) { - this.threadParams = threadParams ; - this.threadWorkerMethodWithReturnAndParam = workerMethod ; - this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturnAndParam ) ) ; + this.threadParams = threadParams; + this.threadWorkerMethodWithReturnAndParam = workerMethod; + this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithReturnAndParam ) ); this.thread.SetApartmentState(aptState); - this.backgroundThread = background ; + this.backgroundThread = background; } /// @@ -1881,11 +1881,11 @@ namespace System.Management /// Thread is created as a background or not private void InitializeThreadState ( object threadParams, ThreadWorkerMethod workerMethod, ApartmentState aptState, bool background ) { - this.threadParams = threadParams ; - this.threadWorkerMethod = workerMethod ; - this.thread = new Thread ( new ThreadStart ( ThreadEntryPoint ) ) ; + this.threadParams = threadParams; + this.threadWorkerMethod = workerMethod; + this.thread = new Thread ( new ThreadStart ( ThreadEntryPoint ) ); this.thread.SetApartmentState(aptState ); - this.backgroundThread = background ; + this.backgroundThread = background; } /// @@ -1897,11 +1897,11 @@ namespace System.Management /// Thread is created as a background or not private void InitializeThreadState ( object threadParams, ThreadWorkerMethodWithParam workerMethod, ApartmentState aptState, bool background ) { - this.threadParams = threadParams ; - this.threadWorkerMethodWithParam = workerMethod ; - this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithParam ) ) ; + this.threadParams = threadParams; + this.threadWorkerMethodWithParam = workerMethod; + this.thread = new Thread ( new ThreadStart ( ThreadEntryPointMethodWithParam ) ); this.thread.SetApartmentState( aptState ); - this.backgroundThread = background ; + this.backgroundThread = background; } @@ -1910,8 +1910,8 @@ namespace System.Management /// private void DispatchThread ( ) { - this.thread.Start ( ) ; - this.thread.Join ( ) ; + this.thread.Start(); + this.thread.Join(); } /// @@ -1923,11 +1923,11 @@ namespace System.Management { try { - this.threadWorkerMethod ( ) ; + this.threadWorkerMethod(); } - catch ( Exception e ) + catch (Exception e) { - this.exception = e ; + this.exception = e; } } @@ -1941,11 +1941,11 @@ namespace System.Management { try { - this.threadWorkerMethodWithParam ( this.threadParams ) ; + this.threadWorkerMethodWithParam ( this.threadParams ); } - catch ( Exception e ) + catch (Exception e) { - this.exception = e ; + this.exception = e; } } @@ -1959,11 +1959,11 @@ namespace System.Management { try { - this.threadReturn = this.threadWorkerMethodWithReturn ( ) ; + this.threadReturn = this.threadWorkerMethodWithReturn(); } - catch ( Exception e ) + catch (Exception e) { - this.exception = e ; + this.exception = e; } } @@ -1977,11 +1977,11 @@ namespace System.Management { try { - this.threadReturn = this.threadWorkerMethodWithReturnAndParam ( this.threadParams) ; + this.threadReturn = this.threadWorkerMethodWithReturnAndParam(this.threadParams); } - catch ( Exception e ) + catch (Exception e) { - this.exception = e ; + this.exception = e; } } #endregion diff --git a/src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs b/src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs index 80480436df2..24b1530b593 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementBaseObject.cs @@ -213,7 +213,7 @@ namespace System.Management } } - internal IWbemClassObjectFreeThreaded _wbemObject ; + internal IWbemClassObjectFreeThreaded _wbemObject; private PropertyDataCollection properties; private PropertyDataCollection systemProperties; @@ -342,7 +342,7 @@ namespace System.Management { get { - Initialize ( true ) ; + Initialize ( true ); if (properties == null) properties = new PropertyDataCollection(this, false); @@ -364,7 +364,7 @@ namespace System.Management { get { - Initialize ( false ) ; + Initialize ( false ); if (systemProperties == null) systemProperties = new PropertyDataCollection(this, true); @@ -387,7 +387,7 @@ namespace System.Management { get { - Initialize ( true ) ; + Initialize ( true ); if (qualifiers == null) qualifiers = new QualifierDataCollection(this); @@ -479,7 +479,7 @@ namespace System.Management get { return GetPropertyValue(propertyName); } set { - Initialize ( true ) ; + Initialize ( true ); try { SetPropertyValue (propertyName, value); diff --git a/src/libraries/System.Management/src/System/Management/ManagementClass.cs b/src/libraries/System.Management/src/System/Management/ManagementClass.cs index e775c901641..5380fad4939 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementClass.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementClass.cs @@ -382,7 +382,7 @@ namespace System.Management { get { - Initialize ( true ) ; + Initialize ( true ); if (methods == null) methods = new MethodDataCollection(this); @@ -585,7 +585,7 @@ namespace System.Management if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone(); @@ -682,7 +682,7 @@ namespace System.Management if (null == Path) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); IEnumWbemClassObject enumWbem = null; EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone(); @@ -743,7 +743,7 @@ namespace System.Management if (null == Path) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); EnumerationOptions o = (null == options) ? new EnumerationOptions() : (EnumerationOptions)options.Clone(); @@ -1032,7 +1032,7 @@ namespace System.Management if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); IEnumWbemClassObject enumWbem = null; @@ -1130,7 +1130,7 @@ namespace System.Management if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length)) throw new InvalidOperationException(); - Initialize ( true ) ; + Initialize ( true ); if (null == watcher) throw new ArgumentNullException(nameof(watcher)); @@ -1241,7 +1241,7 @@ namespace System.Management if ((null == Path) || (null == Path.Path) || (0 == Path.Path.Length)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); IEnumWbemClassObject enumWbem = null; @@ -1334,7 +1334,7 @@ namespace System.Management throw new ArgumentNullException(nameof(watcher)); else { - Initialize ( true ) ; + Initialize ( true ); EnumerationOptions o = (null != options) ? (EnumerationOptions)options.Clone() : new EnumerationOptions(); diff --git a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs index 313571db6b1..3c5618f77f5 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementEventWatcher.cs @@ -614,7 +614,7 @@ namespace System.Management private int status; private readonly bool isLocal; - public int Status {get {return status;} set {status=value;}} + public int Status {get {return status; } set {status=value; }} public SinkForEventQuery (ManagementEventWatcher eventWatcher, object context, @@ -640,16 +640,16 @@ namespace System.Management // // Ensure we are able to trap exceptions from worker thread. // - ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( HackToCreateStubInMTA ) ) ; - disp.Parameter = this ; - disp.Start ( ) ; + ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( HackToCreateStubInMTA ) ); + disp.Parameter = this; + disp.Start ( ); } } private void HackToCreateStubInMTA(object param) { - SinkForEventQuery obj = (SinkForEventQuery) param ; + SinkForEventQuery obj = (SinkForEventQuery) param; object dmuxStub = null; obj.Status = WmiNetUtilsHelper.GetDemultiplexedStub_f (obj, obj.isLocal, out dmuxStub); obj.stub = (IWbemObjectSink) dmuxStub; diff --git a/src/libraries/System.Management/src/System/Management/ManagementObject.cs b/src/libraries/System.Management/src/System/Management/ManagementObject.cs index ccf9950454a..adf603dc0d4 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementObject.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementObject.cs @@ -772,7 +772,7 @@ namespace System.Management { IWbemClassObjectFreeThreaded tempObj = null; - Initialize ( false ) ; // this may throw + Initialize ( false ); // this may throw if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); @@ -894,7 +894,7 @@ namespace System.Management /// public void Get(ManagementOperationObserver watcher) { - Initialize ( false ) ; + Initialize ( false ); if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); @@ -1035,7 +1035,7 @@ namespace System.Management if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); IEnumWbemClassObject enumWbem = null; EnumerationOptions o = (null != options) ? options : new EnumerationOptions(); @@ -1152,7 +1152,7 @@ namespace System.Management if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); - Initialize ( true ) ; + Initialize ( true ); if (null == watcher) throw new ArgumentNullException(nameof(watcher)); @@ -1273,7 +1273,7 @@ namespace System.Management if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); IEnumWbemClassObject enumWbem = null; EnumerationOptions o = @@ -1384,7 +1384,7 @@ namespace System.Management throw new ArgumentNullException(nameof(watcher)); else { - Initialize ( false ) ; + Initialize ( false ); // Ensure we switch off ReturnImmediately as this is invalid for async calls EnumerationOptions o = @@ -1464,7 +1464,7 @@ namespace System.Management public ManagementPath Put(PutOptions options) { ManagementPath newPath = null; - Initialize ( true ) ; + Initialize ( true ); PutOptions o = (null != options) ? options : new PutOptions(); IWbemServices wbemServices = scope.GetIWbemServices(); @@ -1627,7 +1627,7 @@ namespace System.Management throw new ArgumentNullException(nameof(watcher)); else { - Initialize ( false ) ; + Initialize ( false ); PutOptions o = (null == options) ? new PutOptions() : (PutOptions)options.Clone(); @@ -1753,7 +1753,7 @@ namespace System.Management /// public ManagementPath CopyTo(ManagementPath path, PutOptions options) { - Initialize ( false ) ; + Initialize ( false ); ManagementScope destinationScope = null; @@ -1888,7 +1888,7 @@ namespace System.Management throw new ArgumentNullException(nameof(watcher)); else { - Initialize ( false ) ; + Initialize ( false ); ManagementScope destinationScope = null; destinationScope = new ManagementScope(path, scope); @@ -1965,7 +1965,7 @@ namespace System.Management if ((null == path) || (path.Path.Length==0)) throw new InvalidOperationException(); - Initialize ( false ) ; + Initialize ( false ); DeleteOptions o = (null != options) ? options : new DeleteOptions(); IWbemServices wbemServices = scope.GetIWbemServices(); @@ -2032,7 +2032,7 @@ namespace System.Management throw new ArgumentNullException(nameof(watcher)); else { - Initialize ( false ) ; + Initialize ( false ); DeleteOptions o = (null != options) ? (DeleteOptions) options.Clone() : new DeleteOptions(); // If someone has registered for progress, make sure we flag it @@ -2156,7 +2156,7 @@ namespace System.Management throw new ArgumentNullException(nameof(methodName)); else { - Initialize ( false ) ; + Initialize ( false ); // Map args into a inparams structure ManagementBaseObject inParameters; @@ -2203,7 +2203,7 @@ namespace System.Management throw new ArgumentNullException(nameof(methodName)); else { - Initialize ( false ) ; + Initialize ( false ); // Map args into a inparams structure ManagementBaseObject inParameters; @@ -2302,7 +2302,7 @@ namespace System.Management throw new ArgumentNullException(nameof(methodName)); else { - Initialize ( false ) ; + Initialize ( false ); InvokeMethodOptions o = (null != options) ? options : new InvokeMethodOptions(); IWbemServices wbemServices = scope.GetIWbemServices(); @@ -2372,7 +2372,7 @@ namespace System.Management throw new ArgumentNullException(nameof(methodName)); else { - Initialize ( false ) ; + Initialize ( false ); InvokeMethodOptions o = (null != options) ? (InvokeMethodOptions) options.Clone() : new InvokeMethodOptions(); @@ -2454,7 +2454,7 @@ namespace System.Management throw new ArgumentNullException(nameof(methodName)); else { - Initialize ( false ) ; + Initialize ( false ); // Do we have the class? if (null == wmiClass) diff --git a/src/libraries/System.Management/src/System/Management/ManagementObjectCollection.cs b/src/libraries/System.Management/src/System/Management/ManagementObjectCollection.cs index caafa9d747a..b6a5967dddc 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementObjectCollection.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementObjectCollection.cs @@ -102,7 +102,7 @@ namespace System.Management { if (!isDisposed) { - Dispose ( true ) ; + Dispose ( true ); } } @@ -145,12 +145,12 @@ namespace System.Management // int count = 0; - IEnumerator enumCol = this.GetEnumerator ( ) ; + IEnumerator enumCol = this.GetEnumerator ( ); while ( enumCol.MoveNext() == true ) { - count++ ; + count++; } - return count ; + return count; } } diff --git a/src/libraries/System.Management/src/System/Management/ManagementOptions.cs b/src/libraries/System.Management/src/System/Management/ManagementOptions.cs index a3bec52fa84..834cad17fdd 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementOptions.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementOptions.cs @@ -427,7 +427,7 @@ namespace System.Management { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) != 0) ? true : false); } set { Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) : - (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE) ; } + (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_ENSURE_LOCATABLE); } } @@ -448,7 +448,7 @@ namespace System.Management { return (((Flags & (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) != 0) ? true : false); } set { Flags = (value == true) ? (Flags | (int)tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) : - (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE) ; } + (Flags & (int)~tag_WBEM_QUERY_FLAG_TYPE.WBEM_FLAG_PROTOTYPE); } } /// @@ -467,7 +467,7 @@ namespace System.Management { return (((Flags & (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) != 0) ? true : false); } set { Flags = (value == true) ? (Flags | (int)tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) : - (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ) ; } + (Flags & (int)~tag_WBEM_GENERIC_FLAG_TYPE.WBEM_FLAG_DIRECT_READ); } } @@ -1330,7 +1330,7 @@ namespace System.Management if (securePassword == null) { securePassword = new SecureString(); - for ( int i=0; i public virtual string QueryString { - get {return (null != queryString) ? queryString : string.Empty;} + get {return (null != queryString) ? queryString : string.Empty; } set { if (queryString != value) { ParseQuery (value); // this may throw @@ -95,7 +95,7 @@ namespace System.Management /// public virtual string QueryLanguage { - get {return (null != queryLanguage) ? queryLanguage : string.Empty;} + get {return (null != queryLanguage) ? queryLanguage : string.Empty; } set { if (queryLanguage != value) { queryLanguage = value; @@ -538,7 +538,7 @@ namespace System.Management public override string QueryLanguage { get - {return base.QueryLanguage;} + {return base.QueryLanguage; } } //ICloneable @@ -782,7 +782,7 @@ namespace System.Management // We need to force a rebuild as we may not have detected // a change to selected properties BuildQuery (); - return base.QueryString;} + return base.QueryString; } set { base.QueryString = value; } @@ -2699,7 +2699,7 @@ namespace System.Management public override string QueryLanguage { get - {return base.QueryLanguage;} + {return base.QueryLanguage; } } /// diff --git a/src/libraries/System.Management/src/System/Management/ManagementScope.cs b/src/libraries/System.Management/src/System/Management/ManagementScope.cs index 1d4eea1225e..bc7bcd237c7 100644 --- a/src/libraries/System.Management/src/System/Management/ManagementScope.cs +++ b/src/libraries/System.Management/src/System/Management/ManagementScope.cs @@ -957,9 +957,9 @@ namespace System.Management // // Ensure we are able to trap exceptions from worker thread. // - ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( InitializeGuts ) ) ; - disp.Parameter = this ; - disp.Start ( ) ; + ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethodWithParam ( InitializeGuts ) ); + disp.Parameter = this; + disp.Start ( ); } else InitializeGuts(this); @@ -970,7 +970,7 @@ namespace System.Management private void InitializeGuts(object o) { - ManagementScope threadParam = (ManagementScope) o ; + ManagementScope threadParam = (ManagementScope) o; IWbemLocator loc = (IWbemLocator) new WbemLocator(); IntPtr punk = IntPtr.Zero; diff --git a/src/libraries/System.Management/src/System/Management/Property.cs b/src/libraries/System.Management/src/System/Management/Property.cs index a2eb4f370bd..cf34ccb25d8 100644 --- a/src/libraries/System.Management/src/System/Management/Property.cs +++ b/src/libraries/System.Management/src/System/Management/Property.cs @@ -191,7 +191,7 @@ namespace System.Management { get { RefreshPropertyInfo(); - return ((propertyFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_ORIGIN_PROPAGATED) != 0) ? false : true ; } + return ((propertyFlavor & (int)tag_WBEM_FLAVOR_TYPE.WBEM_FLAVOR_ORIGIN_PROPAGATED) != 0) ? false : true; } } /// @@ -204,7 +204,7 @@ namespace System.Management { get { RefreshPropertyInfo(); - return ((propertyType & (int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY) != 0);} + return ((propertyType & (int)tag_CIMTYPE_ENUMERATION.CIM_FLAG_ARRAY) != 0); } } /// diff --git a/src/libraries/System.Management/src/System/Management/WMIGenerator.cs b/src/libraries/System.Management/src/System/Management/WMIGenerator.cs index 799ebc15c1a..dd0b5ce9ba7 100644 --- a/src/libraries/System.Management/src/System/Management/WMIGenerator.cs +++ b/src/libraries/System.Management/src/System/Management/WMIGenerator.cs @@ -560,7 +560,7 @@ namespace System.Management bool bStart = false; int Len = OriginalNamespace.Length; OriginalNamespace = string.Empty; - for (int i = 2 ; i < Len ; i++) + for (int i = 2; i < Len; i++) { if (bStart == true) { @@ -931,7 +931,7 @@ namespace System.Management { cmp = new CodeMemberProperty (); cmp.Name = propName; - cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final ; + cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final; cmp.Type = new CodeTypeReference(propType); caa = new CodeAttributeArgument(); @@ -1100,7 +1100,7 @@ namespace System.Management SysPropsClass.Members.Add(cctor); caa = new CodeAttributeArgument(); - caa.Value = new CodeTypeOfExpression (typeof(System.ComponentModel.ExpandableObjectConverter)) ; + caa.Value = new CodeTypeOfExpression (typeof(System.ComponentModel.ExpandableObjectConverter)); cad = new CodeAttributeDeclaration(); cad.Name = PublicNamesUsed["TypeConverter"].ToString(); cad.Arguments.Add(caa); @@ -1124,7 +1124,7 @@ namespace System.Management //Now we will have to find the occurrence of the first character and trim all the characters before that strPropTemp = prop.Name.ToCharArray(); - for (i=0;i < strPropTemp.Length;i++) + for (i=0; i < strPropTemp.Length; i++) { if (char.IsLetterOrDigit(strPropTemp[i]) == true) { @@ -1136,7 +1136,7 @@ namespace System.Management i = 0; } strPropName = new char[strPropTemp.Length - i]; - for (int j=i;j < strPropTemp.Length;j++) + for (int j=i; j < strPropTemp.Length; j++) { strPropName[j - i] = strPropTemp[j]; } @@ -1155,7 +1155,7 @@ namespace System.Management //private WmiObject _privObject cf = new CodeMemberField(); cf.Name = PrivateNamesUsed["LateBoundObject"].ToString(); - cf.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cf.Attributes = MemberAttributes.Private | MemberAttributes.Final; cf.Type = new CodeTypeReference(PublicNamesUsed["BaseObjClass"].ToString()); SysPropsClass.Members.Add(cf); @@ -1179,7 +1179,7 @@ namespace System.Management string IsValidPropName = string.Empty; bool bDateIsTimeInterval = false; - for (int i=0;i< PublicProperties.Count;i++) + for (int i=0; i< PublicProperties.Count; i++) { bDateIsTimeInterval = false; PropertyData prop = classobj.Properties[PublicProperties.GetKey(i).ToString()]; @@ -1307,7 +1307,7 @@ namespace System.Management // Adding TypeConverter Attribute caa = new CodeAttributeArgument(); - caa.Value = new CodeTypeOfExpression (PrivateNamesUsed["ConverterClass"].ToString()) ; + caa.Value = new CodeTypeOfExpression (PrivateNamesUsed["ConverterClass"].ToString()); cad = new CodeAttributeDeclaration(); cad.Name = PublicNamesUsed["TypeConverter"].ToString(); cad.Arguments.Add(caa); @@ -1645,7 +1645,7 @@ namespace System.Management if (q.Value != null) { string [] strArray = (string [])q.Value; - for (int i=0;i < strArray.Length ;i++) + for (int i=0; i < strArray.Length; i++) { try { @@ -1681,7 +1681,7 @@ namespace System.Management { ArrayList arTemp = new ArrayList(5); string [] strArray = (string[])q.Value; - for (int i=0;i < strArray.Length;i++) + for (int i=0; i < strArray.Length; i++) { if (strArray[i].Length == 0) { @@ -1713,7 +1713,7 @@ namespace System.Management if (q.Value != null) { string [] strArray = (string [])q.Value; - for (int i=0;i < strArray.Length;i++) + for (int i=0; i < strArray.Length; i++) { BitMap.Add(ConvertBitMapValueToInt32(strArray[i])); } @@ -1743,7 +1743,7 @@ namespace System.Management { ArrayList arTemp = new ArrayList(5); string [] strArray = (string [])q.Value; - for (int i=0;i < strArray.Length;i++) + for (int i=0; i < strArray.Length; i++) { if (strArray[i].Length == 0) { @@ -2039,7 +2039,7 @@ namespace System.Management cmm.Attributes = MemberAttributes.Private | MemberAttributes.Static | MemberAttributes.Final; cmm.ReturnType = new CodeTypeReference("System.String"); - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { strType = ((CodeTypeReference)arrKeyType[i]).BaseType; cmm.Parameters.Add(new CodeParameterDeclarationExpression(strType, @@ -2059,7 +2059,7 @@ namespace System.Management cmm.Statements.Add(new CodeVariableDeclarationStatement("System.String", strPathObject, new CodePrimitiveExpression(strPath))); CodeMethodInvokeExpression cmietoAdd; - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { if (((CodeTypeReference)arrKeyType[i]).BaseType == "System.String") { @@ -2147,7 +2147,7 @@ namespace System.Management cmieInit.Method.MethodName = PrivateNamesUsed["InitialObjectFunc"].ToString(); cmieInit.Method.TargetObject = new CodeThisReferenceExpression(); - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { cpde = new CodeParameterDeclarationExpression(); cpde.Type = new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType); @@ -2172,7 +2172,7 @@ namespace System.Management cmie.Method.TargetObject = new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString()); cmie.Method.MethodName = PublicNamesUsed["ConstructPathFunction"].ToString(); - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { cmie.Parameters.Add(new CodeVariableReferenceExpression("key"+arrKeys[i])); } @@ -2206,7 +2206,7 @@ namespace System.Management if (arrKeyType.Count > 0) { - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { cpde = new CodeParameterDeclarationExpression(); cpde.Type = new CodeTypeReference(((CodeTypeReference)arrKeyType[i]).BaseType); @@ -2233,7 +2233,7 @@ namespace System.Management cmie.Method.TargetObject = new CodeTypeReferenceExpression(PrivateNamesUsed["GeneratedClassName"].ToString()); cmie.Method.MethodName = PublicNamesUsed["ConstructPathFunction"].ToString(); - for (int i=0; i < arrKeys.Count;i++) + for (int i=0; i < arrKeys.Count; i++) { cmie.Parameters.Add(new CodeVariableReferenceExpression("key"+arrKeys[i])); } @@ -2789,7 +2789,7 @@ namespace System.Management ArrayList outParamsName = new ArrayList(5); ArrayList inoutParams = new ArrayList(5); ArrayList inoutParamsType = new ArrayList(5); - for (int k=0;k< PublicMethods.Count;k++) + for (int k=0; k< PublicMethods.Count; k++) { bStatic = false; @@ -2929,7 +2929,7 @@ namespace System.Management } //Find out whether it is a in/out Parameter - for (int i=0; i < outParamsName.Count;i++) + for (int i=0; i < outParamsName.Count; i++) { if (string.Equals(prop.Name, outParamsName[i].ToString(), StringComparison.OrdinalIgnoreCase)) { @@ -3017,7 +3017,7 @@ namespace System.Management } bInOut = false; - for (int i=0; i < inoutParams.Count;i++) + for (int i=0; i < inoutParams.Count; i++) { if (string.Equals(prop.Name, inoutParams[i].ToString(), StringComparison.OrdinalIgnoreCase)) { @@ -3167,7 +3167,7 @@ namespace System.Management //Now for each in/out params generate the statement // = outParams.Properties[""]; - for (int i=0;i < inoutParams.Count;i++) + for (int i=0; i < inoutParams.Count; i++) { cpre = new CodePropertyReferenceExpression(new CodeVariableReferenceExpression(strOutParams), "Properties"); cie = new CodeIndexerExpression(cpre, new CodePrimitiveExpression(inoutParams[i].ToString())); @@ -3278,7 +3278,7 @@ namespace System.Management { cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); @@ -3308,7 +3308,7 @@ namespace System.Management string strCondition = "condition"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression("System.String", strCondition)); @@ -3339,7 +3339,7 @@ namespace System.Management string strSelectedProperties = "selectedProperties"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression("System.String []", strSelectedProperties)); @@ -3370,7 +3370,7 @@ namespace System.Management string strCondition = "condition"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression("System.String", strCondition)); @@ -3417,7 +3417,7 @@ namespace System.Management { cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference(PublicNamesUsed["ScopeClass"].ToString()), PrivateNamesUsed["ScopeParam"].ToString())); @@ -3528,7 +3528,7 @@ namespace System.Management string strCondition = "condition"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference(PublicNamesUsed["ScopeClass"].ToString()), PrivateNamesUsed["ScopeParam"].ToString())); @@ -3559,7 +3559,7 @@ namespace System.Management string strSelectedProperties = "selectedProperties"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); cmm.Parameters.Add(new CodeParameterDeclarationExpression(PublicNamesUsed["ScopeClass"].ToString(), PrivateNamesUsed["ScopeParam"].ToString())); @@ -3600,7 +3600,7 @@ namespace System.Management string strObjectSearcher = "ObjectSearcher"; cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["FilterFunction"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["CollectionClass"].ToString()); @@ -3699,7 +3699,7 @@ namespace System.Management { cf = new CodeMemberField(); cf.Name = memberName; - cf.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cf.Attributes = MemberAttributes.Private | MemberAttributes.Final; if (isStatic == true) { cf.Attributes = cf.Attributes | MemberAttributes.Static; @@ -3751,14 +3751,14 @@ namespace System.Management */ cf = new CodeMemberField(); cf.Name = baseTypeMemberVariable; - cf.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cf.Attributes = MemberAttributes.Private | MemberAttributes.Final; cf.Type = new CodeTypeReference(PublicNamesUsed["TypeConverter"].ToString()); CodeConvertorClass.Members.Add(cf); cf = new CodeMemberField(); cf.Name = typeMemberVariable; - cf.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cf.Attributes = MemberAttributes.Private | MemberAttributes.Final; cf.Type = new CodeTypeReference(PublicNamesUsed["Type"].ToString()); CodeConvertorClass.Members.Add(cf); @@ -3771,7 +3771,7 @@ namespace System.Management } */ cctor = new CodeConstructor(); - cctor.Attributes = MemberAttributes.Public ; + cctor.Attributes = MemberAttributes.Public; cpde = new CodeParameterDeclarationExpression(); cpde.Name = baseTypeParam; cpde.Type = new CodeTypeReference("System.Type"); @@ -4247,7 +4247,7 @@ namespace System.Management ccc.BaseTypes.Add("System.Object"); ccc.BaseTypes.Add("ICollection"); - ccc.TypeAttributes =TypeAttributes.NestedPublic ; + ccc.TypeAttributes =TypeAttributes.NestedPublic; cf = new CodeMemberField(); cf.Name = strObjectCollection; @@ -4431,7 +4431,7 @@ namespace System.Management //private ManagementObjectCollection.ManagementObjectEnumerator ObjectEnumerator; cf = new CodeMemberField(); cf.Name = strObjectEnumerator; - cf.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cf.Attributes = MemberAttributes.Private | MemberAttributes.Final; cf.Type = new CodeTypeReference(strManagementObjectCollectionType+"."+ strManagementObjectEnumeratorType); ecc.Members.Add(cf); @@ -4738,7 +4738,7 @@ namespace System.Management strToAdd = "l"; } - for (int i=0;i < str.Length;i++) + for (int i=0; i < str.Length; i++) { bAdd = true; if (char.IsLetterOrDigit(arrString[i]) == false) @@ -4778,7 +4778,7 @@ namespace System.Management string strToAdd = string.Empty; IFormatProvider formatProv = (IFormatProvider)CultureInfo.InvariantCulture.GetFormat(typeof(int)); - for ( int i = 0 ; i < arrIn.Count ; i++) + for ( int i = 0; i < arrIn.Count; i++) { strToAdd = arrIn[i].ToString(); strToAdd = ResolveCollision(strToAdd, true); @@ -4842,7 +4842,7 @@ namespace System.Management case CodeLanguage.CSharp: strProvider = "C#."; - cp= new CSharpCodeProvider() ; + cp= new CSharpCodeProvider(); break; case CodeLanguage.VJSharp: @@ -5011,7 +5011,7 @@ namespace System.Management strTemp = string.Empty; char[] arrString = bitMap.ToCharArray(); int Len = bitMap.Length; - for (int i = 2 ; i < Len ; i++) + for (int i = 2; i < Len; i++) { strTemp = strTemp + arrString[i]; } @@ -5317,7 +5317,7 @@ namespace System.Management string strRetVar = "strRet"; cmp = new CodeMemberProperty (); cmp.Name = PublicNamesUsed["ClassNameProperty"].ToString(); - cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final ; + cmp.Attributes = MemberAttributes.Public | MemberAttributes.Final; cmp.Type = new CodeTypeReference("System.String"); caa = new CodeAttributeArgument(); @@ -5403,7 +5403,7 @@ namespace System.Management cmm = new CodeMemberMethod (); cmm.Name = PrivateNamesUsed["ClassNameCheckFunc"].ToString(); - cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final; cmm.ReturnType = new CodeTypeReference("System.Boolean"); cmm.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference(PublicNamesUsed["ScopeClass"].ToString()), PrivateNamesUsed["ScopeParam"].ToString())); @@ -5475,7 +5475,7 @@ namespace System.Management cmm = new CodeMemberMethod (); cmm.Name = PrivateNamesUsed["ClassNameCheckFunc"].ToString(); - cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final ; + cmm.Attributes = MemberAttributes.Private | MemberAttributes.Final; cmm.ReturnType = new CodeTypeReference("System.Boolean"); cmm.Parameters.Add(new CodeParameterDeclarationExpression(new CodeTypeReference(PublicNamesUsed["BaseObjClass"].ToString()), strTempObj)); @@ -6185,7 +6185,7 @@ namespace System.Management string strScope = "mgmtScope"; string strPath = "mgmtPath"; - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final | MemberAttributes.Static; cmm.Name = PublicNamesUsed["CreateInst"].ToString(); cmm.ReturnType = new CodeTypeReference(PrivateNamesUsed["GeneratedClassName"].ToString()); @@ -6265,7 +6265,7 @@ namespace System.Management { cmm = new CodeMemberMethod(); - cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final ; + cmm.Attributes = MemberAttributes.Public | MemberAttributes.Final; cmm.Name = PublicNamesUsed["DeleteInst"].ToString(); caa = new CodeAttributeArgument(); diff --git a/src/libraries/System.Management/src/System/Management/WmiEventSink.cs b/src/libraries/System.Management/src/System/Management/WmiEventSink.cs index bb0ff75999d..aa90f04363b 100644 --- a/src/libraries/System.Management/src/System/Management/WmiEventSink.cs +++ b/src/libraries/System.Management/src/System/Management/WmiEventSink.cs @@ -49,8 +49,8 @@ internal class WmiEventSink : IWmiEventSource // // Ensure we are able to trap exceptions from worker thread. // - ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiEventSink ) ) ; - disp.Start ( ) ; + ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiEventSink ) ); + disp.Start ( ); return wmiEventSinkNew; } @@ -163,7 +163,7 @@ internal class WmiEventSink : IWmiEventSource } // Fire Completed event - CompletedEventArgs args2 = null ; + CompletedEventArgs args2 = null; if ( errObj != null ) { args2 = new CompletedEventArgs (context, hResult, @@ -246,8 +246,8 @@ internal class WmiGetEventSink : WmiEventSink // // Ensure we are able to trap exceptions from worker thread. // - ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiGetEventSink ) ) ; - disp.Start ( ) ; + ThreadDispatch disp = new ThreadDispatch ( new ThreadDispatch.ThreadWorkerMethod ( HackToCreateWmiGetEventSink ) ); + disp.Start ( ); return wmiGetEventSinkNew; } diff --git a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs index 59154c3b115..d5b02170df1 100644 --- a/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs +++ b/src/libraries/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpEnvironmentProxy.cs @@ -96,9 +96,9 @@ namespace System.Net.Http private const string EnvNoProxyUC = "NO_PROXY"; private const string EnvCGI = "GATEWAY_INTERFACE"; // Running in a CGI environment. - private readonly Uri _httpProxyUri; // String URI for HTTP requests - private readonly Uri _httpsProxyUri; // String URI for HTTPS requests - private readonly string[] _bypass = null;// list of domains not to proxy + private readonly Uri _httpProxyUri; // String URI for HTTP requests + private readonly Uri _httpsProxyUri; // String URI for HTTPS requests + private readonly string[] _bypass = null; // list of domains not to proxy private readonly ICredentials _credentials; private HttpEnvironmentProxy(Uri httpProxy, Uri httpsProxy, string bypassList) diff --git a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs index 3576c20cbd1..f091e8b133d 100644 --- a/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs +++ b/src/libraries/System.Net.HttpListener/src/System/Net/Windows/HttpListener.Windows.cs @@ -577,9 +577,9 @@ namespace System.Net uint size = 4096; ulong requestId = 0; memoryBlob = new SyncRequestContext((int)size); - for (;;) + while (true) { - for (;;) + while (true) { if (NetEventSource.IsEnabled) NetEventSource.Info(this, $"Calling Interop.HttpApi.HttpReceiveHttpRequest RequestId: {requestId}"); uint bytesTransferred = 0; diff --git a/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs b/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs index 497fa5b59fa..0e0bdc85ee1 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Base64Stream.cs @@ -350,7 +350,7 @@ namespace System.Net if (offset + count > buffer.Length) throw new ArgumentOutOfRangeException(nameof(count)); - for (;;) + while (true) { // read data from the underlying stream int read = base.Read(buffer, offset, count); @@ -392,7 +392,7 @@ namespace System.Net // do not append a space when writing from a stream since this means // it's writing the email body - for (;;) + while (true) { written += EncodeBytes(buffer, offset + written, count - written, false, false); if (written < count) @@ -451,7 +451,7 @@ namespace System.Net internal void Read() { - for (;;) + while (true) { IAsyncResult result = _parent.BaseStream.BeginRead(_buffer, _offset, _count, s_onRead, this); if (!result.CompletedSynchronously || CompleteRead(result)) @@ -512,7 +512,7 @@ namespace System.Net internal void Write() { - for (;;) + while (true) { // do not append a space when writing from a stream since this means // it's writing the email body diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs index 6fcc1865539..d1699e1fce9 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mail/SmtpConnection.cs @@ -820,7 +820,7 @@ namespace System.Net.Mail private bool AuthenticateContinue() { - for (;;) + while (true) { // We don't need credential on the continued auth assuming they were captured on the first call. // That should always work, otherwise what if a new credential has been returned? diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs index 4f011bae8ca..12571735e0d 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QEncodedStream.cs @@ -298,7 +298,7 @@ namespace System.Net.Mime } int written = 0; - for (;;) + while (true) { written += EncodeBytes(buffer, offset + written, count - written); if (written < count) @@ -370,7 +370,7 @@ namespace System.Net.Mime internal void Write() { - for (;;) + while (true) { _written += _parent.EncodeBytes(_buffer, _offset + _written, _count - _written); if (_written < _count) diff --git a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs index f4df5315be4..dfc4e839cf1 100644 --- a/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs +++ b/src/libraries/System.Net.Mail/src/System/Net/Mime/QuotedPrintableStream.cs @@ -347,7 +347,7 @@ namespace System.Net.Mime } int written = 0; - for (;;) + while (true) { written += EncodeBytes(buffer, offset + written, count - written); if (written < count) @@ -416,7 +416,7 @@ namespace System.Net.Mime internal void Write() { - for (;;) + while (true) { _written += _parent.EncodeBytes(_buffer, _offset + _written, _count - _written); if (_written < _count) diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs index 1c75c68811b..d39b7127685 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketAsyncEventArgs.Windows.cs @@ -230,7 +230,7 @@ namespace System.Net.Sockets // Return pending and we will continue in the completion port callback. if (_singleBufferHandleState == SingleBufferHandleState.InProcess) { - RegisterToCancelPendingIO(overlapped, cancellationToken);// must happen before we change state to Set to avoid race conditions + RegisterToCancelPendingIO(overlapped, cancellationToken); // must happen before we change state to Set to avoid race conditions _singleBufferHandle = _buffer.Pin(); _singleBufferHandleState = SingleBufferHandleState.Set; } diff --git a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs index f550dccabe2..b9392ebdf28 100644 --- a/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs +++ b/src/libraries/System.Net.Sockets/src/System/Net/Sockets/SocketPal.Unix.cs @@ -703,7 +703,7 @@ namespace System.Net.Sockets public static bool TryCompleteSendTo(SafeSocketHandle socket, ReadOnlySpan buffer, IList> buffers, ref int bufferIndex, ref int offset, ref int count, SocketFlags flags, byte[] socketAddress, int socketAddressLen, ref int bytesSent, out SocketError errorCode) { bool successfulSend = false; - for (;;) + while (true) { int sent; Interop.Error errno; @@ -748,7 +748,7 @@ namespace System.Net.Sockets public static bool TryCompleteSendFile(SafeSocketHandle socket, SafeFileHandle handle, ref long offset, ref long count, ref long bytesSent, out SocketError errorCode) { - for (;;) + while (true) { long sent; Interop.Error errno; diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs index a31f3e516f7..26371fc4b1a 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendFile.cs @@ -141,7 +141,7 @@ namespace System.Net.Sockets.Tests using (remote) { var recvBuffer = new byte[256]; - for (; ; ) + while (true) { int received = remote.Receive(recvBuffer, 0, recvBuffer.Length, SocketFlags.None); if (received == 0) diff --git a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive.cs b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive.cs index 596c9a98f3c..c1b59ef8b08 100644 --- a/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive.cs +++ b/src/libraries/System.Net.Sockets/tests/FunctionalTests/SendReceive.cs @@ -147,7 +147,7 @@ namespace System.Net.Sockets.Tests if (!useMultipleBuffers) { var recvBuffer = new byte[256]; - for (; ; ) + while (true) { int received = await ReceiveAsync(remote, new ArraySegment(recvBuffer)); if (received == 0) @@ -166,7 +166,7 @@ namespace System.Net.Sockets.Tests new ArraySegment(new byte[256], 2, 100), new ArraySegment(new byte[1], 0, 0), new ArraySegment(new byte[64], 9, 33)}; - for (; ; ) + while (true) { int received = await ReceiveAsync(remote, recvBuffers); if (received == 0) @@ -1488,7 +1488,7 @@ namespace System.Net.Sockets.Tests using (NetworkStream stream = remote.GetStream()) { var recvBuffer = new byte[256]; - for (; ; ) + while (true) { int received = await stream.ReadAsync(recvBuffer, 0, recvBuffer.Length); if (received == 0) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs index df924de3786..6d6238ae46c 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/DataContract.cs @@ -2207,7 +2207,7 @@ namespace System.Runtime.Serialization internal class GenericNameProvider : IGenericNameProvider { private readonly string _genericTypeName; - private readonly object[] _genericParams;//Type or DataContract + private readonly object[] _genericParams; //Type or DataContract private readonly IList _nestedParamCounts; internal GenericNameProvider(Type type) : this(DataContract.GetClrTypeFullName(type.GetGenericTypeDefinition()), type.GetGenericArguments()) diff --git a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs index 7e450301d2c..157cc9b7c40 100644 --- a/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs +++ b/src/libraries/System.Private.DataContractSerialization/src/System/Runtime/Serialization/XmlFormatWriterGenerator.cs @@ -614,7 +614,7 @@ namespace System.Runtime.Serialization { if (isNullableOfT) { - memberValue = UnwrapNullableObject(memberValue);//Leaves !HasValue on stack + memberValue = UnwrapNullableObject(memberValue); //Leaves !HasValue on stack memberType = memberValue.LocalType; } else @@ -703,7 +703,7 @@ namespace System.Runtime.Serialization _ilg.Pop(); _ilg.Call(XmlFormatGeneratorStatics.GetDefaultValueMethod.MakeGenericMethod(memberType)); _ilg.Stloc(memberValue); - _ilg.Load(true);//isNull + _ilg.Load(true); //isNull _ilg.MarkLabel(end); return memberValue; } diff --git a/src/libraries/System.Private.Uri/src/System/Uri.cs b/src/libraries/System.Private.Uri/src/System/Uri.cs index 0c6a94762dc..b6a68481a5f 100644 --- a/src/libraries/System.Private.Uri/src/System/Uri.cs +++ b/src/libraries/System.Private.Uri/src/System/Uri.cs @@ -4076,7 +4076,7 @@ namespace System if (hasUnicode && iriParsing && hostNotUnicodeNormalized) { - flags |= Flags.HostUnicodeNormalized;// no host + flags |= Flags.HostUnicodeNormalized; // no host } return idx; diff --git a/src/libraries/System.Private.Uri/src/System/UriExt.cs b/src/libraries/System.Private.Uri/src/System/UriExt.cs index 6f5af386f6b..62669393188 100644 --- a/src/libraries/System.Private.Uri/src/System/UriExt.cs +++ b/src/libraries/System.Private.Uri/src/System/UriExt.cs @@ -527,7 +527,7 @@ namespace System == (Flags.SchemeNotCanonical | Flags.AuthorityFound)) { idx = (ushort)_syntax.SchemeName.Length; - while (str[idx++] != ':') ; + while (str[idx++] != ':'); if (idx + 1 >= _string.Length || str[idx] != '/' || str[idx + 1] != '/') return false; } diff --git a/src/libraries/System.Private.Uri/src/System/UriHelper.cs b/src/libraries/System.Private.Uri/src/System/UriHelper.cs index bc0609a7d56..cbb50463803 100644 --- a/src/libraries/System.Private.Uri/src/System/UriHelper.cs +++ b/src/libraries/System.Private.Uri/src/System/UriHelper.cs @@ -668,7 +668,7 @@ namespace System internal const string RFC3986ReservedMarks = @";/?:@&=+$,#[]!'()*"; private const string RFC2396ReservedMarks = @";/?:@&=+$,"; private const string RFC3986UnreservedMarks = @"-_.~"; - private const string AdditionalUnsafeToUnescape = @"%\#";// While not specified as reserved, these are still unsafe to unescape. + private const string AdditionalUnsafeToUnescape = @"%\#"; // While not specified as reserved, these are still unsafe to unescape. // When unescaping in safe mode, do not unescape the RFC 3986 reserved set: // gen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@" diff --git a/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/SqlUtils.cs b/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/SqlUtils.cs index 6d6be900001..ad4dc5df80a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/SqlUtils.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/SqlUtils.cs @@ -199,7 +199,7 @@ namespace System.Xml //the decimal digits, from the //lowest significant to highest significant - int iDigits = 0;//Number of significant digits + int iDigits = 0; //Number of significant digits uint ulRem; //Remainder of a division by x_ulBase10, i.e.,least significant digit // Build the final numeric string by inserting the sign, reversing diff --git a/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs index 9c4716f1db6..84bf039cfac 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/BinaryXml/XmlBinaryReader.cs @@ -2778,7 +2778,7 @@ namespace System.Xml private void FinishCDATA() { - for (;;) + while (true) { switch (PeekToken()) { @@ -3503,7 +3503,7 @@ namespace System.Xml if (!attr) { // scan if this is whitespace - for (;;) + while (true) { int posNext = pos + 2; if (posNext > end) @@ -3514,10 +3514,10 @@ namespace System.Xml } } - for (;;) + while (true) { char ch; - for (;;) + while (true) { int posNext = pos + 2; if (posNext > end) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentView.cs b/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentView.cs index 57581942d7a..f0499ce113b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentView.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Cache/XPathDocumentView.cs @@ -598,7 +598,7 @@ namespace System.Xml.XPath.DataBinding XPathStep[] steps = new XPathStep[stepCount]; pos = 0; int i = 0; - for (;;) { + while (true) { if (pos >= xpath.Length) throw new XmlException(SR.XmlDataBinding_XPathEnd, (string[])null); if ('/' != xpath[pos]) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs index 225918453af..d25a52ea2a0 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlEncodedRawTextWriter.cs @@ -564,7 +564,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; char ch = (char)0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -652,7 +652,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; char ch = (char)0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs index e753cc0c14e..2ba8e9cae42 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/HtmlUtf8RawTextWriter.cs @@ -541,7 +541,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; char ch = (char)0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -629,7 +629,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; char ch = (char)0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs index eb64761bf07..cba84e36012 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelper.cs @@ -389,12 +389,12 @@ namespace System.Xml } _decoder.SetNextOutputBuffer(buffer, index, count); - for (;;) + while (true) { // use streaming ReadValueChunk if the reader supports it if (_canReadValueChunk) { - for (;;) + while (true) { if (_valueOffset < _valueChunkLength) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs index ef91ade4518..0ae58d6944f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/ReadContentAsBinaryHelperAsync.cs @@ -308,12 +308,12 @@ namespace System.Xml } _decoder.SetNextOutputBuffer(buffer, index, count); - for (;;) + while (true) { // use streaming ReadValueChunk if the reader supports it if (_canReadValueChunk) { - for (;;) + while (true) { if (_valueOffset < _valueChunkLength) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs index bfedff1b465..94a4cf1667a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriter.cs @@ -903,7 +903,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1026,7 +1026,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1157,7 +1157,7 @@ namespace System.Xml char* pSrc = pSrcBegin; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1221,7 +1221,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1341,7 +1341,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1492,7 +1492,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1818,7 +1818,7 @@ namespace System.Xml fixed (char* pSrc = s) { char* pS = pSrc; - while ((*pDst++ = (char)*pS++) != 0) ; + while ((*pDst++ = (char)*pS++) != 0); } pDst[-1] = (char)';'; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriterAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriterAsync.cs index aae9271009e..4a8de8d8ba4 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriterAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlEncodedRawTextWriterAsync.cs @@ -670,7 +670,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -874,7 +874,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1114,7 +1114,7 @@ namespace System.Xml char* pSrc = pSrcBegin; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1289,7 +1289,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1491,7 +1491,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1681,7 +1681,7 @@ namespace System.Xml char* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { char* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs index 023e32da1ea..e7c99e1b4d6 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextEncoder.cs @@ -140,7 +140,7 @@ namespace System.Xml int endPos = offset + count; int i = offset; char ch = (char)0; - for (;;) + while (true) { int startPos = i; unsafe @@ -270,7 +270,7 @@ namespace System.Xml int i = 0; int startPos = 0; char ch = (char)0; - for (;;) + while (true) { unsafe { @@ -306,7 +306,7 @@ namespace System.Xml } char[] helperBuffer = new char[256]; - for (;;) + while (true) { if (startPos < i) { @@ -412,7 +412,7 @@ namespace System.Xml int i = 0; char ch = (char)0; - for (;;) + while (true) { unsafe { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs index 6f5e773a700..13153ea2aee 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImpl.cs @@ -1191,7 +1191,7 @@ namespace System.Xml FinishInit(); } - for (;;) + while (true) { switch (_parsingFunction) { @@ -3614,7 +3614,7 @@ namespace System.Xml int xmlDeclState = 0; // Encoding encoding = null; - for (;;) + while (true) { int originalSbLen = sb.Length; int wsCount = EatWhitespaces(xmlDeclState == 0 ? null : sb); @@ -3906,7 +3906,7 @@ namespace System.Xml if (CompatibilitySwitches.IsAppEarlierThanWindowsPhone8) mangoQuirks = true; #endif - for (;;) + while (true) { bool needMoreChars = false; int pos = _ps.charPos; @@ -4141,7 +4141,7 @@ namespace System.Xml // Parses element content private bool ParseElementContent() { - for (;;) + while (true) { int pos = _ps.charPos; char[] chars = _ps.chars; @@ -4347,7 +4347,7 @@ namespace System.Xml unsafe { // parse element name - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(chars[pos])) { @@ -4610,7 +4610,7 @@ namespace System.Xml LineInfo endTagLineInfo = new LineInfo(_ps.lineNo, _ps.LinePos); int pos; - for (;;) + while (true) { pos = _ps.charPos + nameLen; chars = _ps.chars; @@ -4727,7 +4727,7 @@ namespace System.Xml Debug.Assert(_attrCount == 0); - for (;;) + while (true) { // eat whitespace int lineNoDelta = 0; @@ -4848,7 +4848,7 @@ namespace System.Xml unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(tmpch2 = chars[pos])) { @@ -5179,7 +5179,7 @@ namespace System.Xml Debug.Assert(_stringBuilder.Length == 0); - for (;;) + while (true) { // parse the rest of the attribute value unsafe @@ -5473,7 +5473,7 @@ namespace System.Xml // skip over the text if not in full parsing mode if (_parsingMode != ParsingMode.Full) { - while (!ParseText(out startPos, out endPos, ref orChars)) ; + while (!ParseText(out startPos, out endPos, ref orChars)); goto IgnoredNode; } @@ -5565,7 +5565,7 @@ namespace System.Xml _stringBuilder.Length = 0; if (!fullValue) { - while (!ParseText(out startPos, out endPos, ref orChars)) ; + while (!ParseText(out startPos, out endPos, ref orChars)); } goto IgnoredNode; } @@ -5616,7 +5616,7 @@ namespace System.Xml int orChars = outOrChars; char c; - for (;;) + while (true) { // parse text content unsafe @@ -5920,7 +5920,7 @@ namespace System.Xml int orChars = 0; _parsingFunction = _nextParsingFunction; - while (!ParseText(out startPos, out endPos, ref orChars)) ; + while (!ParseText(out startPos, out endPos, ref orChars)); } private void FinishReadValueChunk() @@ -5957,7 +5957,7 @@ namespace System.Xml } if (_incReadState != IncrementalReadState.ReadContentAsBinary_End) { - while (MoveToNextContentNode(true)) ; + while (MoveToNextContentNode(true)); } } @@ -6338,7 +6338,7 @@ namespace System.Xml { if (_ignorePIs || _parsingMode != ParsingMode.Full) { - while (!ParsePIValue(out startPos, out endPos)) ; + while (!ParsePIValue(out startPos, out endPos)); return false; } sb = _stringBuilder; @@ -6380,7 +6380,7 @@ namespace System.Xml int rcount = 0; int rpos = -1; - for (;;) + while (true) { char tmpch; unsafe @@ -6564,7 +6564,7 @@ namespace System.Xml } else { - while (!ParseCDataOrComment(type, out startPos, out endPos)) ; + while (!ParseCDataOrComment(type, out startPos, out endPos)); } } @@ -6586,7 +6586,7 @@ namespace System.Xml int rpos = -1; char stopChar = (type == XmlNodeType.Comment) ? '-' : ']'; - for (;;) + while (true) { char tmpch; unsafe @@ -6935,7 +6935,7 @@ namespace System.Xml char[] chars = _ps.chars; int pos = _ps.charPos; - for (;;) + while (true) { char ch; @@ -7133,9 +7133,9 @@ namespace System.Xml int wsCount = 0; char[] chars = _ps.chars; - for (;;) + while (true) { - for (;;) + while (true) { switch (chars[pos]) { @@ -7250,7 +7250,7 @@ namespace System.Xml // - if (expand == true) then ps.charPos is changed to point to the replaced character private int ParseNumericCharRef(bool expand, StringBuilder internalSubsetBuilder, out EntityType entityType) { - for (;;) + while (true) { int newPos; int charCount; @@ -7302,7 +7302,7 @@ namespace System.Xml pos++; digitPos = pos; badDigitExceptionString = SR.Xml_BadHexEntity; - for (;;) + while (true) { char ch = chars[pos]; if (ch >= '0' && ch <= '9') @@ -7418,7 +7418,7 @@ namespace System.Xml // - if (expand == true) then ps.charPos is changed to point to the replaced character private int ParseNamedCharRef(bool expand, StringBuilder internalSubsetBuilder) { - for (;;) + while (true) { int newPos; switch (newPos = ParseNamedCharRefInline(_ps.charPos, expand, internalSubsetBuilder)) @@ -7626,7 +7626,7 @@ namespace System.Xml // parse name unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(chars[pos])) { @@ -8291,7 +8291,7 @@ namespace System.Xml int startPos = 0; int pos = 0; - for (;;) + while (true) { switch (_incReadState) { @@ -8353,7 +8353,7 @@ namespace System.Xml startPos = _ps.charPos; pos = startPos; - for (;;) + while (true) { _incReadLineInfo.Set(_ps.LineNo, _ps.LinePos); @@ -8451,7 +8451,7 @@ namespace System.Xml } else { - ;//Throw( ); + ; //Throw( ); } break; // end tag @@ -8663,7 +8663,7 @@ namespace System.Xml Debug.Assert(_stringBuilder.Length == 0); - for (;;) + while (true) { unsafe { @@ -9427,7 +9427,7 @@ namespace System.Xml _incReadDecoder.SetNextOutputBuffer(buffer, index, count); - for (;;) + while (true) { // read what is already cached in curNode int charsRead = 0; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs index 4ae99eb2454..502b2be49cc 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextReaderImplAsync.cs @@ -160,7 +160,7 @@ namespace System.Xml return FinishInitAsync().CallBoolTaskFuncWhenFinishAsync(thisRef => thisRef.ReadAsync(), this); } - for (;;) + while (true) { switch (_parsingFunction) { @@ -1269,7 +1269,7 @@ namespace System.Xml int xmlDeclState = 0; // Encoding encoding = null; - for (;;) + while (true) { int originalSbLen = sb.Length; int wsCount = await EatWhitespacesAsync(xmlDeclState == 0 ? null : sb).ConfigureAwait(false); @@ -1553,7 +1553,7 @@ namespace System.Xml // Parses the document content, no async keyword for perf optimize private Task ParseDocumentContentAsync() { - for (;;) + while (true) { bool needMoreChars = false; int pos = _ps.charPos; @@ -1813,7 +1813,7 @@ namespace System.Xml // Parses element content private Task ParseElementContentAsync() { - for (;;) + while (true) { int pos = _ps.charPos; char[] chars = _ps.chars; @@ -1972,7 +1972,7 @@ namespace System.Xml unsafe { // parse element name - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(chars[pos])) { @@ -2285,7 +2285,7 @@ namespace System.Xml { int pos; char[] chars; - for (;;) + while (true) { pos = _ps.charPos + nameLen; chars = _ps.chars; @@ -2422,7 +2422,7 @@ namespace System.Xml Debug.Assert(_attrCount == 0); - for (;;) + while (true) { // eat whitespace int lineNoDelta = 0; @@ -2540,7 +2540,7 @@ namespace System.Xml unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(tmpch2 = chars[pos])) { @@ -2749,7 +2749,7 @@ namespace System.Xml Debug.Assert(_stringBuilder.Length == 0); - for (;;) + while (true) { // parse the rest of the attribute value while (_xmlCharType.IsAttributeValueChar(chars[pos])) @@ -3383,7 +3383,7 @@ namespace System.Xml private Task> ParseTextAsync(int outOrChars, char[] chars, int pos, int rcount, int rpos, int orChars, char c) { - for (;;) + while (true) { // parse text content while (_xmlCharType.IsTextChar(c = chars[pos])) @@ -4179,7 +4179,7 @@ namespace System.Xml int rcount = 0; int rpos = -1; - for (;;) + while (true) { char tmpch; @@ -4407,7 +4407,7 @@ namespace System.Xml int rpos = -1; char stopChar = (type == XmlNodeType.Comment) ? '-' : ']'; - for (;;) + while (true) { char tmpch; while (_xmlCharType.IsTextChar(tmpch = chars[pos]) && tmpch != stopChar) @@ -4761,7 +4761,7 @@ namespace System.Xml char[] chars = _ps.chars; int pos = _ps.charPos; - for (;;) + while (true) { char ch; @@ -4956,9 +4956,9 @@ namespace System.Xml int wsCount = 0; char[] chars = _ps.chars; - for (;;) + while (true) { - for (;;) + while (true) { switch (chars[pos]) { @@ -5061,7 +5061,7 @@ namespace System.Xml { EntityType entityType; - for (;;) + while (true) { int newPos; int charCount; @@ -5094,7 +5094,7 @@ namespace System.Xml // - if (expand == true) then ps.charPos is changed to point to the replaced character private async Task ParseNamedCharRefAsync(bool expand, StringBuilder internalSubsetBuilder) { - for (;;) + while (true) { int newPos; switch (newPos = ParseNamedCharRefInline(_ps.charPos, expand, internalSubsetBuilder)) @@ -5184,7 +5184,7 @@ namespace System.Xml // parse name unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(chars[pos])) { @@ -5549,7 +5549,7 @@ namespace System.Xml _incReadDecoder.SetNextOutputBuffer(buffer, index, count); - for (;;) + while (true) { // read what is already cached in curNode int charsRead = 0; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs index 98145a7158d..ca3cf1cbd71 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlTextWriter.cs @@ -270,7 +270,7 @@ namespace System.Xml _nsTop = -1; // element stack _stack = new TagInfo[10]; - _top = 0;// 0 is an empty sentanial element + _top = 0; // 0 is an empty sentanial element _stack[_top].Init(-1); _quoteChar = '"'; diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriter.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriter.cs index 6ec12642527..648bc4de3d9 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriter.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriter.cs @@ -718,7 +718,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -840,7 +840,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -970,7 +970,7 @@ namespace System.Xml char* pSrc = pSrcBegin; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1033,7 +1033,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1152,7 +1152,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1302,7 +1302,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriterAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriterAsync.cs index 31d6d70a275..526f12feb17 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriterAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlUtf8RawTextWriterAsync.cs @@ -560,7 +560,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -763,7 +763,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1002,7 +1002,7 @@ namespace System.Xml char* pSrc = pSrcBegin; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1176,7 +1176,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1377,7 +1377,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) @@ -1566,7 +1566,7 @@ namespace System.Xml byte* pDst = pDstBegin + bufPos; int ch = 0; - for (;;) + while (true) { byte* pDstEnd = pDst + (pSrcEnd - pSrc); if (pDstEnd > pDstBegin + bufLen) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs index 2ffff6b100e..371063d69c2 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Core/XmlValidatingReaderImpl.cs @@ -954,7 +954,7 @@ namespace System.Xml { if (!_outerReader.IsEmptyElement) { - for (;;) + while (true) { if (!_outerReader.Read()) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Dom/DocumentXPathNavigator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Dom/DocumentXPathNavigator.cs index 2414e8bc309..1eb633b7b32 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Dom/DocumentXPathNavigator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Dom/DocumentXPathNavigator.cs @@ -866,7 +866,7 @@ namespace System.Xml public override void MoveToRoot() { - for (;;) + while (true) { XmlNode parent = _source.ParentNode; if (parent == null) @@ -1009,7 +1009,7 @@ namespace System.Xml } else { - for (;;) + while (true) { XmlNode nextSibling = following.NextSibling; if (nextSibling != null) @@ -1098,7 +1098,7 @@ namespace System.Xml } else { - for (;;) + while (true) { XmlNode nextSibling = following.NextSibling; if (nextSibling != null) @@ -2078,7 +2078,7 @@ namespace System.Xml internal static bool IsFollowingSibling(XmlNode left, XmlNode right) { - for (;;) + while (true) { left = left.NextSibling; if (left == null) @@ -2095,7 +2095,7 @@ namespace System.Xml private static bool IsDescendant(XmlNode top, XmlNode bottom) { - for (;;) + while (true) { XmlNode parent = bottom.ParentNode; if (parent == null) @@ -2236,7 +2236,7 @@ namespace System.Xml public override bool MoveNext() { - for (;;) + while (true) { if (_nav.MoveToFirstChild()) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs index aa3c927db49..0e774c708ad 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParser.cs @@ -530,7 +530,7 @@ namespace System.Xml private void ParseSubset() { int startTagEntityId; - for (;;) + while (true) { Token token = GetToken(false); startTagEntityId = _currentEntityId; @@ -667,7 +667,7 @@ namespace System.Xml } SchemaAttDef attrDef = null; - for (;;) + while (true) { switch (GetToken(false)) { @@ -800,7 +800,7 @@ namespace System.Xml elementDecl.ContentValidator.ContentType == XmlSchemaContentType.Empty && !ignoreErrors) { - SendValidationEvent(_curPos - 8, XmlSeverityType.Error, SR.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString());// 8 == strlen("NOTATION") + SendValidationEvent(_curPos - 8, XmlSeverityType.Error, SR.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString()); // 8 == strlen("NOTATION") } elementDecl.IsNotationDeclared = true; } @@ -816,7 +816,7 @@ namespace System.Xml { goto UnexpectedError; } - for (;;) + while (true) { string notationName = GetNameString(); if (!_schemaInfo.Notations.ContainsKey(notationName)) @@ -854,7 +854,7 @@ namespace System.Xml goto UnexpectedError; attrDef.AddValue(GetNameString()); - for (;;) + while (true) { switch (GetToken(false)) { @@ -1145,7 +1145,7 @@ namespace System.Xml int connectorEntityId = -1; int contentEntityId = _currentEntityId; - for (;;) + while (true) { switch (GetToken(false)) { @@ -1562,7 +1562,7 @@ namespace System.Xml private Token GetToken(bool needWhiteSpace) { _whitespaceSeen = false; - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1696,7 +1696,7 @@ namespace System.Xml private Token ScanSubsetContent() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1945,7 +1945,7 @@ namespace System.Xml private Token ScanElement1() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -2141,7 +2141,7 @@ namespace System.Xml private Token ScanAttlist2() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -2327,7 +2327,7 @@ namespace System.Xml private Token ScanAttlist6() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -2422,7 +2422,7 @@ namespace System.Xml _stringBuilder.Length = 0; - for (;;) + while (true) { while (_xmlCharType.IsAttributeValueChar(_chars[_curPos]) && _chars[_curPos] != '%') { @@ -2808,7 +2808,7 @@ namespace System.Xml } _curPos++; - for (;;) + while (true) { if (_charsUsed - _curPos < 5) { @@ -2878,7 +2878,7 @@ namespace System.Xml int ignoreSectionDepth = 0; // skip ignored part - for (;;) + while (true) { while (_xmlCharType.IsTextChar(_chars[_curPos]) && _chars[_curPos] != ']') { @@ -3005,7 +3005,7 @@ namespace System.Xml _tokenStartPos = _curPos; int colonOffset = -1; - for (;;) + while (true) { unsafe { @@ -3039,7 +3039,7 @@ namespace System.Xml unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_chars[_curPos])) { @@ -3111,11 +3111,11 @@ namespace System.Xml { _tokenStartPos = _curPos; - for (;;) + while (true) { unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_chars[_curPos]) || _chars[_curPos] == ':') { @@ -3573,7 +3573,7 @@ namespace System.Xml ) { // postpone the proper surrogate checking to the loop below int endPos = startPos; - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_chars[endPos])) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs index 4a44eb154fd..5dde26ccc4f 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/DtdParserAsync.cs @@ -170,7 +170,7 @@ namespace System.Xml private async Task ParseSubsetAsync() { int startTagEntityId; - for (;;) + while (true) { Token token = await GetTokenAsync(false).ConfigureAwait(false); startTagEntityId = _currentEntityId; @@ -307,7 +307,7 @@ namespace System.Xml } SchemaAttDef attrDef = null; - for (;;) + while (true) { switch (await GetTokenAsync(false).ConfigureAwait(false)) { @@ -440,7 +440,7 @@ namespace System.Xml elementDecl.ContentValidator.ContentType == XmlSchemaContentType.Empty && !ignoreErrors) { - SendValidationEvent(_curPos - 8, XmlSeverityType.Error, SR.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString());// 8 == strlen("NOTATION") + SendValidationEvent(_curPos - 8, XmlSeverityType.Error, SR.Sch_NotationAttributeOnEmptyElement, elementDecl.Name.ToString()); // 8 == strlen("NOTATION") } elementDecl.IsNotationDeclared = true; } @@ -456,7 +456,7 @@ namespace System.Xml { goto UnexpectedError; } - for (;;) + while (true) { string notationName = GetNameString(); if (!_schemaInfo.Notations.ContainsKey(notationName)) @@ -494,7 +494,7 @@ namespace System.Xml goto UnexpectedError; attrDef.AddValue(GetNameString()); - for (;;) + while (true) { switch (await GetTokenAsync(false).ConfigureAwait(false)) { @@ -772,7 +772,7 @@ namespace System.Xml int connectorEntityId = -1; int contentEntityId = _currentEntityId; - for (;;) + while (true) { switch (await GetTokenAsync(false).ConfigureAwait(false)) { @@ -1181,7 +1181,7 @@ namespace System.Xml private async Task GetTokenAsync(bool needWhiteSpace) { _whitespaceSeen = false; - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1315,7 +1315,7 @@ namespace System.Xml private async Task ScanSubsetContentAsync() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1535,7 +1535,7 @@ namespace System.Xml private async Task ScanElement1Async() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1648,7 +1648,7 @@ namespace System.Xml private async Task ScanAttlist2Async() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1780,7 +1780,7 @@ namespace System.Xml private async Task ScanAttlist6Async() { - for (;;) + while (true) { switch (_chars[_curPos]) { @@ -1860,7 +1860,7 @@ namespace System.Xml _stringBuilder.Length = 0; - for (;;) + while (true) { while (_xmlCharType.IsAttributeValueChar(_chars[_curPos]) && _chars[_curPos] != '%') { @@ -2225,7 +2225,7 @@ namespace System.Xml } _curPos++; - for (;;) + while (true) { if (_charsUsed - _curPos < 5) { @@ -2284,7 +2284,7 @@ namespace System.Xml int ignoreSectionDepth = 0; // skip ignored part - for (;;) + while (true) { while (_xmlCharType.IsTextChar(_chars[_curPos]) && _chars[_curPos] != ']') { @@ -2411,7 +2411,7 @@ namespace System.Xml _tokenStartPos = _curPos; int colonOffset = -1; - for (;;) + while (true) { //a tmp flag, used to avoid await keyword in unsafe context. bool awaitReadDataInNameAsync = false; @@ -2451,7 +2451,7 @@ namespace System.Xml ContinueName: unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_chars[_curPos])) { @@ -2523,11 +2523,11 @@ namespace System.Xml { _tokenStartPos = _curPos; - for (;;) + while (true) { unsafe { - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_chars[_curPos]) || _chars[_curPos] == ':') { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Inference/Infer.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Inference/Infer.cs index 1aa45205a80..281ae05dedb 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Inference/Infer.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Inference/Infer.cs @@ -850,7 +850,7 @@ namespace System.Xml.Schema { //more than one consecutive text nodes probably with PI in between xse.SchemaTypeName = ST_string; - xse.LineNumber = TF_string;// we use LineNumber to store flags of valid types + xse.LineNumber = TF_string; // we use LineNumber to store flags of valid types } else { @@ -864,7 +864,7 @@ namespace System.Xml.Schema else { xse.SchemaTypeName = ST_string; - xse.LineNumber = TF_string;// we use LineNumber to store flags of valid types + xse.LineNumber = TF_string; // we use LineNumber to store flags of valid types } else if (_xtr.NodeType == XmlNodeType.Text) { @@ -887,7 +887,7 @@ namespace System.Xml.Schema else { xse.SchemaTypeName = ST_string; - xse.LineNumber = TF_string;// we use LineNumber to store flags of valid types + xse.LineNumber = TF_string; // we use LineNumber to store flags of valid types } } } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs index 6085d3111fa..8b8c1582902 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/Preprocessor.cs @@ -394,7 +394,7 @@ namespace System.Xml.Schema { Parser parser = new Parser(SchemaType.XSD, NameTable, SchemaNames, EventHandler); parser.Parse(reader, null); - while (reader.Read()) ;// wellformness check + while (reader.Read()) ; // wellformness check includedSchema = parser.XmlSchema; include.Schema = includedSchema; _schemaLocations.Add(ruri, includedSchema); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionpreProcessor.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionpreProcessor.cs index 7b8ca2e96db..c7de0d8e998 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionpreProcessor.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/SchemaCollectionpreProcessor.cs @@ -230,7 +230,7 @@ namespace System.Xml.Schema { Parser parser = new Parser(SchemaType.XSD, NameTable, SchemaNames, EventHandler); parser.Parse(reader, null); - while (reader.Read()) ;// wellformness check + while (reader.Read()) ; // wellformness check include.Schema = parser.XmlSchema; LoadExternals(include.Schema, xsc); } diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XdrValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XdrValidator.cs index 1077c07b06e..531acef577d 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XdrValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XdrValidator.cs @@ -338,7 +338,7 @@ namespace System.Xml.Schema Parser parser = new Parser(SchemaType.XDR, NameTable, SchemaNames, EventHandler); parser.XmlResolver = this.XmlResolver; parser.Parse(reader, uri); - while (reader.Read()) ;// wellformness check + while (reader.Read()) ; // wellformness check xdrSchema = parser.XdrSchema; } catch (XmlSchemaException e) diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaCollection.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaCollection.cs index a9857574dcc..8ad8229446a 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaCollection.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaCollection.cs @@ -107,7 +107,7 @@ namespace System.Xml.Schema try { schema = Add(ns, reader, _xmlResolver); - while (reader.Read()) ;// wellformness check + while (reader.Read()) ; // wellformness check } finally { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.cs index 30f90b26673..8949e5820cf 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaSet.cs @@ -303,7 +303,7 @@ namespace System.Xml.Schema try { schema = Add(targetNamespace, ParseSchema(targetNamespace, reader)); - while (reader.Read()) ;// wellformness check; + while (reader.Read()) ; // wellformness check; } finally { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs index cbc9f6716f0..8a688359871 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XmlSchemaValidator.cs @@ -1858,7 +1858,7 @@ namespace System.Xml.Schema readerSettings.XmlResolver = _xmlResolver; Reader = XmlReader.Create(stm, readerSettings, ruri.ToString()); _schemaSet.Add(uri, Reader, _validatedNamespaces); - while (Reader.Read()) ;// wellformness check + while (Reader.Read()) ; // wellformness check } catch (XmlSchemaException e) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdValidator.cs b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdValidator.cs index 3869c80170e..4fe37538412 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdValidator.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Schema/XsdValidator.cs @@ -586,7 +586,7 @@ namespace System.Xml.Schema //Add to validator's SchemaInfo SchemaInfo.Add(schemaInfo, EventHandler); - while (reader.Read()) ;// wellformness check + while (reader.Read()) ; // wellformness check } catch (XmlSchemaException e) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs index 82b6bf38f70..28a45a9d920 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs @@ -4569,7 +4569,7 @@ namespace System.Xml.Serialization memberMapping.TypeDesc = arrayMapping.TypeDesc; memberMapping.ReadOnly = readOnly; Member member = new Member(this, source, arrayName, 0, memberMapping, false); - member.IsNullable = false;//Note, sowmys: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()' + member.IsNullable = false; // Note, sowmys: IsNullable is set to false since null condition (xsi:nil) is already handled by 'ReadNull()' Member[] members = new Member[] { member }; WriteMemberBegin(members); diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/CacheOutputQuery.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/CacheOutputQuery.cs index f170462aef0..26ab8095ad3 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/CacheOutputQuery.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/CacheOutputQuery.cs @@ -43,8 +43,8 @@ namespace MS.Internal.Xml.XPath { outputBuffer.Clear(); count = 0; - return input.Evaluate(context);// This is trick. IDQuery needs this value. Otherwise we would return this. - // All subclasses should and would anyway override this method and return this. + return input.Evaluate(context); // This is trick. IDQuery needs this value. Otherwise we would return this. + // All subclasses should and would anyway override this method and return this. } public override XPathNavigator Advance() diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathScanner.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathScanner.cs index a296e6f5dde..d4c1d02d426 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathScanner.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/Internal/XPathScanner.cs @@ -346,7 +346,7 @@ namespace MS.Internal.Xml.XPath int start = _xpathExprIndex - 1; int len = 0; - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(this.CurrentChar)) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs index 1c2a9e3c10f..5a7cafbc15b 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XPath/XPathNavigatorReader.cs @@ -658,7 +658,7 @@ namespace System.Xml.XPath else { XPathNavigator prev = nav.Clone(); - for (;;) + while (true) { if (!nav.MoveToNextNamespace(XPathNamespaceScope.Local)) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/XmlConvert.cs b/src/libraries/System.Private.Xml/src/System/Xml/XmlConvert.cs index 5fcbbee3784..0be66229aaa 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/XmlConvert.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/XmlConvert.cs @@ -1444,7 +1444,7 @@ namespace System.Xml int i = 0; int len = data.Length; - for (;;) + while (true) { while (i < len && s_xmlCharType.IsCharData(data[i])) { @@ -1486,7 +1486,7 @@ namespace System.Xml int i = offset; int endPos = offset + len; - for (;;) + while (true) { while (i < endPos && s_xmlCharType.IsCharData(data[i])) { diff --git a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathScanner.cs b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathScanner.cs index 9b076a7ff85..456bd9d3f92 100644 --- a/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathScanner.cs +++ b/src/libraries/System.Private.Xml/src/System/Xml/Xsl/XPath/XPathScanner.cs @@ -554,7 +554,7 @@ namespace System.Xml.Xsl.XPath #endif ); int start = _curIndex; - for (;;) + while (true) { if (_xmlCharType.IsNCNameSingleChar(_curChar)) { diff --git a/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs b/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs index 31894d32c3b..b8bdd718f3d 100644 --- a/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs +++ b/src/libraries/System.Private.Xml/tests/Readers/NameTable/XmlNameTable.cs @@ -365,7 +365,7 @@ namespace System.Xml.Tests bool fRetry = false; - for (; ;) + while (true) { try { diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/Runtime/BindingFlagSupport/Shared.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/Runtime/BindingFlagSupport/Shared.cs index eb1fd332c4c..c445f1e4bbf 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/Runtime/BindingFlagSupport/Shared.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/Runtime/BindingFlagSupport/Shared.cs @@ -95,7 +95,7 @@ namespace System.Reflection.Runtime.BindingFlagSupport } string name = member.Name; TypeInfo typeInfo = member.DeclaringType.GetTypeInfo(); - for (;;) + while (true) { Type baseType = typeInfo.BaseType; if (baseType == null) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/RoCustomAttributeData.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/RoCustomAttributeData.cs index 0228902d889..1bba3f2fa3b 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/RoCustomAttributeData.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/CustomAttributes/RoCustomAttributeData.cs @@ -22,7 +22,7 @@ namespace System.Reflection.TypeLoading private volatile ConstructorInfo _lazyConstructorInfo; public abstract override IList ConstructorArguments { get; } - public abstract override IList NamedArguments { get;} + public abstract override IList NamedArguments { get; } public sealed override string ToString() => GetType().ToString(); // Does not match NETFX output - however, doing so can prematurely // trigger resolve handlers. Too impactful for ToString(). } diff --git a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Assignability.cs b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Assignability.cs index dbeb13f3e5b..66dfa83802b 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Assignability.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/src/System/Reflection/TypeLoading/General/Assignability.cs @@ -164,7 +164,7 @@ namespace System.Reflection.TypeLoading return true; Type walk = fromTypeInfo; - for (;;) + while (true) { Type baseType = walk.BaseType; if (baseType == null) diff --git a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/CustomAttributeInstantiator.cs b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/CustomAttributeInstantiator.cs index d8bf1445947..272dcf38bcb 100644 --- a/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/CustomAttributeInstantiator.cs +++ b/src/libraries/System.Reflection.MetadataLoadContext/tests/src/TestUtils/CustomAttributeInstantiator.cs @@ -74,7 +74,7 @@ namespace System.Reflection.Tests if (namedArgument.IsField) { // Field - for (;;) + while (true) { FieldInfo fieldInfo = walk.GetField(name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); if (fieldInfo != null) @@ -89,7 +89,7 @@ namespace System.Reflection.Tests else { // Property - for (;;) + while (true) { PropertyInfo propertyInfo = walk.GetProperty(name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static | BindingFlags.DeclaredOnly); if (propertyInfo != null) diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs index 6adb6391a80..0fa963043f5 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheExpires.cs @@ -485,7 +485,7 @@ namespace System.Runtime.Caching int pageIndexNext; ExpiresEntry[] entries; - for (; ;) + while (true) { pageIndexNext = (_pages[(pageIndexCurrent)]._pageNext); @@ -506,7 +506,7 @@ namespace System.Runtime.Caching pageIndexCurrent = pageIndexNext; } - for (; ;) + while (true) { if (_freeEntryList._tail == -1) break; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs index 4d236747771..a4abc08b874 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/CacheUsage.cs @@ -471,7 +471,7 @@ namespace System.Runtime.Caching int pageIndexNext; UsageEntry[] entries; - for (; ;) + while (true) { pageIndexNext = (_pages[(pageIndexCurrent)]._pageNext); @@ -490,7 +490,7 @@ namespace System.Runtime.Caching pageIndexCurrent = pageIndexNext; } - for (; ;) + while (true) { if (_freeEntryList._tail == -1) break; diff --git a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SafeBitVector32.cs b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SafeBitVector32.cs index 4808f2b84d9..fb79781e7c5 100644 --- a/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SafeBitVector32.cs +++ b/src/libraries/System.Runtime.Caching/src/System/Runtime/Caching/SafeBitVector32.cs @@ -24,7 +24,7 @@ namespace System.Runtime.Caching } set { - for (; ;) + while (true) { int oldData = _data; int newData; @@ -48,7 +48,7 @@ namespace System.Runtime.Caching internal bool ChangeValue(int bit, bool value) { - for (; ;) + while (true) { int oldData = _data; int newData; diff --git a/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs b/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs index 591cd454b91..62d7d400dac 100644 --- a/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs +++ b/src/libraries/System.Runtime.Numerics/src/System/Numerics/BigInteger.cs @@ -483,7 +483,7 @@ namespace System.Numerics // Try to conserve space as much as possible by checking for wasted leading uint[] entries // sometimes the uint[] has leading zeros from bit manipulation operations & and ^ - for (len = value.Length; len > 0 && value[len - 1] == 0; len--) ; + for (len = value.Length; len > 0 && value[len - 1] == 0; len--); if (len == 0) this = s_bnZeroInt; diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs index 4c98baa5a4b..75e2a2645ad 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/Formatters/Binary/BinaryObjectReader.cs @@ -734,7 +734,7 @@ namespace System.Runtime.Serialization.Formatters.Binary if ((pr._objectInfo != null) && pr._objectInfo._objectType != null && (pr._objectInfo._objectType.IsValueType)) { pr._isValueTypeFixup = true; //Valuefixup - ValueFixupStack.Push(new ValueFixup(objectPr._newObj, pr._name, objectPr._objectInfo));//valuefixup + ValueFixupStack.Push(new ValueFixup(objectPr._newObj, pr._name, objectPr._objectInfo)); //valuefixup } else { diff --git a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs index 9f7b553d402..a81b61885d9 100644 --- a/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs +++ b/src/libraries/System.Runtime.Serialization.Formatters/src/System/Runtime/Serialization/ObjectManager.cs @@ -1575,7 +1575,7 @@ namespace System.Runtime.Serialization Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); if (_isFixupEnumerator) { - while (++_currPos < _list.Count && _list._values[_currPos].CompletelyFixed) ; + while (++_currPos < _list.Count && _list._values[_currPos].CompletelyFixed); return _currPos != _list.Count; } else diff --git a/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ACL.cs b/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ACL.cs index fcb8414d7da..d9b391ca74f 100644 --- a/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ACL.cs +++ b/src/libraries/System.Security.AccessControl/src/System/Security/AccessControl/ACL.cs @@ -649,19 +649,19 @@ nameof(binaryForm)); // Important: Not all combinations of inheritance bits are valid // - afToPm[( int )( 0 | 0 | 0 | 0 )] = PM.F | 0 | 0 | 0 | 0 ; - afToPm[( int )( 0 | AF.OI | 0 | 0 )] = PM.F | 0 | PM.CO | 0 | PM.GO ; - afToPm[( int )( 0 | AF.OI | 0 | AF.NP )] = PM.F | 0 | PM.CO | 0 | 0 ; - afToPm[( int )( 0 | AF.OI | AF.IO | 0 )] = 0 | 0 | PM.CO | 0 | PM.GO ; - afToPm[( int )( 0 | AF.OI | AF.IO | AF.NP )] = 0 | 0 | PM.CO | 0 | 0 ; - afToPm[( int )( AF.CI | 0 | 0 | 0 )] = PM.F | PM.CF | 0 | PM.GF | 0 ; - afToPm[( int )( AF.CI | 0 | 0 | AF.NP )] = PM.F | PM.CF | 0 | 0 | 0 ; - afToPm[( int )( AF.CI | 0 | AF.IO | 0 )] = 0 | PM.CF | 0 | PM.GF | 0 ; - afToPm[( int )( AF.CI | 0 | AF.IO | AF.NP )] = 0 | PM.CF | 0 | 0 | 0 ; - afToPm[( int )( AF.CI | AF.OI | 0 | 0 )] = PM.F | PM.CF | PM.CO | PM.GF | PM.GO ; - afToPm[( int )( AF.CI | AF.OI | 0 | AF.NP )] = PM.F | PM.CF | PM.CO | 0 | 0 ; - afToPm[( int )( AF.CI | AF.OI | AF.IO | 0 )] = 0 | PM.CF | PM.CO | PM.GF | PM.GO ; - afToPm[( int )( AF.CI | AF.OI | AF.IO | AF.NP )] = 0 | PM.CF | PM.CO | 0 | 0 ; + afToPm[( int )( 0 | 0 | 0 | 0 )] = PM.F | 0 | 0 | 0 | 0; + afToPm[( int )( 0 | AF.OI | 0 | 0 )] = PM.F | 0 | PM.CO | 0 | PM.GO; + afToPm[( int )( 0 | AF.OI | 0 | AF.NP )] = PM.F | 0 | PM.CO | 0 | 0; + afToPm[( int )( 0 | AF.OI | AF.IO | 0 )] = 0 | 0 | PM.CO | 0 | PM.GO; + afToPm[( int )( 0 | AF.OI | AF.IO | AF.NP )] = 0 | 0 | PM.CO | 0 | 0; + afToPm[( int )( AF.CI | 0 | 0 | 0 )] = PM.F | PM.CF | 0 | PM.GF | 0; + afToPm[( int )( AF.CI | 0 | 0 | AF.NP )] = PM.F | PM.CF | 0 | 0 | 0; + afToPm[( int )( AF.CI | 0 | AF.IO | 0 )] = 0 | PM.CF | 0 | PM.GF | 0; + afToPm[( int )( AF.CI | 0 | AF.IO | AF.NP )] = 0 | PM.CF | 0 | 0 | 0; + afToPm[( int )( AF.CI | AF.OI | 0 | 0 )] = PM.F | PM.CF | PM.CO | PM.GF | PM.GO; + afToPm[( int )( AF.CI | AF.OI | 0 | AF.NP )] = PM.F | PM.CF | PM.CO | 0 | 0; + afToPm[( int )( AF.CI | AF.OI | AF.IO | 0 )] = 0 | PM.CF | PM.CO | PM.GF | PM.GO; + afToPm[( int )( AF.CI | AF.OI | AF.IO | AF.NP )] = 0 | PM.CF | PM.CO | 0 | 0; return afToPm; } @@ -682,19 +682,19 @@ nameof(binaryForm)); // the four ACE inheritance bits // - pmToAf[( int )( PM.F | 0 | 0 | 0 | 0 )] = 0 | 0 | 0 | 0 ; - pmToAf[( int )( PM.F | 0 | PM.CO | 0 | PM.GO )] = 0 | AF.OI | 0 | 0 ; - pmToAf[( int )( PM.F | 0 | PM.CO | 0 | 0 )] = 0 | AF.OI | 0 | AF.NP ; - pmToAf[( int )( 0 | 0 | PM.CO | 0 | PM.GO )] = 0 | AF.OI | AF.IO | 0 ; - pmToAf[( int )( 0 | 0 | PM.CO | 0 | 0 )] = 0 | AF.OI | AF.IO | AF.NP ; - pmToAf[( int )( PM.F | PM.CF | 0 | PM.GF | 0 )] = AF.CI | 0 | 0 | 0 ; - pmToAf[( int )( PM.F | PM.CF | 0 | 0 | 0 )] = AF.CI | 0 | 0 | AF.NP ; - pmToAf[( int )( 0 | PM.CF | 0 | PM.GF | 0 )] = AF.CI | 0 | AF.IO | 0 ; - pmToAf[( int )( 0 | PM.CF | 0 | 0 | 0 )] = AF.CI | 0 | AF.IO | AF.NP ; - pmToAf[( int )( PM.F | PM.CF | PM.CO | PM.GF | PM.GO )] = AF.CI | AF.OI | 0 | 0 ; - pmToAf[( int )( PM.F | PM.CF | PM.CO | 0 | 0 )] = AF.CI | AF.OI | 0 | AF.NP ; - pmToAf[( int )( 0 | PM.CF | PM.CO | PM.GF | PM.GO )] = AF.CI | AF.OI | AF.IO | 0 ; - pmToAf[( int )( 0 | PM.CF | PM.CO | 0 | 0 )] = AF.CI | AF.OI | AF.IO | AF.NP ; + pmToAf[( int )( PM.F | 0 | 0 | 0 | 0 )] = 0 | 0 | 0 | 0; + pmToAf[( int )( PM.F | 0 | PM.CO | 0 | PM.GO )] = 0 | AF.OI | 0 | 0; + pmToAf[( int )( PM.F | 0 | PM.CO | 0 | 0 )] = 0 | AF.OI | 0 | AF.NP; + pmToAf[( int )( 0 | 0 | PM.CO | 0 | PM.GO )] = 0 | AF.OI | AF.IO | 0; + pmToAf[( int )( 0 | 0 | PM.CO | 0 | 0 )] = 0 | AF.OI | AF.IO | AF.NP; + pmToAf[( int )( PM.F | PM.CF | 0 | PM.GF | 0 )] = AF.CI | 0 | 0 | 0; + pmToAf[( int )( PM.F | PM.CF | 0 | 0 | 0 )] = AF.CI | 0 | 0 | AF.NP; + pmToAf[( int )( 0 | PM.CF | 0 | PM.GF | 0 )] = AF.CI | 0 | AF.IO | 0; + pmToAf[( int )( 0 | PM.CF | 0 | 0 | 0 )] = AF.CI | 0 | AF.IO | AF.NP; + pmToAf[( int )( PM.F | PM.CF | PM.CO | PM.GF | PM.GO )] = AF.CI | AF.OI | 0 | 0; + pmToAf[( int )( PM.F | PM.CF | PM.CO | 0 | 0 )] = AF.CI | AF.OI | 0 | AF.NP; + pmToAf[( int )( 0 | PM.CF | PM.CO | PM.GF | PM.GO )] = AF.CI | AF.OI | AF.IO | 0; + pmToAf[( int )( 0 | PM.CF | PM.CO | 0 | 0 )] = AF.CI | AF.OI | AF.IO | AF.NP; return pmToAf; } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs index 83c3ef50508..9a544f10af2 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeDeformatter.cs @@ -7,7 +7,7 @@ namespace System.Security.Cryptography public abstract class AsymmetricKeyExchangeDeformatter { protected AsymmetricKeyExchangeDeformatter() {} - public abstract string Parameters {get; set;} + public abstract string Parameters {get; set; } public abstract void SetKey(AsymmetricAlgorithm key); public abstract byte[] DecryptKeyExchange(byte[] rgb); } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs index 3aff1224f27..4c5bfbbce46 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/AsymmetricKeyExchangeFormatter.cs @@ -8,7 +8,7 @@ namespace System.Security.Cryptography { protected AsymmetricKeyExchangeFormatter() {} - public abstract string Parameters {get;} + public abstract string Parameters {get; } public abstract void SetKey(AsymmetricAlgorithm key); public abstract byte[] CreateKeyExchange(byte[] data); diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs index 9c4df0da977..7d7eb7396db 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeDeformatter.cs @@ -19,7 +19,7 @@ namespace System.Security.Cryptography public override string Parameters { - get {return null;} + get {return null; } set { } } diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs index 628ffdd20bb..ca0f87693de 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAOAEPKeyExchangeFormatter.cs @@ -45,7 +45,7 @@ namespace System.Security.Cryptography public override string Parameters { - get {return null;} + get {return null; } } public RandomNumberGenerator Rng { diff --git a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs index 7aa79fad3ce..38785e0cf94 100644 --- a/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs +++ b/src/libraries/System.Security.Cryptography.Algorithms/src/System/Security/Cryptography/RSAPKCS1KeyExchangeDeformatter.cs @@ -26,7 +26,7 @@ namespace System.Security.Cryptography public override string Parameters { - get {return null;} + get {return null; } set { } } diff --git a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs index 7599bfdd769..381be9510a5 100644 --- a/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs +++ b/src/libraries/System.Security.Cryptography.Csp/src/System/Security/Cryptography/CapiHelper.DSA.Shared.cs @@ -13,10 +13,10 @@ namespace Internal.NativeCrypto { private const int DSS_Q_LEN = 20; - internal const int DSS_MAGIC = 0x31535344; // Encoding of "DSS1" - internal const int DSS_PRIVATE_MAGIC = 0x32535344; // Encoding of "DSS2" - internal const int DSS_PUB_MAGIC_VER3 = 0x33535344; // Encoding of "DSS3" - internal const int DSS_PRIV_MAGIC_VER3 = 0x34535344;// Encoding of "DSS4" + internal const int DSS_MAGIC = 0x31535344; // Encoding of "DSS1" + internal const int DSS_PRIVATE_MAGIC = 0x32535344; // Encoding of "DSS2" + internal const int DSS_PUB_MAGIC_VER3 = 0x33535344; // Encoding of "DSS3" + internal const int DSS_PRIV_MAGIC_VER3 = 0x34535344; // Encoding of "DSS4" /// /// Helper for DsaCryptoServiceProvider.ImportParameters() diff --git a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/BaseCodePageEncoding.cs b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/BaseCodePageEncoding.cs index 315e94f28e2..8112cf97609 100644 --- a/src/libraries/System.Text.Encoding.CodePages/src/System/Text/BaseCodePageEncoding.cs +++ b/src/libraries/System.Text.Encoding.CodePages/src/System/Text/BaseCodePageEncoding.cs @@ -129,7 +129,7 @@ namespace System.Text [FieldOffset(0x22)] internal ushort VersionMinor; // WORD [FieldOffset(0x24)] - internal ushort VersionRevision;// WORD + internal ushort VersionRevision; // WORD [FieldOffset(0x26)] internal ushort VersionBuild; // WORD [FieldOffset(0x28)] diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Split.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Split.cs index 4e4205ebbd7..bd8d590dfb3 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Split.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/Regex.Split.cs @@ -103,7 +103,7 @@ namespace System.Text.RegularExpressions { int prevat = 0; - for (; ; ) + while (true) { al.Add(input.Substring(prevat, match.Index - prevat)); @@ -131,7 +131,7 @@ namespace System.Text.RegularExpressions { int prevat = input.Length; - for (; ; ) + while (true) { al.Add(input.Substring(match.Index + match.Length, prevat - match.Index - match.Length)); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs index a2daac6ce45..5a2b32d7915 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexBoyerMoore.cs @@ -79,11 +79,11 @@ namespace System.Text.RegularExpressions int scan; int match; - for (; ;) + while (true) { // find an internal char (examine) that matches the tail - for (; ;) + while (true) { if (examine == beforefirst) goto OuterloopBreak; @@ -97,7 +97,7 @@ namespace System.Text.RegularExpressions // find the length of the match - for (; ;) + while (true) { if (scan == beforefirst || pattern[match] != pattern[scan]) { @@ -283,7 +283,7 @@ namespace System.Text.RegularExpressions int advance; int[] unicodeLookup; - for (; ;) + while (true) { if (test >= endlimit || test < beglimit) return -1; @@ -309,7 +309,7 @@ namespace System.Text.RegularExpressions test2 = test; match = startmatch; - for (; ;) + while (true) { if (match == endmatch) return (RightToLeft ? test2 + 1 : test2); diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs index f70cfd3640e..283ec6f157b 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexFCD.cs @@ -79,7 +79,7 @@ namespace System.Text.RegularExpressions RegexNode concatNode = null; int nextChild = 0; - for (; ;) + while (true) { switch (curNode.NType) { @@ -160,7 +160,7 @@ namespace System.Text.RegularExpressions curNode = tree.Root; - for (; ;) + while (true) { switch (curNode.NType) { @@ -312,7 +312,7 @@ namespace System.Text.RegularExpressions RegexNode curNode = tree.Root; int curChild = 0; - for (; ;) + while (true) { if (curNode.Children == null) { diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs index 4e850544b57..08da6002de5 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexInterpreter.cs @@ -451,7 +451,7 @@ namespace System.Text.RegularExpressions Goto(0); int advance = -1; - for (; ;) + while (true) { if (advance >= 0) { diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs index 5e5f76f3b25..357a4d3ad13 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexNode.cs @@ -246,7 +246,7 @@ namespace System.Text.RegularExpressions int min = M; int max = N; - for (; ;) + while (true) { if (u.ChildCount() == 0) break; @@ -337,7 +337,7 @@ namespace System.Text.RegularExpressions if (j < i) Children[j] = at; - for (; ;) + while (true) { if (at.NType == Alternate) { @@ -649,7 +649,7 @@ namespace System.Text.RegularExpressions Debug.WriteLine(CurNode.Description()); - for (; ;) + while (true) { if (CurNode.Children != null && CurChild < CurNode.Children.Count) { diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs index a9726937ded..3b22b770b76 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexParser.cs @@ -490,7 +490,7 @@ namespace System.Text.RegularExpressions { _concatenation = new RegexNode(RegexNode.Concatenate, _options); - for (; ;) + while (true) { int c = CharsRight(); if (c == 0) @@ -716,7 +716,7 @@ namespace System.Text.RegularExpressions MoveRight(); - for (; ;) + while (true) { if (CharsRight() == 0) break; @@ -958,7 +958,7 @@ namespace System.Text.RegularExpressions { if (UseOptionX()) { - for (; ;) + while (true) { while (CharsRight() > 0 && IsSpace(RightChar())) MoveRight(); @@ -986,7 +986,7 @@ namespace System.Text.RegularExpressions } else { - for (; ;) + while (true) { if (CharsRight() < 3 || RightChar(2) != '#' || RightChar(1) != '?' || RightChar() != '(') @@ -1993,7 +1993,7 @@ namespace System.Text.RegularExpressions int pos = startpos; int nChars = CharsRight(); - while (--nChars > 0 && (ch = CharAt(++pos)) >= '0' && ch <= '9') ; + while (--nChars > 0 && (ch = CharAt(++pos)) >= '0' && ch <= '9'); if (nChars == 0 || pos - startpos == 1) return false; @@ -2004,7 +2004,7 @@ namespace System.Text.RegularExpressions if (ch != ',') return false; - while (--nChars > 0 && (ch = CharAt(++pos)) >= '0' && ch <= '9') ; + while (--nChars > 0 && (ch = CharAt(++pos)) >= '0' && ch <= '9'); return nChars > 0 && ch == '}'; } diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs index 7fd53e5cf11..11c86a06b65 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexRunner.cs @@ -127,7 +127,7 @@ namespace System.Text.RegularExpressions StartTimeoutWatch(); - for (; ;) + while (true) { #if DEBUG if (runregex.Debug) diff --git a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs index df2236c9d82..eda301d91a5 100644 --- a/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs +++ b/src/libraries/System.Text.RegularExpressions/src/System/Text/RegularExpressions/RegexWriter.cs @@ -103,7 +103,7 @@ namespace System.Text.RegularExpressions Emit(RegexCode.Lazybranch, 0); - for (; ; ) + while (true) { if (curNode.Children == null) { diff --git a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs index 5a7498e0aef..6772ead392f 100644 --- a/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs +++ b/src/libraries/System.Threading.Tasks.Dataflow/src/Blocks/JoinBlock.cs @@ -638,7 +638,7 @@ namespace System.Threading.Tasks.Dataflow.Internal // We'll bail out of this loop either when we have reserved a message (true) // or when we have exhausted the list of postponed messages (false) - for (; ;) + while (true) { // Try to reserve the popped message if (next.Key.ReserveMessage(next.Value, this))