提交 5c7b91c9 编写于 作者: J jaredpar

Part 1 of moving Visual Studio to Open

Background:

As discussed in the dev team all hands all code under the GitHub dotnet foundation is using a single process for contribution, API review, infrastructure and coding style. The idea is to present a unified view to our customer and give them a single story for contributing to any project under the dotnet foundation.

https://github.com/dotnet/corefx/wiki/Contributing#c-coding-style

The coding style transition is automated using a Roslyn based rewrite tool:

https://github.com/dotnet/codeformatter

This will be applied in stages across our developer tree. Right now the focus is on the Open directory as this is what is being presented on github. Code owners will be contacted before the transition happens.

Note: this is a soft style requirement. There are no build errors that come from this change. (changeset 1406961)
上级 14228f76
......@@ -39,7 +39,7 @@ private static void ReadRecordHeader(byte[] bytes, ref int offset, out byte vers
kind = (CustomDebugInfoKind)bytes[offset + 1];
// two bytes of padding after kind
size = BitConverter.ToInt32(bytes, offset + 4);
size = BitConverter.ToInt32(bytes, offset + 4);
offset += CDI.CdiRecordHeaderSize;
}
......@@ -284,7 +284,7 @@ public static ImmutableArray<ImmutableArray<string>> GetCSharpGroupedImportStrin
ImmutableArray<short> groupSizes = default(ImmutableArray<short>);
bool seenForward = false;
RETRY:
RETRY:
byte[] bytes = reader.GetCustomDebugInfo(methodToken, methodVersion);
if (bytes == null)
{
......@@ -311,7 +311,7 @@ public static ImmutableArray<ImmutableArray<string>> GetCSharpGroupedImportStrin
}
methodToken = DecodeForwardRecord(record.Data);
// Follow at most one forward link (as in FUNCBRECEE::ensureNamespaces).
// NOTE: Dev11 may produce chains of forward links (e.g. for System.Collections.Immutable).
if (!seenForward)
......@@ -715,7 +715,7 @@ public static bool TryParseVisualBasicImportString(string import, out string ali
}
// VB current namespace
if (import.Length == 0)
if (import.Length == 0)
{
alias = null;
target = import;
......@@ -728,7 +728,7 @@ public static bool TryParseVisualBasicImportString(string import, out string ali
switch (import[pos])
{
case '&':
// Indicates the presence of embedded PIA types from a given assembly. No longer required (as of Roslyn).
// Indicates the presence of embedded PIA types from a given assembly. No longer required (as of Roslyn).
case '$':
case '#':
// From ProcedureContext::LoadImportsAndDefaultNamespaceNormal:
......@@ -839,7 +839,7 @@ public static bool TryParseVisualBasicImportString(string import, out string ali
return true;
}
default:
default:
// VB current namespace
alias = null;
target = import;
......
......@@ -26,9 +26,9 @@ internal interface ISymUnmanagedAsyncMethod
[PreserveSig]
int GetAsyncStepInfo(
uint cStepInfo,
out uint cStepInfoBack,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] uint[] yieldOffsets,
uint cStepInfo,
out uint cStepInfoBack,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] uint[] yieldOffsets,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] uint[] breakpointOffset,
[MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] uint[] breakpointMethod);
}
......
......@@ -29,5 +29,5 @@ internal interface ISymUnmanagedVariable
int GetStartOffset(out int pRetVal);
[PreserveSig]
int GetEndOffset(out int pRetVal);
}
}
}
......@@ -31,8 +31,8 @@ public override bool Equals(object obj)
public bool Equals(AsyncStepInfo other)
{
return YieldOffset == other.YieldOffset
&& ResumeMethod == other.ResumeMethod
return YieldOffset == other.YieldOffset
&& ResumeMethod == other.ResumeMethod
&& ResumeOffset == other.ResumeOffset;
}
......@@ -49,7 +49,7 @@ internal static class SymUnmanagedReaderExtensions
internal const int E_FAIL = unchecked((int)0x80004005);
internal const int E_NOTIMPL = unchecked((int)0x80004001);
private static readonly IntPtr IgnoreIErrorInfo = new IntPtr(-1);
private static readonly IntPtr s_ignoreIErrorInfo = new IntPtr(-1);
// The name of the attribute containing the byte array of custom debug info.
// MSCUSTOMDEBUGINFO in Dev10.
......@@ -166,7 +166,7 @@ public static ISymUnmanagedReader CreateReader(Stream pdbStream, object metadata
/// </summary>
public static byte[] GetCustomDebugInfo(this ISymUnmanagedReader reader, int methodToken, int methodVersion)
{
return GetItems(reader, new SymbolToken(methodToken), CdiAttributeName,
return GetItems(reader, new SymbolToken(methodToken), CdiAttributeName,
(ISymUnmanagedReader a, SymbolToken b, string c, int d, out int e, byte[] f) => a.GetSymAttribute(b, c, d, out e, f));
}
......@@ -187,7 +187,7 @@ public static int GetUserEntryPoint(this ISymUnmanagedReader symReader)
public static ImmutableArray<ISymUnmanagedDocument> GetDocuments(this ISymUnmanagedReader reader)
{
return ToImmutableOrEmpty(GetItems(reader,
return ToImmutableOrEmpty(GetItems(reader,
(ISymUnmanagedReader a, int b, out int c, ISymUnmanagedDocument[] d) => a.GetDocuments(b, out c, d)));
}
......@@ -387,7 +387,7 @@ public static ImmutableArray<ISymUnmanagedScope> GetScopes(this ISymUnmanagedSco
private static ISymUnmanagedScope[] GetScopesInternal(ISymUnmanagedScope scope)
{
return GetItems(scope,
return GetItems(scope,
(ISymUnmanagedScope a, int b, out int c, ISymUnmanagedScope[] d) => a.GetChildren(b, out c, d));
}
......@@ -432,7 +432,7 @@ internal static int GetAttributes(this ISymUnmanagedVariable local)
public static string GetName(this ISymUnmanagedVariable local)
{
return ToString(GetItems(local,
return ToString(GetItems(local,
(ISymUnmanagedVariable a, int b, out int c, char[] d) => a.GetName(b, out c, d)));
}
......@@ -484,7 +484,7 @@ internal static void ThrowExceptionForHR(int hr)
// E_NOTIMPL indicates a lack of ISymUnmanagedReader support (in a particular implementation).
if (hr < 0 && hr != E_FAIL && hr != E_NOTIMPL)
{
Marshal.ThrowExceptionForHR(hr, IgnoreIErrorInfo);
Marshal.ThrowExceptionForHR(hr, s_ignoreIErrorInfo);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册