From 5c7b91c9638243a76d4e08e34b3973602fa28df8 Mon Sep 17 00:00:00 2001 From: jaredpar Date: Thu, 29 Jan 2015 10:12:04 -0800 Subject: [PATCH] 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) --- .../PdbUtilities/Shared/CustomDebugInfoReader.cs | 12 ++++++------ .../Shared/ISymUnmanagedAsyncMethod.cs | 6 +++--- .../PdbUtilities/Shared/ISymUnmanagedVariable.cs | 2 +- .../Shared/SymUnmanagedReaderExtensions.cs | 16 ++++++++-------- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/Test/PdbUtilities/Shared/CustomDebugInfoReader.cs b/src/Test/PdbUtilities/Shared/CustomDebugInfoReader.cs index 2f0cb82ed03..4f4009d3c24 100644 --- a/src/Test/PdbUtilities/Shared/CustomDebugInfoReader.cs +++ b/src/Test/PdbUtilities/Shared/CustomDebugInfoReader.cs @@ -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> GetCSharpGroupedImportStrin ImmutableArray groupSizes = default(ImmutableArray); bool seenForward = false; - RETRY: + RETRY: byte[] bytes = reader.GetCustomDebugInfo(methodToken, methodVersion); if (bytes == null) { @@ -311,7 +311,7 @@ public static ImmutableArray> 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; diff --git a/src/Test/PdbUtilities/Shared/ISymUnmanagedAsyncMethod.cs b/src/Test/PdbUtilities/Shared/ISymUnmanagedAsyncMethod.cs index 49ea0fc4c16..b3e20b7f260 100644 --- a/src/Test/PdbUtilities/Shared/ISymUnmanagedAsyncMethod.cs +++ b/src/Test/PdbUtilities/Shared/ISymUnmanagedAsyncMethod.cs @@ -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); } diff --git a/src/Test/PdbUtilities/Shared/ISymUnmanagedVariable.cs b/src/Test/PdbUtilities/Shared/ISymUnmanagedVariable.cs index 149abb95272..7ccd718b82e 100644 --- a/src/Test/PdbUtilities/Shared/ISymUnmanagedVariable.cs +++ b/src/Test/PdbUtilities/Shared/ISymUnmanagedVariable.cs @@ -29,5 +29,5 @@ internal interface ISymUnmanagedVariable int GetStartOffset(out int pRetVal); [PreserveSig] int GetEndOffset(out int pRetVal); - } + } } diff --git a/src/Test/PdbUtilities/Shared/SymUnmanagedReaderExtensions.cs b/src/Test/PdbUtilities/Shared/SymUnmanagedReaderExtensions.cs index 08005627aea..71b1e368000 100644 --- a/src/Test/PdbUtilities/Shared/SymUnmanagedReaderExtensions.cs +++ b/src/Test/PdbUtilities/Shared/SymUnmanagedReaderExtensions.cs @@ -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 /// 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 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 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); } } -- GitLab