internal void AcquireReaderLock(int millisecondsTimeout)
{
EnterMyLock();
- for (;;)
+ while (true)
{
// We can enter a read lock if there are only read-locks have been given out
// and a writer is not trying to get in.
internal void AcquireWriterLock(int millisecondsTimeout)
{
EnterMyLock();
- for (;;)
+ while (true)
{
if (owners == 0)
{
return false;
}
- source = source.Slice(5);// justConsumed + 1 for delimiter
+ source = source.Slice(5); // justConsumed + 1 for delimiter
if (!TryParseUInt64X(source, out ulong i5, out justConsumed))
{
//
prod1 = bufDen.Low64;
- for (;;)
+ while (true)
{
quo--;
num += prod1;
uint sticky = 0;
uint quotient, remainder = 0;
- for (;;)
+ while (true)
{
sticky |= remainder; // record remainder as sticky bit
bufQuo.U2 = d1.High;
uint remainder = Div96By32(ref bufQuo, den);
- for (;;)
+ while (true)
{
if (remainder == 0)
{
bufQuo.U1 = Div96By64(ref *(Buf12*)&bufRem.U1, divisor);
bufQuo.U0 = Div96By64(ref *(Buf12*)&bufRem, divisor);
- for (;;)
+ while (true)
{
if (bufRem.Low64 == 0)
{
bufQuo.Low64 = Div128By96(ref bufRem, ref bufDivisor);
bufQuo.U2 = 0;
- for (;;)
+ while (true)
{
if ((bufRem.Low64 | bufRem.U2) == 0)
{
private bool m_completelyInited; // The EventSource constructor has returned without exception.
private Exception? m_constructionException; // If there was an exception construction, this is it
private byte m_outOfBandMessageCount; // The number of out of band messages sent (we throttle them
- private EventCommandEventArgs? m_deferredCommands;// If we get commands before we are fully we store them here and run the when we are fully inited.
+ private EventCommandEventArgs? m_deferredCommands; // If we get commands before we are fully we store them here and run the when we are fully inited.
private string[]? m_traits; // Used to implement GetTraits
{
// Find 'this' from the s_Listeners linked list.
EventListener prev = s_Listeners;
- for (;;)
+ while (true)
{
EventListener? cur = prev.m_Next;
if (cur == null)
{
// Remove 'listenerToRemove' from the eventSource.m_Dispatchers linked list.
EventDispatcher? prev = eventSource.m_Dispatchers;
- for (;;)
+ while (true)
{
EventDispatcher? cur = prev.m_Next;
if (cur == null)
foreach (EventListener listener in allListeners.Keys)
{
dispatcher = eventSource.m_Dispatchers;
- for (;;)
+ while (true)
{
Debug.Assert(dispatcher != null, "Listener is not on all eventSources.");
if (dispatcher.m_Listener == listener)
/// </summary>
internal static void ReserveEventIDsBelow(int eventId)
{
- for (;;)
+ while (true)
{
int snapshot = lastIdentity;
int newIdentity = (lastIdentity & ~0xFFFFFF) + eventId;
invariant.saEraNames = new string[] { "A.D." }; // Era names
invariant.saAbbrevEraNames = new string[] { "AD" }; // Abbreviated Era names
invariant.saAbbrevEnglishEraNames = new string[] { "AD" }; // Abbreviated era names in English
- invariant.saDayNames = new string[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" };// day names
+ invariant.saDayNames = new string[] { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; // day names
invariant.saAbbrevDayNames = new string[] { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; // abbreviated day names
invariant.saSuperShortDayNames = new string[] { "Su", "Mo", "Tu", "We", "Th", "Fr", "Sa" }; // The super short day names
invariant.saMonthNames = new string[] { "January", "February", "March", "April", "May", "June",
private string? _sNativeLanguage; // Native name of this language
private string? _sAbbrevLang; // abbreviated language name (Windows Language Name) ex: ENU
private string? _sConsoleFallbackName; // The culture name for the console fallback UI culture
- private int _iInputLanguageHandle=undef;// input language handle
+ private int _iInputLanguageHandle=undef; // input language handle
// Region
private string? _sRegionName; // (RegionInfo)
private string? _sNativeCountry; // native country name
private string? _sISO3166CountryName; // ISO 3166 (RegionInfo), ie: US
private string? _sISO3166CountryName2; // 3 char ISO 3166 country name 2 2(RegionInfo) ex: USA (ISO)
- private int _iGeoId = undef; // GeoId
+ private int _iGeoId = undef; // GeoId
// Numbers
private string? _sPositiveSign; // (user can override) positive sign
// Someplace to stick our buffer
char[] cBuffer;
- for (;;)
+ while (true)
{
// (re)allocation buffer and normalize string
cBuffer = new char[iLength];
// Skip past leading 0s.
int i = 0;
- for (; i < guidString.Length && guidString[i] == '0'; i++);
+ for (; i < guidString.Length && guidString[i] == '0'; i++) ;
int processedDigits = 0;
ReadOnlySpan<byte> charToHexLookup = Number.CharToHexLookup;
{
fixed (char* guidChars = &MemoryMarshal.GetReference(destination))
{
- char * p = guidChars;
+ char* p = guidChars;
if (braces != 0)
*p++ = (char)braces;
private static void EatWhiteSpace(ReadOnlySpan<char> s, ref int i)
{
int localIndex = i;
- for (; localIndex < s.Length && char.IsWhiteSpace(s[localIndex]); localIndex++);
+ for (; localIndex < s.Length && char.IsWhiteSpace(s[localIndex]); localIndex++) ;
i = localIndex;
}
StringBuilder currentBlock = this;
int maxCapacity = this.m_MaxCapacity;
- for (;;)
+ while (true)
{
// All blocks have the same max capacity.
Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity);
get
{
StringBuilder? chunk = this;
- for (;;)
+ while (true)
{
int indexInBlock = index - chunk.m_ChunkOffset;
if (indexInBlock >= 0)
set
{
StringBuilder? chunk = this;
- for (;;)
+ while (true)
{
int indexInBlock = index - chunk.m_ChunkOffset;
if (indexInBlock >= 0)
int thisChunkIndex = thisChunk.m_ChunkLength;
StringBuilder? sbChunk = sb;
int sbChunkIndex = sbChunk.m_ChunkLength;
- for (;;)
+ while (true)
{
--thisChunkIndex;
--sbChunkIndex;
int endIndex = startIndex + count;
StringBuilder chunk = this;
- for (;;)
+ while (true)
{
int endIndexInChunk = endIndex - chunk.m_ChunkOffset;
int startIndexInChunk = startIndex - chunk.m_ChunkOffset;
// We made certain that characters after the insertion point are not moved,
int i = 0;
- for (;;)
+ while (true)
{
// Copy in the new string for the ith replacement
ReplaceInPlaceAtChunk(ref targetChunk!, ref targetIndexInChunk, valuePtr, value.Length);
{
if (count != 0)
{
- for (;;)
+ while (true)
{
Debug.Assert(chunk != null, "chunk should not be null at this point");
int lengthInChunk = chunk.m_ChunkLength - indexInChunk;
chunk = this;
StringBuilder? endChunk = null;
int endIndexInChunk = 0;
- for (;;)
+ while (true)
{
if (endIndex - chunk.m_ChunkOffset >= 0)
{
bytes -= 4; // get back to where we were
iChar = 0; // Remembering nothing
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // Stop here, didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // Stop here, didn't throw
}
// Ignore the illegal character
"[UTF32Encoding.GetChars]Expected to have consumed bytes or throw (surrogate)");
bytes -= 4; // get back to where we were
iChar = 0; // Remembering nothing
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // Stop here, didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // Stop here, didn't throw
}
*(chars++) = GetHighSurrogate(iChar);
"[UTF32Encoding.GetChars]Expected to have consumed bytes or throw (normal char)");
bytes -= 4; // get back to where we were
iChar = 0; // Remembering nothing
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // Stop here, didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // Stop here, didn't throw
}
// Add the rest of the surrogate or our normal character
{
// Couldn't fallback.
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
// Stop here, didn't throw, backed up, so still nothing in buffer
}
else
"[UnicodeEncoding.GetChars]Expected bytes to have advanced or no output (bad surrogate)");
bytes -= 2; // didn't use these 2 bytes
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // couldn't fallback but didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // couldn't fallback but didn't throw
}
}
"[UnicodeEncoding.GetChars]Expected bytes to have advanced or no output (lonely surrogate)");
bytes -= 2; // didn't use these 2 bytes
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // couldn't fallback but didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // couldn't fallback but didn't throw
}
// Didn't throw, ignore this one (we already did its fallback)
Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
"[UnicodeEncoding.GetChars]Expected bytes to have advanced or no output (surrogate pair)");
bytes -= 2; // didn't use these 2 bytes
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
// Leave lastChar for next call to Convert()
- break; // couldn't fallback but didn't throw
+ break; // couldn't fallback but didn't throw
}
*chars++ = lastChar;
"[UnicodeEncoding.GetChars]Expected bytes to have advanced or no output (no low surrogate)");
bytes -= 2; // didn't use these 2 bytes
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // couldn't fallback but didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // couldn't fallback but didn't throw
}
// Not left over now, clear previous high surrogate and continue to add current char
Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
"[UnicodeEncoding.GetChars]Expected bytes to have advanced or no output (normal)");
bytes -= 2; // didn't use these bytes
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
- break; // couldn't fallback but didn't throw
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
+ break; // couldn't fallback but didn't throw
}
// add it
if (lastByte >= 0)
bytes--; // had an extra last byte hanging around
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
// We'll remember these in our decoder though
bytes += 2;
if (lastByte >= 0)
// odd byte couldn't fall back
bytes--; // didn't use this byte
fallbackBuffer.InternalReset();
- ThrowCharsOverflow(decoder, chars == charStart);// Might throw, if no chars output
+ ThrowCharsOverflow(decoder, chars == charStart); // Might throw, if no chars output
// didn't throw, but we'll remember it in the decoder
bytes++;
goto End;
private volatile int m_combinedState; //ie a uint. Used for the state items listed below.
//1-bit for signalled state
- private const int SignalledState_BitMask = unchecked((int)0x80000000);//1000 0000 0000 0000 0000 0000 0000 0000
+ private const int SignalledState_BitMask = unchecked((int)0x80000000); //1000 0000 0000 0000 0000 0000 0000 0000
private const int SignalledState_ShiftCount = 31;
//1-bit for disposed state
- private const int Dispose_BitMask = unchecked((int)0x40000000);//0100 0000 0000 0000 0000 0000 0000 0000
+ private const int Dispose_BitMask = unchecked((int)0x40000000); //0100 0000 0000 0000 0000 0000 0000 0000
//11-bits for m_spinCount
private const int SpinCountState_BitMask = unchecked((int)0x3FF80000); //0011 1111 1111 1000 0000 0000 0000 0000
bool retVal = true;
int spinCount = 0;
- for (; ;)
+ while (true)
{
// We can enter a read lock if there are only read-locks have been given out
// and a writer is not trying to get in.
bool retVal = true;
int spinCount = 0;
- for (; ;)
+ while (true)
{
if (IsWriterAcquired())
{
bool retVal = true;
int spinCount = 0;
- for (; ;)
+ while (true)
{
//Once an upgrade lock is taken, it's like having a reader lock held
//until upgrade or downgrade operations are performed.