From: Jan Kotas Date: Thu, 8 Mar 2018 18:18:50 +0000 (-0800) Subject: Make member visibility first accross corlib (#16836) X-Git-Tag: accepted/tizen/unified/20190422.045933~2715 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57ee22e6086af5dfc06651dc002e24a71c3999ee;p=platform%2Fupstream%2Fcoreclr.git Make member visibility first accross corlib (#16836) Mechanical find&replace to match https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md --- diff --git a/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs b/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs index 4248434..e8aef99 100644 --- a/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs +++ b/src/mscorlib/shared/Interop/Unix/Interop.Errors.cs @@ -186,7 +186,7 @@ internal static partial class Interop internal static extern int ConvertErrorPalToPlatform(Error error); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_StrErrorR")] - private static unsafe extern byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); + private static extern unsafe byte* StrErrorR(int platformErrno, byte* buffer, int bufferSize); } } diff --git a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Casing.cs b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Casing.cs index 25536d4..503a864 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Casing.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Casing.cs @@ -12,12 +12,12 @@ internal static partial class Interop internal static partial class Globalization { [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCase")] - internal unsafe static extern void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + internal static extern unsafe void ChangeCase(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseInvariant")] - internal unsafe static extern void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + internal static extern unsafe void ChangeCaseInvariant(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ChangeCaseTurkish")] - internal unsafe static extern void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); + internal static extern unsafe void ChangeCaseTurkish(char* src, int srcLen, char* dstBuffer, int dstBufferCapacity, bool bToUpper); } } diff --git a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs index 08aa611..9942882 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Collation.cs @@ -12,48 +12,48 @@ internal static partial class Interop internal static partial class Globalization { [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortHandle")] - internal unsafe static extern ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle); + internal static extern unsafe ResultCode GetSortHandle(byte[] localeName, out SafeSortHandle sortHandle); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CloseSortHandle")] - internal unsafe static extern void CloseSortHandle(IntPtr handle); + internal static extern unsafe void CloseSortHandle(IntPtr handle); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareString")] - internal unsafe static extern int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); + internal static extern unsafe int CompareString(SafeSortHandle sortHandle, char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")] - internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); + internal static extern unsafe int IndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOf")] - internal unsafe static extern int IndexOf(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); + internal static extern unsafe int IndexOf(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options, int* matchLengthPtr); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_LastIndexOf")] - internal unsafe static extern int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); + internal static extern unsafe int LastIndexOf(SafeSortHandle sortHandle, string target, int cwTargetLength, char* pSource, int cwSourceLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")] - internal unsafe static extern int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); + internal static extern unsafe int IndexOfOrdinalIgnoreCase(string target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_IndexOfOrdinalIgnoreCase")] - internal unsafe static extern int IndexOfOrdinalIgnoreCase(char* target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); + internal static extern unsafe int IndexOfOrdinalIgnoreCase(char* target, int cwTargetLength, char* pSource, int cwSourceLength, bool findLast); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options); + internal static extern unsafe bool StartsWith(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options); + internal static extern unsafe bool EndsWith(SafeSortHandle sortHandle, char* target, int cwTargetLength, char* source, int cwSourceLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_StartsWith")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); + internal static extern unsafe bool StartsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_EndsWith")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); + internal static extern unsafe bool EndsWith(SafeSortHandle sortHandle, string target, int cwTargetLength, string source, int cwSourceLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetSortKey")] - internal unsafe static extern int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); + internal static extern unsafe int GetSortKey(SafeSortHandle sortHandle, string str, int strLength, byte* sortKey, int sortKeyLength, CompareOptions options); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_CompareStringOrdinalIgnoreCase")] - internal unsafe static extern int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len); + internal static extern unsafe int CompareStringOrdinalIgnoreCase(char* lpStr1, int cwStr1Len, char* lpStr2, int cwStr2Len); [DllImport(Libraries.GlobalizationNative, EntryPoint = "GlobalizationNative_GetSortVersion")] internal static extern int GetSortVersion(SafeSortHandle sortHandle); diff --git a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Idna.cs b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Idna.cs index af23739..89b6c3c 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Idna.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Idna.cs @@ -13,9 +13,9 @@ internal static partial class Interop internal const int UseStd3AsciiRules = 0x2; [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToAscii")] - internal static unsafe extern int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + internal static extern unsafe int ToAscii(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_ToUnicode")] - internal static unsafe extern int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); + internal static extern unsafe int ToUnicode(uint flags, char* src, int srcLen, char* dstBuffer, int dstBufferCapacity); } } diff --git a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Locale.cs b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Locale.cs index 09527f0..9ef41de 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Locale.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Globalization.Native/Interop.Locale.cs @@ -12,29 +12,29 @@ internal static partial class Interop { [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleName")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleName(string localeName, [Out] StringBuilder value, int valueLength); + internal static extern unsafe bool GetLocaleName(string localeName, [Out] StringBuilder value, int valueLength); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoString")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoString(string localeName, uint localeStringData, [Out] StringBuilder value, int valueLength); + internal static extern unsafe bool GetLocaleInfoString(string localeName, uint localeStringData, [Out] StringBuilder value, int valueLength); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetDefaultLocaleName")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetDefaultLocaleName([Out] StringBuilder value, int valueLength); + internal static extern unsafe bool GetDefaultLocaleName([Out] StringBuilder value, int valueLength); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleTimeFormat")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleTimeFormat(string localeName, bool shortFormat, [Out] StringBuilder value, int valueLength); + internal static extern unsafe bool GetLocaleTimeFormat(string localeName, bool shortFormat, [Out] StringBuilder value, int valueLength); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoInt")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); + internal static extern unsafe bool GetLocaleInfoInt(string localeName, uint localeNumberData, ref int value); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocaleInfoGroupingSizes")] [return: MarshalAs(UnmanagedType.Bool)] - internal unsafe static extern bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); + internal static extern unsafe bool GetLocaleInfoGroupingSizes(string localeName, uint localeGroupingData, ref int primaryGroupSize, ref int secondaryGroupSize); [DllImport(Libraries.GlobalizationNative, CharSet = CharSet.Unicode, EntryPoint = "GlobalizationNative_GetLocales")] - internal unsafe static extern int GetLocales([Out] Char[] value, int valueLength); + internal static extern unsafe int GetLocales([Out] Char[] value, int valueLength); } } diff --git a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.GetRandomBytes.cs b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.GetRandomBytes.cs index 62156e8..e911b13 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.GetRandomBytes.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.GetRandomBytes.cs @@ -11,7 +11,7 @@ internal partial class Interop internal unsafe partial class Sys { [DllImport(Interop.Libraries.SystemNative, EntryPoint = "SystemNative_GetNonCryptographicallySecureRandomBytes")] - internal static unsafe extern void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length); + internal static extern unsafe void GetNonCryptographicallySecureRandomBytes(byte* buffer, int length); } internal static unsafe void GetRandomBytes(byte* buffer, int length) diff --git a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Read.cs b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Read.cs index 812ae34..1be5e78 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Read.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Read.cs @@ -20,6 +20,6 @@ internal static partial class Interop /// Note - on fail. the position of the stream may change depending on the platform; consult man 2 read for more info /// [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Read", SetLastError = true)] - internal static unsafe extern int Read(SafeFileHandle fd, byte* buffer, int count); + internal static extern unsafe int Read(SafeFileHandle fd, byte* buffer, int count); } } diff --git a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Write.cs b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Write.cs index c14fc26..0636615 100644 --- a/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Write.cs +++ b/src/mscorlib/shared/Interop/Unix/System.Native/Interop.Write.cs @@ -19,9 +19,9 @@ internal static partial class Interop /// Returns the number of bytes written on success; otherwise, returns -1 and sets errno /// [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(SafeFileHandle fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(SafeFileHandle fd, byte* buffer, int bufferSize); [DllImport(Libraries.SystemNative, EntryPoint = "SystemNative_Write", SetLastError = true)] - internal static unsafe extern int Write(int fd, byte* buffer, int bufferSize); + internal static extern unsafe int Write(int fd, byte* buffer, int bufferSize); } } diff --git a/src/mscorlib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs b/src/mscorlib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs index bc35712..75288ac 100644 --- a/src/mscorlib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs +++ b/src/mscorlib/shared/Interop/Windows/BCrypt/Interop.BCryptGenRandom.cs @@ -23,7 +23,7 @@ internal partial class Interop internal const int STATUS_NO_MEMORY = unchecked((int)0xC0000017); [DllImport(Libraries.BCrypt, CharSet = CharSet.Unicode)] - private static unsafe extern int BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); + private static extern unsafe int BCryptGenRandom(IntPtr hAlgorithm, byte* pbBuffer, int cbBuffer, int dwFlags); } internal static unsafe void GetRandomBytes(byte* buffer, int length) diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs index 03d8c8b..fcf9254 100644 --- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs +++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.FindClose.cs @@ -11,6 +11,6 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal extern static bool FindClose(IntPtr hFindFile); + internal static extern bool FindClose(IntPtr hFindFile); } } diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs index c07a168..faa57cc 100644 --- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs +++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.GetFileType_SafeHandle.cs @@ -10,6 +10,6 @@ internal partial class Interop internal partial class Kernel32 { [DllImport(Libraries.Kernel32, SetLastError = true)] - internal extern static int GetFileType(SafeHandle hFile); + internal static extern int GetFileType(SafeHandle hFile); } } diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs index ed0ada8..2227d59 100644 --- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs +++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.Globalization.cs @@ -18,13 +18,13 @@ internal static partial class Interop internal const int COMPARE_STRING = 0x0001; [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static unsafe int LCIDToLocaleName(int locale, char *pLocaleName, int cchName, uint dwFlags); + internal static extern unsafe int LCIDToLocaleName(int locale, char *pLocaleName, int cchName, uint dwFlags); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static int LocaleNameToLCID(string lpName, uint dwFlags); + internal static extern int LocaleNameToLCID(string lpName, uint dwFlags); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static unsafe int LCMapStringEx( + internal static extern unsafe int LCMapStringEx( string lpLocaleName, uint dwMapFlags, char* lpSrcStr, @@ -36,7 +36,7 @@ internal static partial class Interop IntPtr sortHandle); [DllImport("kernel32.dll", EntryPoint = "FindNLSStringEx")] - internal extern static unsafe int FindNLSStringEx( + internal static extern unsafe int FindNLSStringEx( char* lpLocaleName, uint dwFindNLSStringFlags, char* lpStringSource, @@ -49,7 +49,7 @@ internal static partial class Interop IntPtr sortHandle); [DllImport("kernel32.dll", EntryPoint = "CompareStringEx")] - internal extern static unsafe int CompareStringEx( + internal static extern unsafe int CompareStringEx( char* lpLocaleName, uint dwCmpFlags, char* lpString1, @@ -61,7 +61,7 @@ internal static partial class Interop IntPtr lParam); [DllImport("kernel32.dll", EntryPoint = "CompareStringOrdinal")] - internal extern static unsafe int CompareStringOrdinal( + internal static extern unsafe int CompareStringOrdinal( char* lpString1, int cchCount1, char* lpString2, @@ -69,7 +69,7 @@ internal static partial class Interop bool bIgnoreCase); [DllImport("kernel32.dll", EntryPoint = "FindStringOrdinal")] - internal extern static unsafe int FindStringOrdinal( + internal static extern unsafe int FindStringOrdinal( uint dwFindStringOrdinalFlags, char* lpStringSource, int cchSource, @@ -78,7 +78,7 @@ internal static partial class Interop int bIgnoreCase); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static unsafe bool IsNLSDefinedString( + internal static extern unsafe bool IsNLSDefinedString( int Function, uint dwFlags, IntPtr lpVersionInformation, @@ -94,26 +94,26 @@ internal static partial class Interop internal static extern int GetLocaleInfoEx(string lpLocaleName, uint LCType, void* lpLCData, int cchData); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); + internal static extern bool EnumSystemLocalesEx(EnumLocalesProcEx lpLocaleEnumProcEx, uint dwFlags, void* lParam, IntPtr reserved); internal delegate BOOL EnumLocalesProcEx(char* lpLocaleString, uint dwFlags, void* lParam); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); + internal static extern int ResolveLocaleName(string lpNameToResolve, char* lpLocaleName, int cchLocaleName); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); + internal static extern bool EnumTimeFormatsEx(EnumTimeFormatsProcEx lpTimeFmtEnumProcEx, string lpLocaleName, uint dwFlags, void* lParam); internal delegate BOOL EnumTimeFormatsProcEx(char* lpTimeFormatString, void* lParam); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); + internal static extern int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, out int lpValue); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); + internal static extern int GetCalendarInfoEx(string lpLocaleName, uint Calendar, IntPtr lpReserved, uint CalType, IntPtr lpCalData, int cchData, IntPtr lpValue); [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, void* lParam); + internal static extern bool EnumCalendarInfoExEx(EnumCalendarInfoProcExEx pCalInfoEnumProcExEx, string lpLocaleName, uint Calendar, string lpReserved, uint CalType, void* lParam); internal delegate BOOL EnumCalendarInfoProcExEx(char* lpCalendarInfoString, uint Calendar, IntPtr lpReserved, void* lParam); @@ -128,6 +128,6 @@ internal static partial class Interop } [DllImport("kernel32.dll", CharSet = CharSet.Unicode)] - internal extern static unsafe bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); + internal static extern unsafe bool GetNLSVersionEx(int function, string localeName, NlsVersionInfoEx* lpVersionInformation); } } diff --git a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs index 05f13ac..68d4583 100644 --- a/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs +++ b/src/mscorlib/shared/Interop/Windows/Kernel32/Interop.TimeZone.cs @@ -86,7 +86,7 @@ internal static partial class Interop internal const uint TIME_ZONE_ID_INVALID = unchecked((uint)-1); [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] - internal extern static uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); + internal static extern uint GetDynamicTimeZoneInformation(out TIME_DYNAMIC_ZONE_INFORMATION pTimeZoneInformation); [DllImport(Libraries.Kernel32, CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] internal static extern uint GetTimeZoneInformation(out TIME_ZONE_INFORMATION lpTimeZoneInformation); diff --git a/src/mscorlib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs b/src/mscorlib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs index 60cfb23..57accbe 100644 --- a/src/mscorlib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs +++ b/src/mscorlib/shared/Interop/Windows/Ole32/Interop.CoCreateGuid.cs @@ -10,6 +10,6 @@ internal static partial class Interop internal static partial class Ole32 { [DllImport(Interop.Libraries.Ole32)] - internal extern static int CoCreateGuid(out Guid guid); + internal static extern int CoCreateGuid(out Guid guid); } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs index fafdd7c..f278aa9 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventProvider.cs @@ -331,7 +331,7 @@ namespace System.Diagnostics.Tracing protected EventKeywords MatchAnyKeyword { get { return (EventKeywords)m_anyKeywordMask; } set { m_anyKeywordMask = unchecked((long)value); } } protected EventKeywords MatchAllKeyword { get { return (EventKeywords)m_allKeywordMask; } set { m_allKeywordMask = unchecked((long)value); } } - static private int FindNull(byte[] buffer, int idx) + private static int FindNull(byte[] buffer, int idx) { while (idx < buffer.Length && buffer[idx] != 0) idx++; @@ -1133,7 +1133,7 @@ namespace System.Diagnostics.Tracing // // [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1045:DoNotPassTypesByReference")] - internal unsafe protected bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) + internal protected unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr eventHandle, Guid* activityID, Guid* childActivityID, int dataCount, IntPtr data) { if (childActivityID != null) { diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs index 40d39ce..8547d77 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/EventSource.cs @@ -1955,7 +1955,7 @@ namespace System.Diagnostics.Tracing } } - unsafe private object[] SerializeEventArgs(int eventId, object[] args) + private unsafe object[] SerializeEventArgs(int eventId, object[] args) { TraceLoggingEventTypes eventTypes = m_eventData[eventId].TraceLoggingEventTypes; if (eventTypes == null) @@ -2012,7 +2012,7 @@ namespace System.Diagnostics.Tracing #endif //!ES_BUILD_PCL } - unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data) + private unsafe void WriteToAllListeners(int eventId, Guid* childActivityID, int eventDataCount, EventSource.EventData* data) { // We represent a byte[] as a integer denoting the length and then a blob of bytes in the data pointer. This causes a spurious // warning because eventDataCount is off by one for the byte[] case since a byte[] has 2 items associated it. So we want to check @@ -2047,7 +2047,7 @@ namespace System.Diagnostics.Tracing } // helper for writing to all EventListeners attached the current eventSource. - unsafe private void WriteToAllListeners(int eventId, Guid* childActivityID, params object[] args) + private unsafe void WriteToAllListeners(int eventId, Guid* childActivityID, params object[] args) { EventWrittenEventArgs eventCallbackArgs = new EventWrittenEventArgs(this); eventCallbackArgs.EventId = eventId; @@ -3465,7 +3465,7 @@ namespace System.Diagnostics.Tracing /// The method to probe. /// The literal value or -1 if the value could not be determined. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "Switch statement is clearer than alternatives")] - static private int GetHelperCallFirstArg(MethodInfo method) + private static int GetHelperCallFirstArg(MethodInfo method) { #if (!ES_BUILD_PCL && !ES_BUILD_PN) // Currently searches for the following pattern diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs index 865082f..2d71550 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/EventSourceActivity.cs @@ -314,7 +314,7 @@ namespace System.Diagnostics.Tracing private State state; private string eventName; - static internal Guid s_empty; + internal static Guid s_empty; #endregion } } diff --git a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs index 2f460d2..001a8e8 100644 --- a/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs +++ b/src/mscorlib/shared/System/Diagnostics/Tracing/TraceLogging/SimpleTypeInfos.cs @@ -136,7 +136,7 @@ namespace System.Diagnostics.Tracing public static TraceLoggingTypeInfo UIntPtr() { return new ScalarArrayTypeInfo(typeof(UIntPtr[]), Statics.FormatPtr, Statics.UIntPtrType, System.IntPtr.Size); } public static TraceLoggingTypeInfo Single() { return new ScalarArrayTypeInfo(typeof(Single[]), Statics.Format32, TraceLoggingDataType.Float, sizeof(Single)); } public static TraceLoggingTypeInfo Double() { return new ScalarArrayTypeInfo(typeof(Double[]), Statics.Format64, TraceLoggingDataType.Double, sizeof(Double)); } - public unsafe static TraceLoggingTypeInfo Guid() { return new ScalarArrayTypeInfo(typeof(Guid), (f, t) => Statics.MakeDataType(TraceLoggingDataType.Guid, f), TraceLoggingDataType.Guid, sizeof(Guid)); } + public static unsafe TraceLoggingTypeInfo Guid() { return new ScalarArrayTypeInfo(typeof(Guid), (f, t) => Statics.MakeDataType(TraceLoggingDataType.Guid, f), TraceLoggingDataType.Guid, sizeof(Guid)); } } /// diff --git a/src/mscorlib/shared/System/Double.cs b/src/mscorlib/shared/System/Double.cs index 1351ae9..8eae312 100644 --- a/src/mscorlib/shared/System/Double.cs +++ b/src/mscorlib/shared/System/Double.cs @@ -47,7 +47,7 @@ namespace System /// Determines whether the specified value is finite (zero, subnormal, or normal). [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsFinite(double d) + public static unsafe bool IsFinite(double d) { var bits = BitConverter.DoubleToInt64Bits(d); return (bits & 0x7FFFFFFFFFFFFFFF) < 0x7FF0000000000000; @@ -56,7 +56,7 @@ namespace System /// Determines whether the specified value is infinite. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsInfinity(double d) + public static unsafe bool IsInfinity(double d) { var bits = BitConverter.DoubleToInt64Bits(d); return (bits & 0x7FFFFFFFFFFFFFFF) == 0x7FF0000000000000; @@ -65,7 +65,7 @@ namespace System /// Determines whether the specified value is NaN. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsNaN(double d) + public static unsafe bool IsNaN(double d) { var bits = BitConverter.DoubleToInt64Bits(d); return (bits & 0x7FFFFFFFFFFFFFFF) > 0x7FF0000000000000; @@ -74,7 +74,7 @@ namespace System /// Determines whether the specified value is negative. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsNegative(double d) + public static unsafe bool IsNegative(double d) { var bits = unchecked((ulong)BitConverter.DoubleToInt64Bits(d)); return (bits & 0x8000000000000000) == 0x8000000000000000; @@ -91,7 +91,7 @@ namespace System /// Determines whether the specified value is normal. [NonVersionable] // This is probably not worth inlining, it has branches and should be rarely called - public unsafe static bool IsNormal(double d) + public static unsafe bool IsNormal(double d) { var bits = BitConverter.DoubleToInt64Bits(d); bits &= 0x7FFFFFFFFFFFFFFF; @@ -109,7 +109,7 @@ namespace System /// Determines whether the specified value is subnormal. [NonVersionable] // This is probably not worth inlining, it has branches and should be rarely called - public unsafe static bool IsSubnormal(double d) + public static unsafe bool IsSubnormal(double d) { var bits = BitConverter.DoubleToInt64Bits(d); bits &= 0x7FFFFFFFFFFFFFFF; diff --git a/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs b/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs index 595fb56..cd3a150 100644 --- a/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs +++ b/src/mscorlib/shared/System/Globalization/DateTimeFormat.cs @@ -173,7 +173,7 @@ namespace System FormatDigits(outputBuffer, value, len, false); } - internal unsafe static void FormatDigits(StringBuilder outputBuffer, int value, int len, bool overrideLengthLimit) + internal static unsafe void FormatDigits(StringBuilder outputBuffer, int value, int len, bool overrideLengthLimit) { Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); diff --git a/src/mscorlib/shared/System/Guid.cs b/src/mscorlib/shared/System/Guid.cs index 1d0942f..37a8dce 100644 --- a/src/mscorlib/shared/System/Guid.cs +++ b/src/mscorlib/shared/System/Guid.cs @@ -1232,7 +1232,7 @@ namespace System return (char)((a > 9) ? a - 10 + 0x61 : a + 0x30); } - unsafe private static int HexsToChars(char* guidChars, int a, int b) + private static unsafe int HexsToChars(char* guidChars, int a, int b) { guidChars[0] = HexToChar(a >> 4); guidChars[1] = HexToChar(a); @@ -1243,7 +1243,7 @@ namespace System return 4; } - unsafe private static int HexsToCharsHexOutput(char* guidChars, int a, int b) + private static unsafe int HexsToCharsHexOutput(char* guidChars, int a, int b) { guidChars[0] = '0'; guidChars[1] = 'x'; diff --git a/src/mscorlib/shared/System/IO/FileStream.Windows.cs b/src/mscorlib/shared/System/IO/FileStream.Windows.cs index 291a30b..5a3159a 100644 --- a/src/mscorlib/shared/System/IO/FileStream.Windows.cs +++ b/src/mscorlib/shared/System/IO/FileStream.Windows.cs @@ -171,7 +171,7 @@ namespace System.IO _filePosition = 0; } - private unsafe static Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(FileShare share) + private static unsafe Interop.Kernel32.SECURITY_ATTRIBUTES GetSecAttrs(FileShare share) { Interop.Kernel32.SECURITY_ATTRIBUTES secAttrs = default(Interop.Kernel32.SECURITY_ATTRIBUTES); if ((share & FileShare.Inheritable) != 0) @@ -186,7 +186,7 @@ namespace System.IO // Verifies that this handle supports synchronous IO operations (unless you // didn't open it for either reading or writing). - private unsafe static void VerifyHandleIsSync(SafeFileHandle handle, FileAccess access) + private static unsafe void VerifyHandleIsSync(SafeFileHandle handle, FileAccess access) { // Do NOT use this method on pipes. Reading or writing to a pipe may // cause an app to block incorrectly, introducing a deadlock (depending @@ -850,7 +850,7 @@ namespace System.IO } } - unsafe private Task ReadNativeAsync(Memory destination, int numBufferedBytesRead, CancellationToken cancellationToken) + private unsafe Task ReadNativeAsync(Memory destination, int numBufferedBytesRead, CancellationToken cancellationToken) { AssertCanRead(); Debug.Assert(_useAsyncIO, "ReadNativeAsync doesn't work on synchronous file streams!"); @@ -1535,7 +1535,7 @@ namespace System.IO } /// Overlapped callback: store the results, then invoke the continuation delegate. - internal unsafe static void IOCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP) + internal static unsafe void IOCallback(uint errorCode, uint numBytes, NativeOverlapped* pOVERLAP) { var awaitable = (AsyncCopyToAwaitable)ThreadPoolBoundHandle.GetNativeOverlappedState(pOVERLAP); diff --git a/src/mscorlib/shared/System/IO/Path.cs b/src/mscorlib/shared/System/IO/Path.cs index 9033350..cd1655e 100644 --- a/src/mscorlib/shared/System/IO/Path.cs +++ b/src/mscorlib/shared/System/IO/Path.cs @@ -529,7 +529,7 @@ namespace System.IO return JoinInternal(first, second, third, fourth); } - private unsafe static string JoinInternal(ReadOnlySpan first, ReadOnlySpan second) + private static unsafe string JoinInternal(ReadOnlySpan first, ReadOnlySpan second) { Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths"); @@ -551,7 +551,7 @@ namespace System.IO } } - private unsafe static string JoinInternal(ReadOnlySpan first, ReadOnlySpan second, ReadOnlySpan third) + private static unsafe string JoinInternal(ReadOnlySpan first, ReadOnlySpan second, ReadOnlySpan third) { Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0, "should have dealt with empty paths"); @@ -579,7 +579,7 @@ namespace System.IO } } - private unsafe static string JoinInternal(ReadOnlySpan first, ReadOnlySpan second, ReadOnlySpan third, ReadOnlySpan fourth) + private static unsafe string JoinInternal(ReadOnlySpan first, ReadOnlySpan second, ReadOnlySpan third, ReadOnlySpan fourth) { Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0 && fourth.Length > 0, "should have dealt with empty paths"); diff --git a/src/mscorlib/shared/System/IO/PathInternal.cs b/src/mscorlib/shared/System/IO/PathInternal.cs index eb06c26..02a8731 100644 --- a/src/mscorlib/shared/System/IO/PathInternal.cs +++ b/src/mscorlib/shared/System/IO/PathInternal.cs @@ -63,7 +63,7 @@ namespace System.IO /// /// Gets the count of common characters from the left optionally ignoring case /// - unsafe internal static int EqualStartingCharacterCount(string first, string second, bool ignoreCase) + internal static unsafe int EqualStartingCharacterCount(string first, string second, bool ignoreCase) { if (string.IsNullOrEmpty(first) || string.IsNullOrEmpty(second)) return 0; diff --git a/src/mscorlib/shared/System/IntPtr.cs b/src/mscorlib/shared/System/IntPtr.cs index 45c2ded..684c138 100644 --- a/src/mscorlib/shared/System/IntPtr.cs +++ b/src/mscorlib/shared/System/IntPtr.cs @@ -23,7 +23,7 @@ namespace System // See https://github.com/dotnet/corert/blob/master/Documentation/design-docs/diagnostics/diagnostics-tools-contract.md for more details. // Please do not change the type, the name, or the semantic usage of this member without understanding the implication for tools. // Get in touch with the diagnostics team if you have questions. - unsafe private void* _value; // Do not rename (binary serialization) + private unsafe void* _value; // Do not rename (binary serialization) [Intrinsic] public static readonly IntPtr Zero; diff --git a/src/mscorlib/shared/System/Number.Parsing.cs b/src/mscorlib/shared/System/Number.Parsing.cs index c6ae34d..2ae0618 100644 --- a/src/mscorlib/shared/System/Number.Parsing.cs +++ b/src/mscorlib/shared/System/Number.Parsing.cs @@ -300,7 +300,7 @@ namespace System return true; } - internal unsafe static int ParseInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info) + internal static unsafe int ParseInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info) { NumberBuffer number = default; int i = 0; @@ -324,7 +324,7 @@ namespace System return i; } - internal unsafe static long ParseInt64(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe long ParseInt64(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; long i = 0; @@ -348,7 +348,7 @@ namespace System return i; } - internal unsafe static uint ParseUInt32(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe uint ParseUInt32(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; uint i = 0; @@ -373,7 +373,7 @@ namespace System return i; } - internal unsafe static ulong ParseUInt64(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe ulong ParseUInt64(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; ulong i = 0; @@ -396,7 +396,7 @@ namespace System return i; } - private unsafe static bool ParseNumber(ref char* str, NumberStyles options, ref NumberBuffer number, NumberFormatInfo numfmt, bool parseDecimal) + private static unsafe bool ParseNumber(ref char* str, NumberStyles options, ref NumberBuffer number, NumberFormatInfo numfmt, bool parseDecimal) { const int StateSign = 0x0001; const int StateParens = 0x0002; @@ -601,7 +601,7 @@ namespace System return false; } - internal unsafe static bool TryParseInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out int result) + internal static unsafe bool TryParseInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out int result) { NumberBuffer number = default; result = 0; @@ -628,7 +628,7 @@ namespace System return true; } - internal unsafe static bool TryParseInt64(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out long result) + internal static unsafe bool TryParseInt64(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out long result) { NumberBuffer number = default; result = 0; @@ -655,7 +655,7 @@ namespace System return true; } - internal unsafe static bool TryParseUInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out uint result) + internal static unsafe bool TryParseUInt32(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out uint result) { NumberBuffer number = default; result = 0; @@ -682,7 +682,7 @@ namespace System return true; } - internal unsafe static bool TryParseUInt64(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out ulong result) + internal static unsafe bool TryParseUInt64(ReadOnlySpan s, NumberStyles style, NumberFormatInfo info, out ulong result) { NumberBuffer number = default; result = 0; @@ -709,7 +709,7 @@ namespace System return true; } - internal unsafe static decimal ParseDecimal(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe decimal ParseDecimal(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; decimal result = 0; @@ -723,7 +723,7 @@ namespace System return result; } - internal unsafe static double ParseDouble(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe double ParseDouble(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; double d = 0; @@ -757,7 +757,7 @@ namespace System return d; } - internal unsafe static float ParseSingle(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) + internal static unsafe float ParseSingle(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt) { NumberBuffer number = default; double d = 0; @@ -795,7 +795,7 @@ namespace System return castSingle; } - internal unsafe static bool TryParseDecimal(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out decimal result) + internal static unsafe bool TryParseDecimal(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out decimal result) { NumberBuffer number = default; result = 0; @@ -812,7 +812,7 @@ namespace System return true; } - internal unsafe static bool TryParseDouble(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out double result) + internal static unsafe bool TryParseDouble(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out double result) { NumberBuffer number = default; result = 0; @@ -829,7 +829,7 @@ namespace System return true; } - internal unsafe static bool TryParseSingle(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out float result) + internal static unsafe bool TryParseSingle(ReadOnlySpan value, NumberStyles options, NumberFormatInfo numfmt, out float result) { NumberBuffer number = default; result = 0; @@ -897,7 +897,7 @@ namespace System return true; } - private unsafe static char* MatchChars(char* p, string str) + private static unsafe char* MatchChars(char* p, string str) { fixed (char* stringPointer = str) { @@ -905,7 +905,7 @@ namespace System } } - private unsafe static char* MatchChars(char* p, char* str) + private static unsafe char* MatchChars(char* p, char* str) { Debug.Assert(p != null && str != null); diff --git a/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs b/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs index 227fed3..bc93fec 100644 --- a/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs +++ b/src/mscorlib/shared/System/Security/SafeBSTRHandle.cs @@ -50,7 +50,7 @@ namespace System.Security internal unsafe uint Length => Interop.OleAut32.SysStringLen(this); - internal unsafe static void Copy(SafeBSTRHandle source, SafeBSTRHandle target, uint bytesToCopy) + internal static unsafe void Copy(SafeBSTRHandle source, SafeBSTRHandle target, uint bytesToCopy) { if (bytesToCopy == 0) { diff --git a/src/mscorlib/shared/System/Single.cs b/src/mscorlib/shared/System/Single.cs index 013dd9b..cb5a309 100644 --- a/src/mscorlib/shared/System/Single.cs +++ b/src/mscorlib/shared/System/Single.cs @@ -52,7 +52,7 @@ namespace System /// Determines whether the specified value is infinite. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsInfinity(float f) + public static unsafe bool IsInfinity(float f) { var bits = BitConverter.SingleToInt32Bits(f); return (bits & 0x7FFFFFFF) == 0x7F800000; @@ -61,7 +61,7 @@ namespace System /// Determines whether the specified value is NaN. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsNaN(float f) + public static unsafe bool IsNaN(float f) { var bits = BitConverter.SingleToInt32Bits(f); return (bits & 0x7FFFFFFF) > 0x7F800000; @@ -70,7 +70,7 @@ namespace System /// Determines whether the specified value is negative. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsNegative(float f) + public static unsafe bool IsNegative(float f) { var bits = unchecked((uint)BitConverter.SingleToInt32Bits(f)); return (bits & 0x80000000) == 0x80000000; @@ -79,7 +79,7 @@ namespace System /// Determines whether the specified value is negative infinity. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsNegativeInfinity(float f) + public static unsafe bool IsNegativeInfinity(float f) { return (f == float.NegativeInfinity); } @@ -87,7 +87,7 @@ namespace System /// Determines whether the specified value is normal. [NonVersionable] // This is probably not worth inlining, it has branches and should be rarely called - public unsafe static bool IsNormal(float f) + public static unsafe bool IsNormal(float f) { var bits = BitConverter.SingleToInt32Bits(f); bits &= 0x7FFFFFFF; @@ -97,7 +97,7 @@ namespace System /// Determines whether the specified value is positive infinity. [NonVersionable] [MethodImpl(MethodImplOptions.AggressiveInlining)] - public unsafe static bool IsPositiveInfinity(float f) + public static unsafe bool IsPositiveInfinity(float f) { return (f == float.PositiveInfinity); } @@ -105,7 +105,7 @@ namespace System /// Determines whether the specified value is subnormal. [NonVersionable] // This is probably not worth inlining, it has branches and should be rarely called - public unsafe static bool IsSubnormal(float f) + public static unsafe bool IsSubnormal(float f) { var bits = BitConverter.SingleToInt32Bits(f); bits &= 0x7FFFFFFF; diff --git a/src/mscorlib/shared/System/String.Searching.cs b/src/mscorlib/shared/System/String.Searching.cs index c86d135..cc6e218 100644 --- a/src/mscorlib/shared/System/String.Searching.cs +++ b/src/mscorlib/shared/System/String.Searching.cs @@ -374,12 +374,12 @@ namespace System return false; } - private unsafe static bool IsCharBitSet(uint* charMap, byte value) + private static unsafe bool IsCharBitSet(uint* charMap, byte value) { return (charMap[value & PROBABILISTICMAP_BLOCK_INDEX_MASK] & (1u << (value >> PROBABILISTICMAP_BLOCK_INDEX_SHIFT))) != 0; } - private unsafe static void SetCharBit(uint* charMap, byte value) + private static unsafe void SetCharBit(uint* charMap, byte value) { charMap[value & PROBABILISTICMAP_BLOCK_INDEX_MASK] |= 1u << (value >> PROBABILISTICMAP_BLOCK_INDEX_SHIFT); } diff --git a/src/mscorlib/shared/System/String.cs b/src/mscorlib/shared/System/String.cs index e303b43..0f88477 100644 --- a/src/mscorlib/shared/System/String.cs +++ b/src/mscorlib/shared/System/String.cs @@ -447,7 +447,7 @@ namespace System // Helper for encodings so they can talk to our buffer directly // stringLength must be the exact size we'll expect - internal unsafe static string CreateStringFromEncoding( + internal static unsafe string CreateStringFromEncoding( byte* bytes, int byteLength, Encoding encoding) { Debug.Assert(bytes != null); diff --git a/src/mscorlib/shared/System/Text/StringBuilder.cs b/src/mscorlib/shared/System/Text/StringBuilder.cs index 65a4a24..f94cdbb 100644 --- a/src/mscorlib/shared/System/Text/StringBuilder.cs +++ b/src/mscorlib/shared/System/Text/StringBuilder.cs @@ -2044,7 +2044,7 @@ namespace System.Text /// /// The pointer to the start of the character buffer. /// The number of characters in the buffer. - unsafe private void ReplaceInPlaceAtChunk(ref StringBuilder chunk, ref int indexInChunk, char* value, int count) + private unsafe void ReplaceInPlaceAtChunk(ref StringBuilder chunk, ref int indexInChunk, char* value, int count) { if (count != 0) { diff --git a/src/mscorlib/shared/System/Text/UTF8Encoding.cs b/src/mscorlib/shared/System/Text/UTF8Encoding.cs index 67f87c9..2ea5096 100644 --- a/src/mscorlib/shared/System/Text/UTF8Encoding.cs +++ b/src/mscorlib/shared/System/Text/UTF8Encoding.cs @@ -783,13 +783,13 @@ namespace System.Text // diffs two char pointers using unsigned arithmetic. The unsigned arithmetic // is good enough for us, and it tends to generate better code than the signed // arithmetic generated by default - unsafe private static int PtrDiff(char* a, char* b) + private static unsafe int PtrDiff(char* a, char* b) { return (int)(((uint)((byte*)a - (byte*)b)) >> 1); } // byte* flavor just for parity - unsafe private static int PtrDiff(byte* a, byte* b) + private static unsafe int PtrDiff(byte* a, byte* b) { return (int)(a - b); } diff --git a/src/mscorlib/shared/System/TimeZoneInfo.Win32.cs b/src/mscorlib/shared/System/TimeZoneInfo.Win32.cs index 5950c95..03f54a5 100644 --- a/src/mscorlib/shared/System/TimeZoneInfo.Win32.cs +++ b/src/mscorlib/shared/System/TimeZoneInfo.Win32.cs @@ -676,7 +676,7 @@ namespace System return true; } - private unsafe static bool TryGetTimeZoneEntryFromRegistry(RegistryKey key, string name, out REG_TZI_FORMAT dtzi) + private static unsafe bool TryGetTimeZoneEntryFromRegistry(RegistryKey key, string name, out REG_TZI_FORMAT dtzi) { byte[] regValue = key.GetValue(name, null, RegistryValueOptions.None) as byte[]; if (regValue == null || regValue.Length != sizeof(REG_TZI_FORMAT)) diff --git a/src/mscorlib/shared/System/UIntPtr.cs b/src/mscorlib/shared/System/UIntPtr.cs index 23750e9..5907226 100644 --- a/src/mscorlib/shared/System/UIntPtr.cs +++ b/src/mscorlib/shared/System/UIntPtr.cs @@ -20,7 +20,7 @@ namespace System [System.Runtime.CompilerServices.TypeForwardedFrom("mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089")] public struct UIntPtr : IEquatable, ISerializable { - unsafe private void* _value; // Do not rename (binary serialization) + private unsafe void* _value; // Do not rename (binary serialization) [Intrinsic] public static readonly UIntPtr Zero; diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs index 5087f27..f9b4af8 100644 --- a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs +++ b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs @@ -1105,7 +1105,7 @@ namespace Microsoft.Win32 } } - static private void ValidateKeyName(string name) + private static void ValidateKeyName(string name) { if (name == null) { @@ -1127,7 +1127,7 @@ namespace Microsoft.Win32 ThrowHelper.ThrowArgumentException(ExceptionResource.Arg_RegKeyStrLenBug); } - static private void ValidateKeyView(RegistryView view) + private static void ValidateKeyView(RegistryView view) { if (view != RegistryView.Default && view != RegistryView.Registry32 && view != RegistryView.Registry64) { diff --git a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs index c0e016d..cc8887a 100644 --- a/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs +++ b/src/mscorlib/src/Microsoft/Win32/UnsafeNativeMethods.cs @@ -77,7 +77,7 @@ namespace Microsoft.Win32 ); [StructLayout(LayoutKind.Sequential)] - unsafe internal struct EVENT_FILTER_DESCRIPTOR + internal unsafe struct EVENT_FILTER_DESCRIPTOR { public long Ptr; public int Size; diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index eef34ad..3545328 100644 --- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -22,7 +22,7 @@ * private static extern SafeFileHandle CreateFile(...); * * [DllImport(Interop.Libraries.Kernel32, SetLastError=true)] - * unsafe internal static extern int ReadFile(SafeFileHandle handle, ...); + * internal static extern unsafe int ReadFile(SafeFileHandle handle, ...); * * [DllImport(Interop.Libraries.Kernel32, SetLastError=true)] * internal static extern bool CloseHandle(IntPtr handle); @@ -264,16 +264,16 @@ namespace Microsoft.Win32 private static extern bool GlobalMemoryStatusExNative([In, Out] ref MEMORYSTATUSEX buffer); [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern UIntPtr VirtualQuery(void* address, ref MEMORY_BASIC_INFORMATION buffer, UIntPtr sizeOfBuffer); + internal static extern unsafe UIntPtr VirtualQuery(void* address, ref MEMORY_BASIC_INFORMATION buffer, UIntPtr sizeOfBuffer); // VirtualAlloc should generally be avoided, but is needed in // the MemoryFailPoint implementation (within a CER) to increase the // size of the page file, ignoring any host memory allocators. [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern void* VirtualAlloc(void* address, UIntPtr numBytes, int commitOrReserve, int pageProtectionMode); + internal static extern unsafe void* VirtualAlloc(void* address, UIntPtr numBytes, int commitOrReserve, int pageProtectionMode); [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - unsafe internal static extern bool VirtualFree(void* address, UIntPtr numBytes, int pageFreeMode); + internal static extern unsafe bool VirtualFree(void* address, UIntPtr numBytes, int pageFreeMode); [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Ansi, ExactSpelling = true, EntryPoint = "lstrlenA")] internal static extern int lstrlenA(IntPtr ptr); @@ -324,7 +324,7 @@ namespace Microsoft.Win32 internal static extern bool CloseHandle(IntPtr handle); [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] - internal static unsafe extern int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); + internal static extern unsafe int WriteFile(SafeFileHandle handle, byte* bytes, int numBytesToWrite, out int numBytesWritten, IntPtr mustBeZero); [DllImport(Interop.Libraries.Kernel32, SetLastError = true, CharSet = CharSet.Auto, BestFitMapping = false)] internal static extern SafeWaitHandle CreateSemaphoreEx(SECURITY_ATTRIBUTES lpSecurityAttributes, int initialCount, int maximumCount, string name, uint flags, uint desiredAccess); @@ -371,10 +371,10 @@ namespace Microsoft.Win32 } [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode)] - internal static unsafe extern char* GetEnvironmentStrings(); + internal static extern unsafe char* GetEnvironmentStrings(); [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Unicode)] - internal static unsafe extern bool FreeEnvironmentStrings(char* pStrings); + internal static extern unsafe bool FreeEnvironmentStrings(char* pStrings); [DllImport(Interop.Libraries.Kernel32, CharSet = CharSet.Auto, SetLastError = true)] internal static extern uint GetCurrentProcessId(); @@ -394,13 +394,13 @@ namespace Microsoft.Win32 internal static extern int RegDeleteValue(SafeRegistryHandle hKey, String lpValueName); [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)] - internal unsafe static extern int RegEnumKeyEx(SafeRegistryHandle hKey, int dwIndex, + internal static extern unsafe int RegEnumKeyEx(SafeRegistryHandle hKey, int dwIndex, char[] lpName, ref int lpcbName, int[] lpReserved, [Out]StringBuilder lpClass, int[] lpcbClass, long[] lpftLastWriteTime); [DllImport(ADVAPI32, CharSet = CharSet.Auto, BestFitMapping = false)] - internal unsafe static extern int RegEnumValue(SafeRegistryHandle hKey, int dwIndex, + internal static extern unsafe int RegEnumValue(SafeRegistryHandle hKey, int dwIndex, char[] lpValueName, ref int lpcbValueName, IntPtr lpReserved_MustBeZero, int[] lpType, byte[] lpData, int[] lpcbData); @@ -454,7 +454,7 @@ namespace Microsoft.Win32 [DllImport(Interop.Libraries.Kernel32, SetLastError = true)] [return: MarshalAs(UnmanagedType.Bool)] - internal extern static bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); + internal static extern bool QueryUnbiasedInterruptTime(out ulong UnbiasedTime); internal const byte VER_GREATER_EQUAL = 0x3; internal const uint VER_MAJORVERSION = 0x0000002; diff --git a/src/mscorlib/src/System/ArgIterator.cs b/src/mscorlib/src/System/ArgIterator.cs index 4d0829d..67e549c 100644 --- a/src/mscorlib/src/System/ArgIterator.cs +++ b/src/mscorlib/src/System/ArgIterator.cs @@ -39,7 +39,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe extern ArgIterator(IntPtr arglist, void *ptr); + private extern unsafe ArgIterator(IntPtr arglist, void *ptr); // create an arg iterator that points just past 'firstArg'. // 'arglist' is the value returned by the ARGLIST instruction @@ -66,7 +66,7 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] // reference to TypedReference is banned, so have to pass result as void pointer - private unsafe extern void FCallGetNextArg(void * result); + private extern unsafe void FCallGetNextArg(void * result); // Alternate version of GetNextArg() intended primarily for IJW code // generated by VC's "va_arg()" construct. @@ -102,7 +102,7 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] // reference to TypedReference is banned, so have to pass result as void pointer - private unsafe extern void InternalGetNextArg(void * result, RuntimeType rt); + private extern unsafe void InternalGetNextArg(void * result, RuntimeType rt); // This method should invalidate the iterator (va_end). It is not supported yet. public void End() diff --git a/src/mscorlib/src/System/Array.cs b/src/mscorlib/src/System/Array.cs index 69c7b75..28a8d04 100644 --- a/src/mscorlib/src/System/Array.cs +++ b/src/mscorlib/src/System/Array.cs @@ -65,7 +65,7 @@ namespace System } // Create instance will create an array - public unsafe static Array CreateInstance(Type elementType, int length) + public static unsafe Array CreateInstance(Type elementType, int length) { if ((object)elementType == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType); @@ -78,7 +78,7 @@ namespace System return InternalCreate((void*)t.TypeHandle.Value, 1, &length, null); } - public unsafe static Array CreateInstance(Type elementType, int length1, int length2) + public static unsafe Array CreateInstance(Type elementType, int length1, int length2) { if ((object)elementType == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType); @@ -96,7 +96,7 @@ namespace System return InternalCreate((void*)t.TypeHandle.Value, 2, pLengths, null); } - public unsafe static Array CreateInstance(Type elementType, int length1, int length2, int length3) + public static unsafe Array CreateInstance(Type elementType, int length1, int length2, int length3) { if ((object)elementType == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType); @@ -117,7 +117,7 @@ namespace System return InternalCreate((void*)t.TypeHandle.Value, 3, pLengths, null); } - public unsafe static Array CreateInstance(Type elementType, params int[] lengths) + public static unsafe Array CreateInstance(Type elementType, params int[] lengths) { if ((object)elementType == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType); @@ -165,7 +165,7 @@ namespace System } - public unsafe static Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds) + public static unsafe Array CreateInstance(Type elementType, int[] lengths, int[] lowerBounds) { if (elementType == null) ThrowHelper.ThrowArgumentNullException(ExceptionArgument.elementType); @@ -196,7 +196,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern Array InternalCreate(void* elementType, int rank, int* pLengths, int* pLowerBounds); + private static extern unsafe Array InternalCreate(void* elementType, int rank, int* pLengths, int* pLowerBounds); internal static Array UnsafeCreateInstance(Type elementType, int length) { @@ -476,12 +476,12 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] // reference to TypedReference is banned, so have to pass result as pointer - private unsafe extern void InternalGetReference(void* elemRef, int rank, int* pIndices); + private extern unsafe void InternalGetReference(void* elemRef, int rank, int* pIndices); // Ideally, we would like to use TypedReference.SetValue instead. Unfortunately, TypedReference.SetValue // always throws not-supported exception [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe extern static void InternalSetValue(void* target, Object value); + private static extern unsafe void InternalSetValue(void* target, Object value); public extern int Length { diff --git a/src/mscorlib/src/System/Buffer.cs b/src/mscorlib/src/System/Buffer.cs index d318959..3a9c8e8 100644 --- a/src/mscorlib/src/System/Buffer.cs +++ b/src/mscorlib/src/System/Buffer.cs @@ -119,13 +119,13 @@ namespace System return _ByteLength(array); } - internal unsafe static void ZeroMemory(byte* src, long len) + internal static unsafe void ZeroMemory(byte* src, long len) { while (len-- > 0) *(src + len) = 0; } - internal unsafe static void Memcpy(byte[] dest, int destIndex, byte* src, int srcIndex, int len) + internal static unsafe void Memcpy(byte[] dest, int destIndex, byte* src, int srcIndex, int len) { Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); Debug.Assert(dest.Length - destIndex >= len, "not enough bytes in dest"); @@ -139,7 +139,7 @@ namespace System } } - internal unsafe static void Memcpy(byte* pDest, int destIndex, byte[] src, int srcIndex, int len) + internal static unsafe void Memcpy(byte* pDest, int destIndex, byte[] src, int srcIndex, int len) { Debug.Assert((srcIndex >= 0) && (destIndex >= 0) && (len >= 0), "Index and length must be non-negative!"); Debug.Assert(src.Length - srcIndex >= len, "not enough bytes in src"); @@ -164,10 +164,10 @@ namespace System // 2. It is difficult to get this right for arm and again due to release dates we would like to visit it later. #if ARM [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe static extern void Memcpy(byte* dest, byte* src, int len); + internal static extern unsafe void Memcpy(byte* dest, byte* src, int len); #else // ARM [MethodImplAttribute(MethodImplOptions.AggressiveInlining)] - internal unsafe static void Memcpy(byte* dest, byte* src, int len) + internal static unsafe void Memcpy(byte* dest, byte* src, int len) { Debug.Assert(len >= 0, "Negative length in memcopy!"); Memmove(dest, src, (uint)len); @@ -175,7 +175,7 @@ namespace System #endif // ARM // This method has different signature for x64 and other platforms and is done for performance reasons. - internal unsafe static void Memmove(byte* dest, byte* src, nuint len) + internal static unsafe void Memmove(byte* dest, byte* src, nuint len) { #if AMD64 || (BIT32 && !ARM) const nuint CopyThreshold = 2048; @@ -592,7 +592,7 @@ PInvoke: // Non-inlinable wrapper around the QCall that avoids polluting the fast path // with P/Invoke prolog/epilog. [MethodImplAttribute(MethodImplOptions.NoInlining)] - private unsafe static void _Memmove(byte* dest, byte* src, nuint len) + private static unsafe void _Memmove(byte* dest, byte* src, nuint len) { __Memmove(dest, src, len); } @@ -600,7 +600,7 @@ PInvoke: // Non-inlinable wrapper around the QCall that avoids polluting the fast path // with P/Invoke prolog/epilog. [MethodImplAttribute(MethodImplOptions.NoInlining)] - private unsafe static void _Memmove(ref byte dest, ref byte src, nuint len) + private static unsafe void _Memmove(ref byte dest, ref byte src, nuint len) { fixed (byte* pDest = &dest) fixed (byte* pSrc = &src) @@ -608,7 +608,7 @@ PInvoke: } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - extern private unsafe static void __Memmove(byte* dest, byte* src, nuint len); + private static extern unsafe void __Memmove(byte* dest, byte* src, nuint len); // The attributes on this method are chosen for best JIT performance. // Please do not edit unless intentional. diff --git a/src/mscorlib/src/System/CLRConfig.cs b/src/mscorlib/src/System/CLRConfig.cs index de7c9b0..b9f0084 100644 --- a/src/mscorlib/src/System/CLRConfig.cs +++ b/src/mscorlib/src/System/CLRConfig.cs @@ -21,7 +21,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static bool GetConfigBoolValue(string configSwitchName, out bool exist); + private static extern bool GetConfigBoolValue(string configSwitchName, out bool exist); } } // namespace System diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs index 5cc8bb8..690fafb 100644 --- a/src/mscorlib/src/System/Delegate.cs +++ b/src/mscorlib/src/System/Delegate.cs @@ -540,7 +540,7 @@ namespace System // V2 internal API. // This is Critical because it skips the security check when creating the delegate. - internal unsafe static Delegate CreateDelegateNoSecurityCheck(Type type, Object target, RuntimeMethodHandle method) + internal static unsafe Delegate CreateDelegateNoSecurityCheck(Type type, Object target, RuntimeMethodHandle method) { // Validate the parameters. if (type == null) @@ -633,13 +633,13 @@ namespace System private extern bool BindToMethodInfo(Object target, IRuntimeMethodInfo method, RuntimeType methodType, DelegateBindingFlags flags); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static MulticastDelegate InternalAlloc(RuntimeType type); + private static extern MulticastDelegate InternalAlloc(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static MulticastDelegate InternalAllocLike(Delegate d); + internal static extern MulticastDelegate InternalAllocLike(Delegate d); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool InternalEqualTypes(object a, object b); + internal static extern bool InternalEqualTypes(object a, object b); // Used by the ctor. Do not call directly. // The name of this function will appear in managed stacktraces as delegate constructor. @@ -656,7 +656,7 @@ namespace System internal extern IRuntimeMethodInfo FindMethodHandle(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool InternalEqualMethodHandles(Delegate left, Delegate right); + internal static extern bool InternalEqualMethodHandles(Delegate left, Delegate right); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal extern IntPtr AdjustTarget(Object target, IntPtr methodPtr); @@ -670,7 +670,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool CompareUnmanagedFunctionPtrs(Delegate d1, Delegate d2); + internal static extern bool CompareUnmanagedFunctionPtrs(Delegate d1, Delegate d2); } // These flags effect the way BindToMethodInfo and BindToMethodName are allowed to bind a delegate to a target method. Their diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs index a246d1b..902c676 100644 --- a/src/mscorlib/src/System/Environment.cs +++ b/src/mscorlib/src/System/Environment.cs @@ -203,7 +203,7 @@ namespace System s_CommandLineArgs = cmdLineArgs; } - private unsafe static char[] GetEnvironmentCharArray() + private static unsafe char[] GetEnvironmentCharArray() { char[] block = null; diff --git a/src/mscorlib/src/System/Exception.cs b/src/mscorlib/src/System/Exception.cs index 625f006..abb9af8 100644 --- a/src/mscorlib/src/System/Exception.cs +++ b/src/mscorlib/src/System/Exception.cs @@ -258,7 +258,7 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] - static extern private IRuntimeMethodInfo GetMethodFromStackTrace(Object stackTrace); + static private extern IRuntimeMethodInfo GetMethodFromStackTrace(Object stackTrace); private MethodBase GetExceptionMethodFromStackTrace() { @@ -725,7 +725,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static bool nIsTransient(int hr); + private static extern bool nIsTransient(int hr); // This piece of infrastructure exists to help avoid deadlocks diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs index ba42ae4..e9fdf01 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs @@ -739,7 +739,7 @@ namespace System.Globalization return new SortKey(Name, source, options, keyData); } - private unsafe static bool IsSortable(char *text, int length) + private static unsafe bool IsSortable(char *text, int length) { Debug.Assert(!GlobalizationMode.Invariant); @@ -814,7 +814,7 @@ namespace System.Globalization } [DllImport(JitHelpers.QCall)] - private static unsafe extern int InternalHashSortKey(byte* sortKey, int sortKeyLength); + private static extern unsafe int InternalHashSortKey(byte* sortKey, int sortKeyLength); private static CompareOptions GetOrdinalCompareOptions(CompareOptions options) { diff --git a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs index 0008101..4151859 100644 --- a/src/mscorlib/src/System/Globalization/EncodingDataItem.cs +++ b/src/mscorlib/src/System/Globalization/EncodingDataItem.cs @@ -26,14 +26,14 @@ namespace System.Globalization internal String m_bodyName; internal uint m_flags; - unsafe internal CodePageDataItem(int dataIndex) + internal unsafe CodePageDataItem(int dataIndex) { m_dataIndex = dataIndex; m_uiFamilyCodePage = EncodingTable.codePageDataPtr[dataIndex].uiFamilyCodePage; m_flags = EncodingTable.codePageDataPtr[dataIndex].flags; } - unsafe internal static String CreateString(sbyte* pStrings, uint index) + internal static unsafe String CreateString(sbyte* pStrings, uint index) { if (pStrings[0] == '|') // |str1|str2|str3 { @@ -68,7 +68,7 @@ namespace System.Globalization } } - unsafe public String WebName + public unsafe String WebName { get { @@ -88,7 +88,7 @@ namespace System.Globalization } } - unsafe public String HeaderName + public unsafe String HeaderName { get { @@ -100,7 +100,7 @@ namespace System.Globalization } } - unsafe public String BodyName + public unsafe String BodyName { get { @@ -112,7 +112,7 @@ namespace System.Globalization } } - unsafe public uint Flags + public unsafe uint Flags { get { diff --git a/src/mscorlib/src/System/Globalization/EncodingTable.cs b/src/mscorlib/src/System/Globalization/EncodingTable.cs index 75ab073..d09b057 100644 --- a/src/mscorlib/src/System/Globalization/EncodingTable.cs +++ b/src/mscorlib/src/System/Globalization/EncodingTable.cs @@ -33,12 +33,12 @@ namespace System.Globalization // // This points to a native data table which maps an encoding name to the correct code page. // - unsafe internal static InternalEncodingDataItem* encodingDataPtr = GetEncodingData(); + internal static unsafe InternalEncodingDataItem* encodingDataPtr = GetEncodingData(); // // This points to a native data table which stores the properties for the code page, and // the table is indexed by code page. // - unsafe internal static InternalCodePageDataItem* codePageDataPtr = GetCodePageData(); + internal static unsafe InternalCodePageDataItem* codePageDataPtr = GetCodePageData(); // // This caches the mapping of an encoding name to a code page. // @@ -50,7 +50,7 @@ namespace System.Globalization // Find the data item by binary searching the table that we have in native. // nativeCompareOrdinalWC is an internal-only function. - unsafe private static int internalGetCodePageFromName(String name) + private static unsafe int internalGetCodePageFromName(String name) { int left = 0; int right = lastEncodingItem; @@ -161,7 +161,7 @@ namespace System.Globalization return codePage; } - unsafe internal static CodePageDataItem GetCodePageDataItem(int codepage) + internal static unsafe CodePageDataItem GetCodePageDataItem(int codepage) { CodePageDataItem dataItem; @@ -202,7 +202,7 @@ namespace System.Globalization } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern InternalEncodingDataItem* GetEncodingData(); + private static extern unsafe InternalEncodingDataItem* GetEncodingData(); // // Return the number of encoding data items. @@ -211,7 +211,7 @@ namespace System.Globalization private static extern int GetNumEncodingItems(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern InternalCodePageDataItem* GetCodePageData(); + private static extern unsafe InternalCodePageDataItem* GetCodePageData(); } /*=================================InternalEncodingDataItem========================== diff --git a/src/mscorlib/src/System/Reflection/AssemblyName.cs b/src/mscorlib/src/System/Reflection/AssemblyName.cs index ecd8d43..9a6728c 100644 --- a/src/mscorlib/src/System/Reflection/AssemblyName.cs +++ b/src/mscorlib/src/System/Reflection/AssemblyName.cs @@ -187,7 +187,7 @@ namespace System.Reflection * if the file contains an assembly manifest. This method causes * the file to be opened and closed. */ - static public AssemblyName GetAssemblyName(String assemblyFile) + public static AssemblyName GetAssemblyName(String assemblyFile) { if (assemblyFile == null) throw new ArgumentNullException(nameof(assemblyFile)); @@ -429,12 +429,12 @@ namespace System.Reflection // This call opens and closes the file, but does not add the // assembly to the domain. [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern AssemblyName nGetFileInformation(String s); + internal static extern AssemblyName nGetFileInformation(String s); [MethodImplAttribute(MethodImplOptions.InternalCall)] private extern byte[] nGetPublicKeyToken(); - static internal String EscapeCodeBase(String codebase) + internal static String EscapeCodeBase(String codebase) { if (codebase == null) return string.Empty; @@ -459,7 +459,7 @@ namespace System.Reflection // // Returns null if nothing has to be escaped AND passed dest was null, otherwise the resulting array with the updated destPos // - internal unsafe static char[] EscapeString(string input, int start, int end, char[] dest, ref int destPos, + internal static unsafe char[] EscapeString(string input, int start, int end, char[] dest, ref int destPos, bool isUriString, char force1, char force2, char rsvd) { int i = start; @@ -560,7 +560,7 @@ namespace System.Reflection // // ensure destination array has enough space and contains all the needed input stuff // - private unsafe static char[] EnsureDestinationSize(char* pStr, char[] dest, int currentInputPos, + private static unsafe char[] EnsureDestinationSize(char* pStr, char[] dest, int currentInputPos, short charsToAdd, short minReallocateChars, ref int destPos, int prevInputPos) { if ((object)dest == null || dest.Length < destPos + (currentInputPos - prevInputPos) + charsToAdd) diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs index ab928e4..745522b 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs @@ -294,7 +294,7 @@ namespace System.Reflection #endregion #region Internal Static Members - internal unsafe static CustomAttributeRecord[] GetCustomAttributeRecords(RuntimeModule module, int targetToken) + internal static unsafe CustomAttributeRecord[] GetCustomAttributeRecords(RuntimeModule module, int targetToken) { MetadataImport scope = module.MetadataImport; @@ -1112,7 +1112,7 @@ namespace System.Reflection #endregion } - internal unsafe static class CustomAttribute + internal static unsafe class CustomAttribute { #region Private Data Members private static RuntimeType Type_RuntimeType = (RuntimeType)typeof(RuntimeType); @@ -1480,13 +1480,13 @@ namespace System.Reflection return false; } - private unsafe static object[] GetCustomAttributes( + private static unsafe object[] GetCustomAttributes( RuntimeModule decoratedModule, int decoratedMetadataToken, int pcaCount, RuntimeType attributeFilterType) { return GetCustomAttributes(decoratedModule, decoratedMetadataToken, pcaCount, attributeFilterType, false, null); } - private unsafe static object[] GetCustomAttributes( + private static unsafe object[] GetCustomAttributes( RuntimeModule decoratedModule, int decoratedMetadataToken, int pcaCount, RuntimeType attributeFilterType, bool mustBeInheritable, IList derivedAttributes) { @@ -1644,7 +1644,7 @@ namespace System.Reflection return result; } - private unsafe static bool FilterCustomAttributeRecord( + private static unsafe bool FilterCustomAttributeRecord( CustomAttributeRecord caRecord, MetadataImport scope, ref Assembly lastAptcaOkAssembly, @@ -1826,7 +1826,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern Object _CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, byte** ppBlob, byte* pEndBlob, int* pcNamedArgs); + private static extern unsafe Object _CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, byte** ppBlob, byte* pEndBlob, int* pcNamedArgs); private static unsafe Object CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, ref IntPtr blob, IntPtr blobEnd, out int namedArgs) { byte* pBlob = (byte*)blob; @@ -1839,9 +1839,9 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe extern static void _GetPropertyOrFieldData( + private static extern unsafe void _GetPropertyOrFieldData( RuntimeModule pModule, byte** ppBlobStart, byte* pBlobEnd, out string name, out bool bIsProperty, out RuntimeType type, out object value); - private unsafe static void GetPropertyOrFieldData( + private static unsafe void GetPropertyOrFieldData( RuntimeModule module, ref IntPtr blobStart, IntPtr blobEnd, out string name, out bool isProperty, out RuntimeType type, out object value) { byte* pBlobStart = (byte*)blobStart; diff --git a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs index 8588a7e..00ee65d 100644 --- a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs +++ b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs @@ -210,9 +210,9 @@ namespace System.Reflection.Emit // helpers for intialization - static private void CheckConsistency(MethodAttributes attributes, CallingConventions callingConvention) + private static void CheckConsistency(MethodAttributes attributes, CallingConventions callingConvention) { - // only static public for method attributes + // only public static for method attributes if ((attributes & ~MethodAttributes.MemberAccessMask) != MethodAttributes.Static) throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags); if ((attributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) diff --git a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs index d376e64..8e444ef 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs @@ -727,7 +727,7 @@ namespace System.Reflection.Emit m_ILStream[m_length++] = (byte)(arg >> 56); } - unsafe public virtual void Emit(OpCode opcode, float arg) + public unsafe virtual void Emit(OpCode opcode, float arg) { EnsureCapacity(7); InternalEmit(opcode); @@ -738,7 +738,7 @@ namespace System.Reflection.Emit m_ILStream[m_length++] = (byte)(tempVal >> 24); } - unsafe public virtual void Emit(OpCode opcode, double arg) + public unsafe virtual void Emit(OpCode opcode, double arg) { EnsureCapacity(11); InternalEmit(opcode); diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index 9662105..9b2d878 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -58,7 +58,7 @@ namespace System.Reflection.Emit #endregion #region Internal Static Members - static internal String UnmangleTypeName(String typeName) + internal static String UnmangleTypeName(String typeName) { // Gets the original type name, without '+' name mangling. @@ -148,10 +148,10 @@ namespace System.Reflection.Emit [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetTypeRef(RuntimeModule module, String strFullName, RuntimeModule refedModule, String strRefedModuleFileName, int tkResolution); + private static extern int GetTypeRef(RuntimeModule module, String strFullName, RuntimeModule refedModule, String strRefedModuleFileName, int tkResolution); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetMemberRef(RuntimeModule module, RuntimeModule refedModule, int tr, int defToken); + private static extern int GetMemberRef(RuntimeModule module, RuntimeModule refedModule, int tr, int defToken); private int GetMemberRef(Module refedModule, int tr, int defToken) { @@ -159,7 +159,7 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetMemberRefFromSignature(RuntimeModule module, int tr, String methodName, byte[] signature, int length); + private static extern int GetMemberRefFromSignature(RuntimeModule module, int tr, String methodName, byte[] signature, int length); private int GetMemberRefFromSignature(int tr, String methodName, byte[] signature, int length) { @@ -167,7 +167,7 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetMemberRefOfMethodInfo(RuntimeModule module, int tr, IRuntimeMethodInfo method); + private static extern int GetMemberRefOfMethodInfo(RuntimeModule module, int tr, IRuntimeMethodInfo method); private int GetMemberRefOfMethodInfo(int tr, RuntimeMethodInfo method) { @@ -184,7 +184,7 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetMemberRefOfFieldInfo(RuntimeModule module, int tkType, RuntimeTypeHandle declaringType, int tkField); + private static extern int GetMemberRefOfFieldInfo(RuntimeModule module, int tkType, RuntimeTypeHandle declaringType, int tkField); private int GetMemberRefOfFieldInfo(int tkType, RuntimeTypeHandle declaringType, RuntimeFieldInfo runtimeField) { @@ -194,7 +194,7 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetTokenFromTypeSpec(RuntimeModule pModule, byte[] signature, int length); + private static extern int GetTokenFromTypeSpec(RuntimeModule pModule, byte[] signature, int length); private int GetTokenFromTypeSpec(byte[] signature, int length) { @@ -202,13 +202,13 @@ namespace System.Reflection.Emit } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetArrayMethodToken(RuntimeModule module, int tkTypeSpec, String methodName, byte[] signature, int sigLength); + private static extern int GetArrayMethodToken(RuntimeModule module, int tkTypeSpec, String methodName, byte[] signature, int sigLength); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int GetStringConstant(RuntimeModule module, String str, int length); + private static extern int GetStringConstant(RuntimeModule module, String str, int length); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static void SetFieldRVAContent(RuntimeModule module, int fdToken, byte[] data, int length); + internal static extern void SetFieldRVAContent(RuntimeModule module, int fdToken, byte[] data, int length); #endregion diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index 4b56048..00d64f6 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -677,11 +677,11 @@ namespace System.Reflection.Emit #region FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int DefineType(RuntimeModule module, + private static extern int DefineType(RuntimeModule module, String fullname, int tkParent, TypeAttributes attributes, int tkEnclosingType, int[] interfaceTokens); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static int DefineGenericParam(RuntimeModule module, + private static extern int DefineGenericParam(RuntimeModule module, String name, int tkParent, GenericParameterAttributes attributes, int position, int[] constraints); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] diff --git a/src/mscorlib/src/System/Reflection/MdImport.cs b/src/mscorlib/src/System/Reflection/MdImport.cs index d2de707..29a815b 100644 --- a/src/mscorlib/src/System/Reflection/MdImport.cs +++ b/src/mscorlib/src/System/Reflection/MdImport.cs @@ -338,7 +338,7 @@ namespace System.Reflection #region FCalls [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern void _Enum(IntPtr scope, int type, int parent, out MetadataEnumResult result); + private static extern unsafe void _Enum(IntPtr scope, int type, int parent, out MetadataEnumResult result); public unsafe void Enum(MetadataTokenType type, int parent, out MetadataEnumResult result) { @@ -387,7 +387,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern void _GetUserString(IntPtr scope, int mdToken, void** name, out int length); + private static extern unsafe void _GetUserString(IntPtr scope, int mdToken, void** name, out int length); public unsafe String GetUserString(int mdToken) { void* name; @@ -411,7 +411,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern void _GetName(IntPtr scope, int mdToken, void** name); + private static extern unsafe void _GetName(IntPtr scope, int mdToken, void** name); public unsafe Utf8String GetName(int mdToken) { void* name; @@ -421,7 +421,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern void _GetNamespace(IntPtr scope, int mdToken, void** namesp); + private static extern unsafe void _GetNamespace(IntPtr scope, int mdToken, void** namesp); public unsafe Utf8String GetNamespace(int mdToken) { void* namesp; @@ -431,7 +431,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern void _GetEventProps(IntPtr scope, int mdToken, void** name, out int eventAttributes); + private static extern unsafe void _GetEventProps(IntPtr scope, int mdToken, void** name, out int eventAttributes); public unsafe void GetEventProps(int mdToken, out void* name, out EventAttributes eventAttributes) { int _eventAttributes; @@ -451,7 +451,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern void _GetPropertyProps(IntPtr scope, + private static extern unsafe void _GetPropertyProps(IntPtr scope, int mdToken, void** name, out int propertyAttributes, out ConstArray signature); public unsafe void GetPropertyProps(int mdToken, out void* name, out PropertyAttributes propertyAttributes, out ConstArray signature) { @@ -625,7 +625,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private unsafe static extern void _GetPInvokeMap(IntPtr scope, + private static extern unsafe void _GetPInvokeMap(IntPtr scope, int token, out int attributes, void** importName, diff --git a/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs b/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs index 2397518..2b6e5b2 100644 --- a/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs +++ b/src/mscorlib/src/System/Reflection/Metadata/AssemblyExtensions.cs @@ -12,7 +12,7 @@ namespace System.Reflection.Metadata { [DllImport(JitHelpers.QCall)] [return: MarshalAs(UnmanagedType.Bool)] - private unsafe static extern bool InternalTryGetRawMetadata(RuntimeAssembly assembly, ref byte* blob, ref int length); + private static extern unsafe bool InternalTryGetRawMetadata(RuntimeAssembly assembly, ref byte* blob, ref int length); // Retrieves the metadata section of the assembly, for use with System.Reflection.Metadata.MetadataReader. // - Returns false upon failure. Metadata might not be available for some assemblies, such as AssemblyBuilder, .NET @@ -22,7 +22,7 @@ namespace System.Reflection.Metadata // associated, is alive. The caller is responsible for keeping the assembly object alive while accessing the // metadata blob. [CLSCompliant(false)] // out byte* blob - public unsafe static bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) + public static unsafe bool TryGetRawMetadata(this Assembly assembly, out byte* blob, out int length) { if (assembly == null) { diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index 9ef4d7d..17910e1 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -117,7 +117,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetFullName(RuntimeAssembly assembly, StringHandleOnStack retString); + private static extern void GetFullName(RuntimeAssembly assembly, StringHandleOnStack retString); public override String FullName { @@ -175,7 +175,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes); + private static extern void GetExportedTypes(RuntimeAssembly assembly, ObjectHandleOnStack retTypes); public override Type[] GetExportedTypes() { @@ -423,7 +423,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetExecutingAssembly(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly); + private static extern void GetExecutingAssembly(StackCrawlMarkHandle stackMark, ObjectHandleOnStack retAssembly); internal static RuntimeAssembly GetExecutingAssembly(ref StackCrawlMark stackMark) { @@ -482,7 +482,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetImageRuntimeVersion(RuntimeAssembly assembly, StringHandleOnStack retString); + private static extern void GetImageRuntimeVersion(RuntimeAssembly assembly, StringHandleOnStack retString); public override String ImageRuntimeVersion { @@ -569,7 +569,7 @@ namespace System.Reflection // GetResource will return a pointer to the resources in memory. [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private static unsafe extern byte* GetResource(RuntimeAssembly assembly, + private static extern unsafe byte* GetResource(RuntimeAssembly assembly, String resourceName, out ulong length, StackCrawlMarkHandle stackMark, @@ -644,7 +644,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static AssemblyHashAlgorithm GetHashAlgorithm(RuntimeAssembly assembly); + private static extern AssemblyHashAlgorithm GetHashAlgorithm(RuntimeAssembly assembly); private AssemblyHashAlgorithm GetHashAlgorithm() { @@ -652,7 +652,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static AssemblyNameFlags GetFlags(RuntimeAssembly assembly); + private static extern AssemblyNameFlags GetFlags(RuntimeAssembly assembly); private AssemblyNameFlags GetFlags() { @@ -747,7 +747,7 @@ namespace System.Reflection } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetModules(RuntimeAssembly assembly, + private static extern void GetModules(RuntimeAssembly assembly, bool loadIfNotFound, bool getResourceModules, ObjectHandleOnStack retModuleHandles); diff --git a/src/mscorlib/src/System/Reflection/RuntimeModule.cs b/src/mscorlib/src/System/Reflection/RuntimeModule.cs index 2f8d195..e4b1135 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeModule.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeModule.cs @@ -17,19 +17,19 @@ namespace System.Reflection #region FCalls [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetType(RuntimeModule module, String className, bool throwOnError, bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive); + private static extern void GetType(RuntimeModule module, String className, bool throwOnError, bool ignoreCase, ObjectHandleOnStack type, ObjectHandleOnStack keepAlive); [DllImport(JitHelpers.QCall)] private static extern bool nIsTransientInternal(RuntimeModule module); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetScopeName(RuntimeModule module, StringHandleOnStack retString); + private static extern void GetScopeName(RuntimeModule module, StringHandleOnStack retString); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetFullyQualifiedName(RuntimeModule module, StringHandleOnStack retString); + private static extern void GetFullyQualifiedName(RuntimeModule module, StringHandleOnStack retString); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static RuntimeType[] GetTypes(RuntimeModule module); + private static extern RuntimeType[] GetTypes(RuntimeModule module); internal RuntimeType[] GetDefinedTypes() { @@ -37,7 +37,7 @@ namespace System.Reflection } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static bool IsResource(RuntimeModule module); + private static extern bool IsResource(RuntimeModule module); #endregion #region Module overrides diff --git a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs index e9d27ef..1bd053e 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs @@ -12,7 +12,7 @@ namespace System.Reflection internal unsafe sealed class RuntimeParameterInfo : ParameterInfo { #region Static Members - internal unsafe static ParameterInfo[] GetParameters(IRuntimeMethodInfo method, MemberInfo member, Signature sig) + internal static unsafe ParameterInfo[] GetParameters(IRuntimeMethodInfo method, MemberInfo member, Signature sig) { Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); @@ -20,7 +20,7 @@ namespace System.Reflection return GetParameters(method, member, sig, out dummy, false); } - internal unsafe static ParameterInfo GetReturnParameter(IRuntimeMethodInfo method, MemberInfo member, Signature sig) + internal static unsafe ParameterInfo GetReturnParameter(IRuntimeMethodInfo method, MemberInfo member, Signature sig) { Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); @@ -29,7 +29,7 @@ namespace System.Reflection return returnParameter; } - internal unsafe static ParameterInfo[] GetParameters( + internal static unsafe ParameterInfo[] GetParameters( IRuntimeMethodInfo methodHandle, MemberInfo member, Signature sig, out ParameterInfo returnParameter, bool fetchReturnParameter) { returnParameter = null; diff --git a/src/mscorlib/src/System/Resources/__FastResourceComparer.cs b/src/mscorlib/src/System/Resources/__FastResourceComparer.cs index 30d935a..b9e2f81 100644 --- a/src/mscorlib/src/System/Resources/__FastResourceComparer.cs +++ b/src/mscorlib/src/System/Resources/__FastResourceComparer.cs @@ -80,7 +80,7 @@ namespace System.Resources // Input is one string to compare with, and a byte[] containing chars in // little endian unicode. Pass in the number of valid chars. - public unsafe static int CompareOrdinal(String a, byte[] bytes, int bCharLength) + public static unsafe int CompareOrdinal(String a, byte[] bytes, int bCharLength) { Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); @@ -116,7 +116,7 @@ namespace System.Resources // This method is to handle potentially misaligned data accesses. // The byte* must point to little endian Unicode characters. - internal unsafe static int CompareOrdinal(byte* a, int byteLen, String b) + internal static unsafe int CompareOrdinal(byte* a, int byteLen, String b) { Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); Debug.Assert(a != null && b != null, "Null args not allowed."); diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index 70b9e38..f16d198 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -1781,7 +1781,7 @@ namespace System return retval; } - internal unsafe static MethodBase GetMethodBase(RuntimeType reflectedType, RuntimeMethodHandleInternal methodHandle) + internal static unsafe MethodBase GetMethodBase(RuntimeType reflectedType, RuntimeMethodHandleInternal methodHandle) { Debug.Assert(!methodHandle.IsNullHandle()); @@ -1923,12 +1923,12 @@ namespace System set { Cache.DomainInitialized = value; } } - internal unsafe static FieldInfo GetFieldInfo(IRuntimeFieldInfo fieldHandle) + internal static unsafe FieldInfo GetFieldInfo(IRuntimeFieldInfo fieldHandle) { return GetFieldInfo(RuntimeFieldHandle.GetApproxDeclaringType(fieldHandle), fieldHandle); } - internal unsafe static FieldInfo GetFieldInfo(RuntimeType reflectedType, IRuntimeFieldInfo field) + internal static unsafe FieldInfo GetFieldInfo(RuntimeType reflectedType, IRuntimeFieldInfo field) { RuntimeFieldHandleInternal fieldHandle = field.Value; @@ -1959,7 +1959,7 @@ namespace System } // Called internally - private unsafe static PropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty) + private static unsafe PropertyInfo GetPropertyInfo(RuntimeType reflectedType, int tkProperty) { RuntimePropertyInfo property = null; RuntimePropertyInfo[] candidates = @@ -3835,10 +3835,10 @@ namespace System private static RuntimeType s_typedRef = (RuntimeType)typeof(TypedReference); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static private extern bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType); + private static extern bool CanValueSpecialCast(RuntimeType valueType, RuntimeType targetType); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static private extern Object AllocateValueType(RuntimeType type, object value, bool fForceTypeChange); + private static extern Object AllocateValueType(RuntimeType type, object value, bool fForceTypeChange); internal unsafe Object CheckValue(Object value, Binder binder, CultureInfo culture, BindingFlags invokeAttr) { @@ -4854,7 +4854,7 @@ namespace System } #endregion - #region Legacy Static Internal + #region Legacy internal static [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern Object _CreateEnum(RuntimeType enumType, long value); internal static Object CreateEnum(RuntimeType enumType, long value) diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs index 101f8c4..8f06008 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeHelpers.cs @@ -87,7 +87,7 @@ namespace System.Runtime.CompilerServices internal static extern void _CompileMethod(IRuntimeMethodInfo method); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private static unsafe extern void _PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, int cInstantiation); + private static extern unsafe void _PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, int cInstantiation); public static void PrepareMethod(RuntimeMethodHandle method) { @@ -188,7 +188,7 @@ namespace System.Runtime.CompilerServices } /// true if given type is reference type or value type that contains references - static public bool IsReferenceOrContainsReferences() + public static bool IsReferenceOrContainsReferences() { // The body of this function will be replaced by the EE with unsafe code!!! // See getILIntrinsicImplementation for how this happens. diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs b/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs index 45f0a68..42fe79d 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/jithelpers.cs @@ -74,27 +74,27 @@ namespace System.Runtime.CompilerServices // Wraps object variable into a handle. Used to return managed strings from QCalls. // s has to be a local variable on the stack. - static internal StringHandleOnStack GetStringHandleOnStack(ref string s) + internal static StringHandleOnStack GetStringHandleOnStack(ref string s) { return new StringHandleOnStack(UnsafeCastToStackPointer(ref s)); } // Wraps object variable into a handle. Used to pass managed object references in and out of QCalls. // o has to be a local variable on the stack. - static internal ObjectHandleOnStack GetObjectHandleOnStack(ref T o) where T : class + internal static ObjectHandleOnStack GetObjectHandleOnStack(ref T o) where T : class { return new ObjectHandleOnStack(UnsafeCastToStackPointer(ref o)); } // Wraps StackCrawlMark into a handle. Used to pass StackCrawlMark to QCalls. // stackMark has to be a local variable on the stack. - static internal StackCrawlMarkHandle GetStackCrawlMarkHandle(ref StackCrawlMark stackMark) + internal static StackCrawlMarkHandle GetStackCrawlMarkHandle(ref StackCrawlMark stackMark) { return new StackCrawlMarkHandle(UnsafeCastToStackPointer(ref stackMark)); } #if DEBUG - static internal int UnsafeEnumCast(T val) where T : struct // Actually T must be 4 byte (or less) enum + internal static int UnsafeEnumCast(T val) where T : struct // Actually T must be 4 byte (or less) enum { Debug.Assert(typeof(T).IsEnum && (Enum.GetUnderlyingType(typeof(T)) == typeof(int) @@ -107,14 +107,14 @@ namespace System.Runtime.CompilerServices return UnsafeEnumCastInternal(val); } - static private int UnsafeEnumCastInternal(T val) where T : struct // Actually T must be 4 (or less) byte enum + private static int UnsafeEnumCastInternal(T val) where T : struct // Actually T must be 4 (or less) byte enum { // should be return (int) val; but C# does not allow, runtime does this magically // See getILIntrinsicImplementation for how this happens. throw new InvalidOperationException(); } - static internal long UnsafeEnumCastLong(T val) where T : struct // Actually T must be 8 byte enum + internal static long UnsafeEnumCastLong(T val) where T : struct // Actually T must be 8 byte enum { Debug.Assert(typeof(T).IsEnum && (Enum.GetUnderlyingType(typeof(T)) == typeof(long) @@ -123,7 +123,7 @@ namespace System.Runtime.CompilerServices return UnsafeEnumCastLongInternal(val); } - static private long UnsafeEnumCastLongInternal(T val) where T : struct // Actually T must be 8 byte enum + private static long UnsafeEnumCastLongInternal(T val) where T : struct // Actually T must be 8 byte enum { // should be return (int) val; but C# does not allow, runtime does this magically // See getILIntrinsicImplementation for how this happens. @@ -132,14 +132,14 @@ namespace System.Runtime.CompilerServices // Internal method for getting a raw pointer for handles in JitHelpers. // The reference has to point into a local stack variable in order so it can not be moved by the GC. - static internal IntPtr UnsafeCastToStackPointer(ref T val) + internal static IntPtr UnsafeCastToStackPointer(ref T val) { IntPtr p = UnsafeCastToStackPointerInternal(ref val); Debug.Assert(IsAddressInStack(p), "Pointer not in the stack!"); return p; } - static private IntPtr UnsafeCastToStackPointerInternal(ref T val) + private static IntPtr UnsafeCastToStackPointerInternal(ref T val) { // The body of this function will be replaced by the EE with unsafe code that just returns val!!! // See getILIntrinsicImplementation for how this happens. @@ -147,21 +147,21 @@ namespace System.Runtime.CompilerServices } #else // DEBUG - static internal int UnsafeEnumCast(T val) where T : struct // Actually T must be 4 byte (or less) enum + internal static int UnsafeEnumCast(T val) where T : struct // Actually T must be 4 byte (or less) enum { // should be return (int) val; but C# does not allow, runtime does this magically // See getILIntrinsicImplementation for how this happens. throw new InvalidOperationException(); } - static internal long UnsafeEnumCastLong(T val) where T : struct // Actually T must be 8 byte enum + internal static long UnsafeEnumCastLong(T val) where T : struct // Actually T must be 8 byte enum { // should be return (long) val; but C# does not allow, runtime does this magically // See getILIntrinsicImplementation for how this happens. throw new InvalidOperationException(); } - static internal IntPtr UnsafeCastToStackPointer(ref T val) + internal static IntPtr UnsafeCastToStackPointer(ref T val) { // The body of this function will be replaced by the EE with unsafe code that just returns o!!! // See getILIntrinsicImplementation for how this happens. @@ -171,20 +171,20 @@ namespace System.Runtime.CompilerServices // Set the given element in the array without any type or range checks [MethodImplAttribute(MethodImplOptions.InternalCall)] - extern static internal void UnsafeSetArrayElement(Object[] target, int index, Object element); + internal static extern void UnsafeSetArrayElement(Object[] target, int index, Object element); // Used for unsafe pinning of arbitrary objects. - static internal PinningHelper GetPinningHelper(Object o) + internal static PinningHelper GetPinningHelper(Object o) { return Unsafe.As(o); } #if DEBUG [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static bool IsAddressInStack(IntPtr ptr); + private static extern bool IsAddressInStack(IntPtr ptr); #endif - static internal ref byte GetRawSzArrayData(this Array array) + internal static ref byte GetRawSzArrayData(this Array array) { // The body of this function will be replaced by the EE with unsafe code!!! // See getILIntrinsicImplementation for how this happens. diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs index accb8c8..8b1bcdc 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ComEventsMethod.cs @@ -73,7 +73,7 @@ namespace System.Runtime.InteropServices #endregion - #region static internal methods + #region internal static methods internal static ComEventsMethod Find(ComEventsMethod methods, int dispid) { diff --git a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs index fe61af2..cec32bb 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs @@ -260,8 +260,8 @@ namespace System.Runtime.InteropServices #if MDA_SUPPORTED // The GCHandle cookie table. - static private volatile GCHandleCookieTable s_cookieTable = null; - static private volatile bool s_probeIsActive = false; + private static volatile GCHandleCookieTable s_cookieTable = null; + private static volatile bool s_probeIsActive = false; #endif private void ValidateHandle() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 98b33e3..effa176 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -112,7 +112,7 @@ namespace System.Runtime.InteropServices [MethodImplAttribute(MethodImplOptions.InternalCall)] private static extern int GetSystemMaxDBCSCharSize(); - unsafe public static String PtrToStringAnsi(IntPtr ptr) + public static unsafe String PtrToStringAnsi(IntPtr ptr) { if (IntPtr.Zero == ptr) { @@ -136,7 +136,7 @@ namespace System.Runtime.InteropServices } } - unsafe public static String PtrToStringAnsi(IntPtr ptr, int len) + public static unsafe String PtrToStringAnsi(IntPtr ptr, int len) { if (ptr == IntPtr.Zero) throw new ArgumentNullException(nameof(ptr)); @@ -146,7 +146,7 @@ namespace System.Runtime.InteropServices return new String((sbyte*)ptr, 0, len); } - unsafe public static String PtrToStringUni(IntPtr ptr, int len) + public static unsafe String PtrToStringUni(IntPtr ptr, int len) { if (ptr == IntPtr.Zero) throw new ArgumentNullException(nameof(ptr)); @@ -162,7 +162,7 @@ namespace System.Runtime.InteropServices return PtrToStringUni(ptr, len); } - unsafe public static String PtrToStringUni(IntPtr ptr) + public static unsafe String PtrToStringUni(IntPtr ptr) { if (IntPtr.Zero == ptr) { @@ -184,7 +184,7 @@ namespace System.Runtime.InteropServices return PtrToStringUni(ptr); } - unsafe public static String PtrToStringUTF8(IntPtr ptr) + public static unsafe String PtrToStringUTF8(IntPtr ptr) { if (IntPtr.Zero == ptr) { @@ -197,7 +197,7 @@ namespace System.Runtime.InteropServices } } - unsafe public static String PtrToStringUTF8(IntPtr ptr, int byteLen) + public static unsafe String PtrToStringUTF8(IntPtr ptr, int byteLen) { if (byteLen < 0) { @@ -971,7 +971,7 @@ namespace System.Runtime.InteropServices } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static IntPtr GetHINSTANCE(RuntimeModule m); + private static extern IntPtr GetHINSTANCE(RuntimeModule m); #endif // FEATURE_COMINTEROP //==================================================================== @@ -1071,7 +1071,7 @@ namespace System.Runtime.InteropServices //==================================================================== // String convertions. //==================================================================== - unsafe public static IntPtr StringToHGlobalAnsi(String s) + public static unsafe IntPtr StringToHGlobalAnsi(String s) { if (s == null) { @@ -1100,7 +1100,7 @@ namespace System.Runtime.InteropServices } } - unsafe public static IntPtr StringToHGlobalUni(String s) + public static unsafe IntPtr StringToHGlobalUni(String s) { if (s == null) { @@ -1300,7 +1300,7 @@ namespace System.Runtime.InteropServices return pNewMem; } - unsafe public static IntPtr StringToCoTaskMemUni(String s) + public static unsafe IntPtr StringToCoTaskMemUni(String s) { if (s == null) { @@ -1331,7 +1331,7 @@ namespace System.Runtime.InteropServices } } - unsafe public static IntPtr StringToCoTaskMemUTF8(String s) + public static unsafe IntPtr StringToCoTaskMemUTF8(String s) { const int MAX_UTF8_CHAR_SIZE = 3; if (s == null) @@ -1368,7 +1368,7 @@ namespace System.Runtime.InteropServices return StringToCoTaskMemUni(s); } - unsafe public static IntPtr StringToCoTaskMemAnsi(String s) + public static unsafe IntPtr StringToCoTaskMemAnsi(String s) { if (s == null) { @@ -1839,7 +1839,7 @@ namespace System.Runtime.InteropServices FreeCoTaskMem(s); } - unsafe public static void ZeroFreeCoTaskMemUTF8(IntPtr s) + public static unsafe void ZeroFreeCoTaskMemUTF8(IntPtr s) { RuntimeImports.RhZeroMemory(s, (UIntPtr)System.StubHelpers.StubHelpers.strlen((sbyte*)s)); FreeCoTaskMem(s); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs index e11e3a4..d421636 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/RuntimeEnvironment.cs @@ -24,7 +24,7 @@ using StackCrawlMark = System.Threading.StackCrawlMark; namespace System.Runtime.InteropServices { - static internal class RuntimeEnvironment + internal static class RuntimeEnvironment { [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern String GetModuleFileName(); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs index 25009ae..bcc8590 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ICustomPropertyProvider.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // Creates a ICustomProperty implementation for Jupiter // Called from ICustomPropertyProvider_GetProperty from within runtime // - static internal ICustomProperty CreateProperty(object target, string propertyName) + internal static ICustomProperty CreateProperty(object target, string propertyName) { Debug.Assert(target != null); Debug.Assert(propertyName != null); @@ -50,7 +50,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // Creates a ICustomProperty implementation for Jupiter // Called from ICustomPropertyProvider_GetIndexedProperty from within runtime // - static internal unsafe ICustomProperty CreateIndexedProperty(object target, string propertyName, TypeNameNative* pIndexedParamType) + internal static unsafe ICustomProperty CreateIndexedProperty(object target, string propertyName, TypeNameNative* pIndexedParamType) { Debug.Assert(target != null); Debug.Assert(propertyName != null); @@ -61,7 +61,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime return CreateIndexedProperty(target, propertyName, indexedParamType); } - static internal ICustomProperty CreateIndexedProperty(object target, string propertyName, Type indexedParamType) + internal static ICustomProperty CreateIndexedProperty(object target, string propertyName, Type indexedParamType) { Debug.Assert(target != null); Debug.Assert(propertyName != null); @@ -86,7 +86,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime return new CustomPropertyImpl(propertyInfo); } - static internal unsafe void GetType(object target, TypeNameNative* pIndexedParamType) + internal static unsafe void GetType(object target, TypeNameNative* pIndexedParamType) { IGetProxyTarget proxy = target as IGetProxyTarget; if (proxy != null) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs index 94e4351..201f4b1 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/NativeMethods.cs @@ -32,12 +32,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime internal static extern void RoReportUnhandledError(IRestrictedErrorInfo error); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - internal static unsafe extern int WindowsCreateString([MarshalAs(UnmanagedType.LPWStr)] string sourceString, + internal static extern unsafe int WindowsCreateString([MarshalAs(UnmanagedType.LPWStr)] string sourceString, int length, [Out] IntPtr* hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - internal static unsafe extern int WindowsCreateStringReference(char* sourceString, + internal static extern unsafe int WindowsCreateStringReference(char* sourceString, int length, [Out] HSTRING_HEADER* hstringHeader, [Out] IntPtr* hstring); @@ -46,6 +46,6 @@ namespace System.Runtime.InteropServices.WindowsRuntime internal static extern int WindowsDeleteString(IntPtr hstring); [DllImport("api-ms-win-core-winrt-string-l1-1-0.dll", CallingConvention = CallingConvention.StdCall)] - internal static unsafe extern char* WindowsGetStringRawBuffer(IntPtr hstring, [Out] uint* length); + internal static extern unsafe char* WindowsGetStringRawBuffer(IntPtr hstring, [Out] uint* length); } } diff --git a/src/mscorlib/src/System/Runtime/RuntimeImports.cs b/src/mscorlib/src/System/Runtime/RuntimeImports.cs index ed0c556..9ac9150 100644 --- a/src/mscorlib/src/System/Runtime/RuntimeImports.cs +++ b/src/mscorlib/src/System/Runtime/RuntimeImports.cs @@ -18,7 +18,7 @@ namespace System.Runtime // Non-inlinable wrapper around the QCall that avoids poluting the fast path // with P/Invoke prolog/epilog. [MethodImpl(MethodImplOptions.NoInlining)] - internal unsafe static void RhZeroMemory(ref byte b, nuint byteLength) + internal static unsafe void RhZeroMemory(ref byte b, nuint byteLength) { fixed (byte* bytePointer = &b) { @@ -26,15 +26,15 @@ namespace System.Runtime } } - internal unsafe static void RhZeroMemory(IntPtr p, UIntPtr byteLength) + internal static unsafe void RhZeroMemory(IntPtr p, UIntPtr byteLength) { RhZeroMemory((void*)p, (nuint)byteLength); } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - extern private unsafe static void RhZeroMemory(void* b, nuint byteLength); + private static extern unsafe void RhZeroMemory(void* b, nuint byteLength); [MethodImpl(MethodImplOptions.InternalCall)] - internal extern unsafe static void RhBulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount); + internal static extern unsafe void RhBulkMoveWithWriteBarrier(ref byte destination, ref byte source, nuint byteCount); } } diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs index 8dca7fd..80aec73 100644 --- a/src/mscorlib/src/System/RuntimeHandles.cs +++ b/src/mscorlib/src/System/RuntimeHandles.cs @@ -45,9 +45,9 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsInstanceOfType(RuntimeType type, Object o); + internal static extern bool IsInstanceOfType(RuntimeType type, Object o); - internal unsafe static Type GetTypeHelper(Type typeStart, Type[] genericArgs, IntPtr pModifiers, int cModifiers) + internal static unsafe Type GetTypeHelper(Type typeStart, Type[] genericArgs, IntPtr pModifiers, int cModifiers) { Type type = typeStart; @@ -236,13 +236,13 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static CorElementType GetCorElementType(RuntimeType type); + internal static extern CorElementType GetCorElementType(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeAssembly GetAssembly(RuntimeType type); + internal static extern RuntimeAssembly GetAssembly(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeModule GetModule(RuntimeType type); + internal static extern RuntimeModule GetModule(RuntimeType type); public ModuleHandle GetModuleHandle() { @@ -250,25 +250,25 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeType GetBaseType(RuntimeType type); + internal static extern RuntimeType GetBaseType(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static TypeAttributes GetAttributes(RuntimeType type); + internal static extern TypeAttributes GetAttributes(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeType GetElementType(RuntimeType type); + internal static extern RuntimeType GetElementType(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool CompareCanonicalHandles(RuntimeType left, RuntimeType right); + internal static extern bool CompareCanonicalHandles(RuntimeType left, RuntimeType right); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetArrayRank(RuntimeType type); + internal static extern int GetArrayRank(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetToken(RuntimeType type); + internal static extern int GetToken(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot); + internal static extern RuntimeMethodHandleInternal GetMethodAt(RuntimeType type, int slot); // This is managed wrapper for MethodTable::IntroducedMethodIterator internal struct IntroducedMethodEnumerator @@ -322,13 +322,13 @@ namespace System private static extern void GetNextIntroducedMethod(ref RuntimeMethodHandleInternal method); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool GetFields(RuntimeType type, IntPtr* result, int* count); + internal static extern bool GetFields(RuntimeType type, IntPtr* result, int* count); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static Type[] GetInterfaces(RuntimeType type); + internal static extern Type[] GetInterfaces(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetConstraints(RuntimeTypeHandle handle, ObjectHandleOnStack types); + private static extern void GetConstraints(RuntimeTypeHandle handle, ObjectHandleOnStack types); internal Type[] GetConstraints() { @@ -339,7 +339,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static IntPtr GetGCHandle(RuntimeTypeHandle handle, GCHandleType type); + private static extern IntPtr GetGCHandle(RuntimeTypeHandle handle, GCHandleType type); internal IntPtr GetGCHandle(GCHandleType type) { @@ -347,10 +347,10 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetNumVirtuals(RuntimeType type); + internal static extern int GetNumVirtuals(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void VerifyInterfaceIsImplemented(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle); + private static extern void VerifyInterfaceIsImplemented(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle); internal void VerifyInterfaceIsImplemented(RuntimeTypeHandle interfaceHandle) { @@ -358,7 +358,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle); + private static extern RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle handle, RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle); internal RuntimeMethodHandleInternal GetInterfaceMethodImplementation(RuntimeTypeHandle interfaceHandle, RuntimeMethodHandleInternal interfaceMethodHandle) { @@ -366,17 +366,17 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsComObject(RuntimeType type, bool isGenericCOM); + internal static extern bool IsComObject(RuntimeType type, bool isGenericCOM); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsInterface(RuntimeType type); + internal static extern bool IsInterface(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsByRefLike(RuntimeType type); + internal static extern bool IsByRefLike(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] [return: MarshalAs(UnmanagedType.Bool)] - private extern static bool _IsVisible(RuntimeTypeHandle typeHandle); + private static extern bool _IsVisible(RuntimeTypeHandle typeHandle); internal static bool IsVisible(RuntimeType type) { @@ -384,10 +384,10 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsValueType(RuntimeType type); + internal static extern bool IsValueType(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void ConstructName(RuntimeTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString); + private static extern void ConstructName(RuntimeTypeHandle handle, TypeNameFormatFlags formatFlags, StringHandleOnStack retString); internal string ConstructName(TypeNameFormatFlags formatFlags) { @@ -397,7 +397,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static void* _GetUtf8Name(RuntimeType type); + private static extern void* _GetUtf8Name(RuntimeType type); internal static Utf8String GetUtf8Name(RuntimeType type) { @@ -405,16 +405,16 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool CanCastTo(RuntimeType type, RuntimeType target); + internal static extern bool CanCastTo(RuntimeType type, RuntimeType target); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeType GetDeclaringType(RuntimeType type); + internal static extern RuntimeType GetDeclaringType(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type); + internal static extern IRuntimeMethodInfo GetDeclaringMethod(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetDefaultConstructor(RuntimeTypeHandle handle, ObjectHandleOnStack method); + private static extern void GetDefaultConstructor(RuntimeTypeHandle handle, ObjectHandleOnStack method); internal IRuntimeMethodInfo GetDefaultConstructor() { @@ -424,7 +424,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, StackCrawlMarkHandle stackMark, + private static extern void GetTypeByName(string name, bool throwOnError, bool ignoreCase, bool reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, bool loadTypeFromPartialName, ObjectHandleOnStack type, ObjectHandleOnStack keepalive); @@ -459,7 +459,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetTypeByNameUsingCARules(string name, RuntimeModule scope, ObjectHandleOnStack type); + private static extern void GetTypeByNameUsingCARules(string name, RuntimeModule scope, ObjectHandleOnStack type); internal static RuntimeType GetTypeByNameUsingCARules(string name, RuntimeModule scope) { @@ -473,7 +473,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static void GetInstantiation(RuntimeTypeHandle type, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); + internal static extern void GetInstantiation(RuntimeTypeHandle type, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); internal RuntimeType[] GetInstantiationInternal() { @@ -490,7 +490,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); + private static extern void Instantiate(RuntimeTypeHandle handle, IntPtr* pInst, int numGenericArgs, ObjectHandleOnStack type); internal RuntimeType Instantiate(Type[] inst) { @@ -508,7 +508,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void MakeArray(RuntimeTypeHandle handle, int rank, ObjectHandleOnStack type); + private static extern void MakeArray(RuntimeTypeHandle handle, int rank, ObjectHandleOnStack type); internal RuntimeType MakeArray(int rank) { @@ -518,7 +518,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void MakeSZArray(RuntimeTypeHandle handle, ObjectHandleOnStack type); + private static extern void MakeSZArray(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeSZArray() { @@ -528,7 +528,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void MakeByRef(RuntimeTypeHandle handle, ObjectHandleOnStack type); + private static extern void MakeByRef(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakeByRef() { @@ -538,7 +538,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void MakePointer(RuntimeTypeHandle handle, ObjectHandleOnStack type); + private static extern void MakePointer(RuntimeTypeHandle handle, ObjectHandleOnStack type); internal RuntimeType MakePointer() { @@ -548,13 +548,13 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static bool IsCollectible(RuntimeTypeHandle handle); + internal static extern bool IsCollectible(RuntimeTypeHandle handle); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool HasInstantiation(RuntimeType type); + internal static extern bool HasInstantiation(RuntimeType type); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetGenericTypeDefinition(RuntimeTypeHandle type, ObjectHandleOnStack retType); + private static extern void GetGenericTypeDefinition(RuntimeTypeHandle type, ObjectHandleOnStack retType); internal static RuntimeType GetGenericTypeDefinition(RuntimeType type) { @@ -567,13 +567,13 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsGenericTypeDefinition(RuntimeType type); + internal static extern bool IsGenericTypeDefinition(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsGenericVariable(RuntimeType type); + internal static extern bool IsGenericVariable(RuntimeType type); [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static int GetGenericVariableIndex(RuntimeType type); + private static extern int GetGenericVariableIndex(RuntimeType type); internal int GetGenericVariableIndex() { @@ -586,7 +586,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool ContainsGenericVariables(RuntimeType handle); + internal static extern bool ContainsGenericVariables(RuntimeType handle); internal bool ContainsGenericVariables() { @@ -594,7 +594,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static bool SatisfiesConstraints(RuntimeType paramType, IntPtr* pTypeContext, int typeContextLength, IntPtr* pMethodContext, int methodContextLength, RuntimeType toType); + private static extern bool SatisfiesConstraints(RuntimeType paramType, IntPtr* pTypeContext, int typeContextLength, IntPtr* pMethodContext, int methodContextLength, RuntimeType toType); internal static bool SatisfiesConstraints(RuntimeType paramType, RuntimeType[] typeContext, RuntimeType[] methodContext, RuntimeType toType) { @@ -615,7 +615,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static IntPtr _GetMetadataImport(RuntimeType type); + private static extern IntPtr _GetMetadataImport(RuntimeType type); internal static MetadataImport GetMetadataImport(RuntimeType type) { @@ -792,7 +792,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle); + internal static extern IntPtr GetFunctionPointer(RuntimeMethodHandleInternal handle); public IntPtr GetFunctionPointer() { @@ -802,7 +802,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static bool IsCAVisibleFromDecoratedType( + internal static extern bool IsCAVisibleFromDecoratedType( RuntimeTypeHandle attrTypeHandle, IRuntimeMethodInfo attrCtor, RuntimeTypeHandle sourceTypeHandle, @@ -829,7 +829,7 @@ namespace System internal static extern MethodImplAttributes GetImplAttributes(IRuntimeMethodInfo method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format, StringHandleOnStack retString); + private static extern void ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format, StringHandleOnStack retString); internal static string ConstructInstantiation(IRuntimeMethodInfo method, TypeNameFormatFlags format) { @@ -839,7 +839,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method); + internal static extern RuntimeType GetDeclaringType(RuntimeMethodHandleInternal method); internal static RuntimeType GetDeclaringType(IRuntimeMethodInfo method) { @@ -849,7 +849,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetSlot(RuntimeMethodHandleInternal method); + internal static extern int GetSlot(RuntimeMethodHandleInternal method); internal static int GetSlot(IRuntimeMethodInfo method) { @@ -861,10 +861,10 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetMethodDef(IRuntimeMethodInfo method); + internal static extern int GetMethodDef(IRuntimeMethodInfo method); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static string GetName(RuntimeMethodHandleInternal method); + internal static extern string GetName(RuntimeMethodHandleInternal method); internal static string GetName(IRuntimeMethodInfo method) { @@ -874,7 +874,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static void* _GetUtf8Name(RuntimeMethodHandleInternal method); + private static extern void* _GetUtf8Name(RuntimeMethodHandleInternal method); internal static Utf8String GetUtf8Name(RuntimeMethodHandleInternal method) { @@ -887,7 +887,7 @@ namespace System [DebuggerStepThroughAttribute] [Diagnostics.DebuggerHidden] [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static object InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions); + internal static extern object InvokeMethod(object target, object[] arguments, Signature sig, bool constructor, bool wrapExceptions); #region Private Invocation Helpers internal static INVOCATION_FLAGS GetSecurityFlags(IRuntimeMethodInfo handle) @@ -896,12 +896,12 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - static extern internal uint GetSpecialSecurityFlags(IRuntimeMethodInfo method); + static internal extern uint GetSpecialSecurityFlags(IRuntimeMethodInfo method); #endregion [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); + private static extern void GetMethodInstantiation(RuntimeMethodHandleInternal method, ObjectHandleOnStack types, bool fAsRuntimeTypeArray); internal static RuntimeType[] GetMethodInstantiationInternal(IRuntimeMethodInfo method) { @@ -927,7 +927,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool HasMethodInstantiation(RuntimeMethodHandleInternal method); + internal static extern bool HasMethodInstantiation(RuntimeMethodHandleInternal method); internal static bool HasMethodInstantiation(IRuntimeMethodInfo method) { @@ -937,13 +937,13 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation); + internal static extern RuntimeMethodHandleInternal GetStubIfNeeded(RuntimeMethodHandleInternal method, RuntimeType declaringType, RuntimeType[] methodInstantiation); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType); + internal static extern RuntimeMethodHandleInternal GetMethodFromCanonical(RuntimeMethodHandleInternal method, RuntimeType declaringType); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsGenericMethodDefinition(RuntimeMethodHandleInternal method); + internal static extern bool IsGenericMethodDefinition(RuntimeMethodHandleInternal method); internal static bool IsGenericMethodDefinition(IRuntimeMethodInfo method) { @@ -953,10 +953,10 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsTypicalMethodDefinition(IRuntimeMethodInfo method); + internal static extern bool IsTypicalMethodDefinition(IRuntimeMethodInfo method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetTypicalMethodDefinition(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); + private static extern void GetTypicalMethodDefinition(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo GetTypicalMethodDefinition(IRuntimeMethodInfo method) { @@ -967,12 +967,12 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static int GetGenericParameterCount(RuntimeMethodHandleInternal method); + private static extern int GetGenericParameterCount(RuntimeMethodHandleInternal method); internal static int GetGenericParameterCount(IRuntimeMethodInfo method) => GetGenericParameterCount(method.Value); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void StripMethodInstantiation(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); + private static extern void StripMethodInstantiation(IRuntimeMethodInfo method, ObjectHandleOnStack outMethod); internal static IRuntimeMethodInfo StripMethodInstantiation(IRuntimeMethodInfo method) { @@ -984,22 +984,22 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static bool IsDynamicMethod(RuntimeMethodHandleInternal method); + internal static extern bool IsDynamicMethod(RuntimeMethodHandleInternal method); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static void Destroy(RuntimeMethodHandleInternal method); + internal static extern void Destroy(RuntimeMethodHandleInternal method); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static Resolver GetResolver(RuntimeMethodHandleInternal method); + internal static extern Resolver GetResolver(RuntimeMethodHandleInternal method); [MethodImpl(MethodImplOptions.InternalCall)] - internal extern static MethodBody GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType); + internal static extern MethodBody GetMethodBody(IRuntimeMethodInfo method, RuntimeType declaringType); [MethodImpl(MethodImplOptions.InternalCall)] - internal extern static bool IsConstructor(RuntimeMethodHandleInternal method); + internal static extern bool IsConstructor(RuntimeMethodHandleInternal method); [MethodImpl(MethodImplOptions.InternalCall)] - internal extern static LoaderAllocator GetLoaderAllocator(RuntimeMethodHandleInternal method); + internal static extern LoaderAllocator GetLoaderAllocator(RuntimeMethodHandleInternal method); } // This type is used to remove the expense of having a managed reference object that is dynamically @@ -1190,7 +1190,7 @@ namespace System public static readonly ModuleHandle EmptyHandle = GetEmptyMH(); #endregion - unsafe static private ModuleHandle GetEmptyMH() + unsafe private static ModuleHandle GetEmptyMH() { return new ModuleHandle(); } @@ -1289,7 +1289,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void ResolveType(RuntimeModule module, + private static extern void ResolveType(RuntimeModule module, int typeToken, IntPtr* typeInstArgs, int typeInstCount, @@ -1334,7 +1334,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static RuntimeMethodHandleInternal ResolveMethod(RuntimeModule module, + private static extern RuntimeMethodHandleInternal ResolveMethod(RuntimeModule module, int methodToken, IntPtr* typeInstArgs, int typeInstCount, @@ -1370,7 +1370,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void ResolveField(RuntimeModule module, + private static extern void ResolveField(RuntimeModule module, int fieldToken, IntPtr* typeInstArgs, int typeInstCount, @@ -1379,7 +1379,7 @@ namespace System ObjectHandleOnStack retField); [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static bool _ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash); + private static extern bool _ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash); internal static bool ContainsPropertyMatchingHash(RuntimeModule module, int propertyToken, uint hash) { @@ -1387,7 +1387,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - internal extern static void GetModuleType(RuntimeModule handle, ObjectHandleOnStack type); + internal static extern void GetModuleType(RuntimeModule handle, ObjectHandleOnStack type); internal static RuntimeType GetModuleType(RuntimeModule module) { @@ -1397,7 +1397,7 @@ namespace System } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] - private extern static void GetPEKind(RuntimeModule handle, out int peKind, out int machine); + private static extern void GetPEKind(RuntimeModule handle, out int peKind, out int machine); // making this internal, used by Module.GetPEKind internal static void GetPEKind(RuntimeModule module, out PortableExecutableKinds peKind, out ImageFileMachine machine) @@ -1409,7 +1409,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static int GetMDStreamVersion(RuntimeModule module); + internal static extern int GetMDStreamVersion(RuntimeModule module); public int MDStreamVersion { @@ -1417,7 +1417,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - private extern static IntPtr _GetMetadataImport(RuntimeModule module); + private static extern IntPtr _GetMetadataImport(RuntimeModule module); internal static MetadataImport GetMetadataImport(RuntimeModule module) { diff --git a/src/mscorlib/src/System/String.Comparison.cs b/src/mscorlib/src/System/String.Comparison.cs index 23e9efe..6dfea0b 100644 --- a/src/mscorlib/src/System/String.Comparison.cs +++ b/src/mscorlib/src/System/String.Comparison.cs @@ -25,7 +25,7 @@ namespace System //Native Static Methods // - private unsafe static int CompareOrdinalIgnoreCaseHelper(String strA, String strB) + private static unsafe int CompareOrdinalIgnoreCaseHelper(String strA, String strB) { Debug.Assert(strA != null); Debug.Assert(strB != null); @@ -68,7 +68,7 @@ namespace System //This will not work in case-insensitive mode for any character greater than 0x7F. //We'll throw an ArgumentException. [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe internal static extern int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes); + internal static extern unsafe int nativeCompareOrdinalIgnoreCaseWC(String strA, sbyte* strBBytes); // // @@ -80,7 +80,7 @@ namespace System // Search/Query methods // - private unsafe static bool EqualsHelper(String strA, String strB) + private static unsafe bool EqualsHelper(String strA, String strB) { Debug.Assert(strA != null); Debug.Assert(strB != null); @@ -137,7 +137,7 @@ namespace System } } - private unsafe static bool EqualsIgnoreCaseAsciiHelper(String strA, String strB) + private static unsafe bool EqualsIgnoreCaseAsciiHelper(String strA, String strB) { Debug.Assert(strA != null); Debug.Assert(strB != null); @@ -175,7 +175,7 @@ namespace System } } - private unsafe static bool StartsWithOrdinalHelper(String str, String startsWith) + private static unsafe bool StartsWithOrdinalHelper(String str, String startsWith) { Debug.Assert(str != null); Debug.Assert(startsWith != null); diff --git a/src/mscorlib/src/System/String.CoreCLR.cs b/src/mscorlib/src/System/String.CoreCLR.cs index 7685af2..a9688fe 100644 --- a/src/mscorlib/src/System/String.CoreCLR.cs +++ b/src/mscorlib/src/System/String.CoreCLR.cs @@ -54,7 +54,7 @@ namespace System } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static String FastAllocateString(int length); + internal static extern String FastAllocateString(int length); // Is this a string that can be compared quickly (that is it has only characters > 0x80 // and not a - or ' @@ -94,7 +94,7 @@ namespace System } // Copies the source String (byte buffer) to the destination IntPtr memory allocated with len bytes. - internal unsafe static void InternalCopy(String src, IntPtr dest, int len) + internal static unsafe void InternalCopy(String src, IntPtr dest, int len) { if (len == 0) return; diff --git a/src/mscorlib/src/System/StubHelpers.cs b/src/mscorlib/src/System/StubHelpers.cs index fb19604..6322cf5 100644 --- a/src/mscorlib/src/System/StubHelpers.cs +++ b/src/mscorlib/src/System/StubHelpers.cs @@ -22,7 +22,7 @@ namespace System.StubHelpers { // The length of the returned array is an approximation based on the length of the input string and the system // character set. It is only guaranteed to be larger or equal to cbLength, don't depend on the exact value. - unsafe static internal byte[] DoAnsiConversion(string str, bool fBestFit, bool fThrowOnUnmappableChar, out int cbLength) + unsafe internal static byte[] DoAnsiConversion(string str, bool fBestFit, bool fThrowOnUnmappableChar, out int cbLength) { byte[] buffer = new byte[(str.Length + 1) * Marshal.SystemMaxDBCSCharSize]; Debug.Assert(buffer.Length != 0); @@ -33,7 +33,7 @@ namespace System.StubHelpers return buffer; } - unsafe static internal byte ConvertToNative(char managedChar, bool fBestFit, bool fThrowOnUnmappableChar) + unsafe internal static byte ConvertToNative(char managedChar, bool fBestFit, bool fThrowOnUnmappableChar) { int cbAllocLength = (1 + 1) * Marshal.SystemMaxDBCSCharSize; byte* bufferPtr = stackalloc byte[cbAllocLength]; @@ -44,7 +44,7 @@ namespace System.StubHelpers return bufferPtr[0]; } - static internal char ConvertToManaged(byte nativeChar) + internal static char ConvertToManaged(byte nativeChar) { Span bytes = new Span(ref nativeChar, 1); string str = Encoding.Default.GetString(bytes); @@ -54,7 +54,7 @@ namespace System.StubHelpers internal static class CSTRMarshaler { - static internal unsafe IntPtr ConvertToNative(int flags, string strManaged, IntPtr pNativeBuffer) + internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntPtr pNativeBuffer) { if (null == strManaged) { @@ -105,7 +105,7 @@ namespace System.StubHelpers return (IntPtr)pbNativeBuffer; } - static internal unsafe string ConvertToManaged(IntPtr cstr) + internal static unsafe string ConvertToManaged(IntPtr cstr) { if (IntPtr.Zero == cstr) return null; @@ -113,7 +113,7 @@ namespace System.StubHelpers return new String((sbyte*)cstr); } - static internal void ClearNative(IntPtr pNative) + internal static void ClearNative(IntPtr pNative) { Win32Native.CoTaskMemFree(pNative); } @@ -122,7 +122,7 @@ namespace System.StubHelpers internal static class UTF8Marshaler { private const int MAX_UTF8_CHAR_SIZE = 3; - static internal unsafe IntPtr ConvertToNative(int flags, string strManaged, IntPtr pNativeBuffer) + internal static unsafe IntPtr ConvertToNative(int flags, string strManaged, IntPtr pNativeBuffer) { if (null == strManaged) { @@ -158,7 +158,7 @@ namespace System.StubHelpers return (IntPtr)pbNativeBuffer; } - static internal unsafe string ConvertToManaged(IntPtr cstr) + internal static unsafe string ConvertToManaged(IntPtr cstr) { if (IntPtr.Zero == cstr) return null; @@ -166,7 +166,7 @@ namespace System.StubHelpers return String.CreateStringFromEncoding((byte*)cstr, nbBytes, Encoding.UTF8); } - static internal void ClearNative(IntPtr pNative) + internal static void ClearNative(IntPtr pNative) { if (pNative != IntPtr.Zero) { @@ -177,7 +177,7 @@ namespace System.StubHelpers internal static class UTF8BufferMarshaler { - static internal unsafe IntPtr ConvertToNative(StringBuilder sb, IntPtr pNativeBuffer, int flags) + internal static unsafe IntPtr ConvertToNative(StringBuilder sb, IntPtr pNativeBuffer, int flags) { if (null == sb) { @@ -198,7 +198,7 @@ namespace System.StubHelpers return (IntPtr)pbNativeBuffer; } - static internal unsafe void ConvertToManaged(StringBuilder sb, IntPtr pNative) + internal static unsafe void ConvertToManaged(StringBuilder sb, IntPtr pNative) { if (pNative == null) return; @@ -227,7 +227,7 @@ namespace System.StubHelpers internal static class BSTRMarshaler { - static internal unsafe IntPtr ConvertToNative(string strManaged, IntPtr pNativeBuffer) + internal static unsafe IntPtr ConvertToNative(string strManaged, IntPtr pNativeBuffer) { if (null == strManaged) { @@ -296,7 +296,7 @@ namespace System.StubHelpers } } - static internal unsafe string ConvertToManaged(IntPtr bstr) + internal static unsafe string ConvertToManaged(IntPtr bstr) { if (IntPtr.Zero == bstr) { @@ -340,7 +340,7 @@ namespace System.StubHelpers } } - static internal void ClearNative(IntPtr pNative) + internal static void ClearNative(IntPtr pNative) { if (IntPtr.Zero != pNative) { @@ -354,7 +354,7 @@ namespace System.StubHelpers internal static class VBByValStrMarshaler { - static internal unsafe IntPtr ConvertToNative(string strManaged, bool fBestFit, bool fThrowOnUnmappableChar, ref int cch) + internal static unsafe IntPtr ConvertToNative(string strManaged, bool fBestFit, bool fThrowOnUnmappableChar, ref int cch) { if (null == strManaged) { @@ -395,7 +395,7 @@ namespace System.StubHelpers return new IntPtr(pNative); } - static internal unsafe string ConvertToManaged(IntPtr pNative, int cch) + internal static unsafe string ConvertToManaged(IntPtr pNative, int cch) { if (IntPtr.Zero == pNative) { @@ -405,7 +405,7 @@ namespace System.StubHelpers return new String((sbyte*)pNative, 0, cch); } - static internal unsafe void ClearNative(IntPtr pNative) + internal static unsafe void ClearNative(IntPtr pNative) { if (IntPtr.Zero != pNative) { @@ -419,7 +419,7 @@ namespace System.StubHelpers internal static class AnsiBSTRMarshaler { - static internal unsafe IntPtr ConvertToNative(int flags, string strManaged) + internal static unsafe IntPtr ConvertToNative(int flags, string strManaged) { if (null == strManaged) { @@ -441,7 +441,7 @@ namespace System.StubHelpers return Win32Native.SysAllocStringByteLen(bytes, (uint)nb); } - static internal unsafe string ConvertToManaged(IntPtr bstr) + internal static unsafe string ConvertToManaged(IntPtr bstr) { if (IntPtr.Zero == bstr) { @@ -456,7 +456,7 @@ namespace System.StubHelpers } } - static internal unsafe void ClearNative(IntPtr pNative) + internal static unsafe void ClearNative(IntPtr pNative) { if (IntPtr.Zero != pNative) { @@ -470,19 +470,19 @@ namespace System.StubHelpers internal static class WSTRBufferMarshaler { - static internal IntPtr ConvertToNative(string strManaged) + internal static IntPtr ConvertToNative(string strManaged) { Debug.Fail("NYI"); return IntPtr.Zero; } - static internal unsafe string ConvertToManaged(IntPtr bstr) + internal static unsafe string ConvertToManaged(IntPtr bstr) { Debug.Fail("NYI"); return null; } - static internal void ClearNative(IntPtr pNative) + internal static void ClearNative(IntPtr pNative) { Debug.Fail("NYI"); } @@ -590,13 +590,13 @@ namespace System.StubHelpers internal static class ObjectMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertToNative(object objSrc, IntPtr pDstVariant); + internal static extern void ConvertToNative(object objSrc, IntPtr pDstVariant); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern object ConvertToManaged(IntPtr pSrcVariant); + internal static extern object ConvertToManaged(IntPtr pSrcVariant); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNative(IntPtr pVariant); + internal static extern void ClearNative(IntPtr pVariant); } // class ObjectMarshaler #endif // FEATURE_COMINTEROP @@ -604,23 +604,23 @@ namespace System.StubHelpers internal static class ValueClassMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertToNative(IntPtr dst, IntPtr src, IntPtr pMT, ref CleanupWorkList pCleanupWorkList); + internal static extern void ConvertToNative(IntPtr dst, IntPtr src, IntPtr pMT, ref CleanupWorkList pCleanupWorkList); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertToManaged(IntPtr dst, IntPtr src, IntPtr pMT); + internal static extern void ConvertToManaged(IntPtr dst, IntPtr src, IntPtr pMT); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNative(IntPtr dst, IntPtr pMT); + internal static extern void ClearNative(IntPtr dst, IntPtr pMT); } // class ValueClassMarshaler internal static class DateMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern double ConvertToNative(DateTime managedDate); + internal static extern double ConvertToNative(DateTime managedDate); // The return type is really DateTime but we use long to avoid the pain associated with returning structures. [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern long ConvertToManaged(double nativeDate); + internal static extern long ConvertToManaged(double nativeDate); } // class DateMarshaler #if FEATURE_COMINTEROP @@ -628,17 +628,17 @@ namespace System.StubHelpers internal static class InterfaceMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr ConvertToNative(object objSrc, IntPtr itfMT, IntPtr classMT, int flags); + internal static extern IntPtr ConvertToNative(object objSrc, IntPtr itfMT, IntPtr classMT, int flags); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern object ConvertToManaged(IntPtr pUnk, IntPtr itfMT, IntPtr classMT, int flags); + internal static extern object ConvertToManaged(IntPtr pUnk, IntPtr itfMT, IntPtr classMT, int flags); [DllImport(JitHelpers.QCall)] - static internal extern void ClearNative(IntPtr pUnk); + internal static extern void ClearNative(IntPtr pUnk); // [FriendAccessAllowed] [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern object ConvertToManagedWithoutUnboxing(IntPtr pNative); + internal static extern object ConvertToManagedWithoutUnboxing(IntPtr pNative); } // class InterfaceMarshaler #endif // FEATURE_COMINTEROP @@ -646,12 +646,12 @@ namespace System.StubHelpers internal static class UriMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern string GetRawUriFromNative(IntPtr pUri); + internal static extern string GetRawUriFromNative(IntPtr pUri); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static unsafe internal extern IntPtr CreateNativeUriInstanceHelper(char* rawUri, int strLen); + internal static extern unsafe IntPtr CreateNativeUriInstanceHelper(char* rawUri, int strLen); - static unsafe internal IntPtr CreateNativeUriInstance(string rawUri) + internal static unsafe IntPtr CreateNativeUriInstance(string rawUri) { fixed (char* pManaged = rawUri) { @@ -664,7 +664,7 @@ namespace System.StubHelpers internal static class EventArgsMarshaler { // [FriendAccessAllowed] - static internal IntPtr CreateNativeNCCEventArgsInstance(int action, object newItems, object oldItems, int newIndex, int oldIndex) + internal static IntPtr CreateNativeNCCEventArgsInstance(int action, object newItems, object oldItems, int newIndex, int oldIndex) { IntPtr newItemsIP = IntPtr.Zero; IntPtr oldItemsIP = IntPtr.Zero; @@ -690,10 +690,10 @@ namespace System.StubHelpers // [FriendAccessAllowed] [DllImport(JitHelpers.QCall)] - static extern internal IntPtr CreateNativePCEventArgsInstance([MarshalAs(UnmanagedType.HString)]string name); + static internal extern IntPtr CreateNativePCEventArgsInstance([MarshalAs(UnmanagedType.HString)]string name); [DllImport(JitHelpers.QCall)] - static extern internal IntPtr CreateNativeNCCEventArgsInstanceHelper(int action, IntPtr newItem, IntPtr oldItem, int newIndex, int oldIndex); + static internal extern IntPtr CreateNativeNCCEventArgsInstanceHelper(int action, IntPtr newItem, IntPtr oldItem, int newIndex, int oldIndex); } #endif // FEATURE_COMINTEROP @@ -711,54 +711,54 @@ namespace System.StubHelpers } [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, int dwFlags); + internal static extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, int dwFlags); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertSpaceToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertSpaceToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertSpaceToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome, + internal static extern void ConvertSpaceToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome, int cElements); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNative(IntPtr pMarshalState, IntPtr pNativeHome, int cElements); + internal static extern void ClearNative(IntPtr pMarshalState, IntPtr pNativeHome, int cElements); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNativeContents(IntPtr pMarshalState, IntPtr pNativeHome, int cElements); + internal static extern void ClearNativeContents(IntPtr pMarshalState, IntPtr pNativeHome, int cElements); } // class MngdNativeArrayMarshaler #if FEATURE_COMINTEROP internal static class MngdSafeArrayMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, int iRank, int dwFlags); + internal static extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, int iRank, int dwFlags); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertSpaceToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertSpaceToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome, object pOriginalManaged); + internal static extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome, object pOriginalManaged); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertSpaceToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertSpaceToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ClearNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); } // class MngdSafeArrayMarshaler internal static class MngdHiddenLengthArrayMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, IntPtr cbElementSize, ushort vt); + internal static extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pMT, IntPtr cbElementSize, ushort vt); [MethodImplAttribute(MethodImplOptions.InternalCall)] internal static extern void ConvertSpaceToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); @@ -918,19 +918,19 @@ namespace System.StubHelpers internal static class MngdRefCustomMarshaler { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pCMHelper); + internal static extern void CreateMarshaler(IntPtr pMarshalState, IntPtr pCMHelper); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertContentsToNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ConvertContentsToManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ClearNative(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); + internal static extern void ClearManaged(IntPtr pMarshalState, ref object pManagedHome, IntPtr pNativeHome); } // class MngdRefCustomMarshaler internal struct AsAnyMarshaler @@ -1284,7 +1284,7 @@ namespace System.StubHelpers #if FEATURE_COMINTEROP internal static class NullableMarshaler { - static internal IntPtr ConvertToNative(ref Nullable pManaged) where T : struct + internal static IntPtr ConvertToNative(ref Nullable pManaged) where T : struct { if (pManaged.HasValue) { @@ -1297,13 +1297,13 @@ namespace System.StubHelpers } } - static internal void ConvertToManagedRetVoid(IntPtr pNative, ref Nullable retObj) where T : struct + internal static void ConvertToManagedRetVoid(IntPtr pNative, ref Nullable retObj) where T : struct { retObj = ConvertToManaged(pNative); } - static internal Nullable ConvertToManaged(IntPtr pNative) where T : struct + internal static Nullable ConvertToManaged(IntPtr pNative) where T : struct { if (pNative != IntPtr.Zero) { @@ -1430,7 +1430,7 @@ namespace System.StubHelpers // For converting WinRT's Windows.Foundation.HResult into System.Exception and vice versa. internal static class HResultExceptionMarshaler { - static internal unsafe int ConvertToNative(Exception ex) + internal static unsafe int ConvertToNative(Exception ex) { if (!Environment.IsWinRTSupported) { @@ -1443,7 +1443,7 @@ namespace System.StubHelpers return ex._HResult; } - static internal unsafe Exception ConvertToManaged(int hr) + internal static unsafe Exception ConvertToManaged(int hr) { if (!Environment.IsWinRTSupported) { @@ -1550,27 +1550,27 @@ namespace System.StubHelpers internal static class StubHelpers { [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern bool IsQCall(IntPtr pMD); + internal static extern bool IsQCall(IntPtr pMD); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void InitDeclaringType(IntPtr pMD); + internal static extern void InitDeclaringType(IntPtr pMD); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetNDirectTarget(IntPtr pMD); + internal static extern IntPtr GetNDirectTarget(IntPtr pMD); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetDelegateTarget(Delegate pThis, ref IntPtr pStubArg); + internal static extern IntPtr GetDelegateTarget(Delegate pThis, ref IntPtr pStubArg); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ClearLastError(); + internal static extern void ClearLastError(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void SetLastError(); + internal static extern void SetLastError(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ThrowInteropParamException(int resID, int paramIdx); + internal static extern void ThrowInteropParamException(int resID, int paramIdx); - static internal IntPtr AddToCleanupList(ref CleanupWorkList pCleanupWorkList, SafeHandle handle) + internal static IntPtr AddToCleanupList(ref CleanupWorkList pCleanupWorkList, SafeHandle handle) { if (pCleanupWorkList == null) pCleanupWorkList = new CleanupWorkList(); @@ -1582,7 +1582,7 @@ namespace System.StubHelpers return SafeHandleAddRef(handle, ref element.m_owned); } - static internal void DestroyCleanupList(ref CleanupWorkList pCleanupWorkList) + internal static void DestroyCleanupList(ref CleanupWorkList pCleanupWorkList) { if (pCleanupWorkList != null) { @@ -1591,7 +1591,7 @@ namespace System.StubHelpers } } - static internal Exception GetHRExceptionObject(int hr) + internal static Exception GetHRExceptionObject(int hr) { Exception ex = InternalGetHRExceptionObject(hr); ex.InternalPreserveStackTrace(); @@ -1599,17 +1599,17 @@ namespace System.StubHelpers } [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern Exception InternalGetHRExceptionObject(int hr); + internal static extern Exception InternalGetHRExceptionObject(int hr); #if FEATURE_COMINTEROP - static internal Exception GetCOMHRExceptionObject(int hr, IntPtr pCPCMD, object pThis) + internal static Exception GetCOMHRExceptionObject(int hr, IntPtr pCPCMD, object pThis) { Exception ex = InternalGetCOMHRExceptionObject(hr, pCPCMD, pThis, false); ex.InternalPreserveStackTrace(); return ex; } - static internal Exception GetCOMHRExceptionObject_WinRT(int hr, IntPtr pCPCMD, object pThis) + internal static Exception GetCOMHRExceptionObject_WinRT(int hr, IntPtr pCPCMD, object pThis) { Exception ex = InternalGetCOMHRExceptionObject(hr, pCPCMD, pThis, true); ex.InternalPreserveStackTrace(); @@ -1617,19 +1617,19 @@ namespace System.StubHelpers } [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern Exception InternalGetCOMHRExceptionObject(int hr, IntPtr pCPCMD, object pThis, bool fForWinRT); + internal static extern Exception InternalGetCOMHRExceptionObject(int hr, IntPtr pCPCMD, object pThis, bool fForWinRT); #endif // FEATURE_COMINTEROP [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr CreateCustomMarshalerHelper(IntPtr pMD, int paramToken, IntPtr hndManagedType); + internal static extern IntPtr CreateCustomMarshalerHelper(IntPtr pMD, int paramToken, IntPtr hndManagedType); //------------------------------------------------------- // SafeHandle Helpers //------------------------------------------------------- // AddRefs the SH and returns the underlying unmanaged handle. - static internal IntPtr SafeHandleAddRef(SafeHandle pHandle, ref bool success) + internal static IntPtr SafeHandleAddRef(SafeHandle pHandle, ref bool success) { if (pHandle == null) { @@ -1641,7 +1641,7 @@ namespace System.StubHelpers } // Releases the SH (to be called from finally block). - static internal void SafeHandleRelease(SafeHandle pHandle) + internal static void SafeHandleRelease(SafeHandle pHandle) { if (pHandle == null) { @@ -1665,55 +1665,55 @@ namespace System.StubHelpers #if FEATURE_COMINTEROP [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget, out bool pfNeedsRelease); + internal static extern IntPtr GetCOMIPFromRCW(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget, out bool pfNeedsRelease); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetCOMIPFromRCW_WinRT(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); + internal static extern IntPtr GetCOMIPFromRCW_WinRT(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetCOMIPFromRCW_WinRTSharedGeneric(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); + internal static extern IntPtr GetCOMIPFromRCW_WinRTSharedGeneric(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetCOMIPFromRCW_WinRTDelegate(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); + internal static extern IntPtr GetCOMIPFromRCW_WinRTDelegate(object objSrc, IntPtr pCPCMD, out IntPtr ppTarget); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern bool ShouldCallWinRTInterface(object objSrc, IntPtr pCPCMD); + internal static extern bool ShouldCallWinRTInterface(object objSrc, IntPtr pCPCMD); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern Delegate GetTargetForAmbiguousVariantCall(object objSrc, IntPtr pMT, out bool fUseString); + internal static extern Delegate GetTargetForAmbiguousVariantCall(object objSrc, IntPtr pMT, out bool fUseString); //------------------------------------------------------- // Helper for the MDA RaceOnRCWCleanup //------------------------------------------------------- [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void StubRegisterRCW(object pThis); + internal static extern void StubRegisterRCW(object pThis); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void StubUnregisterRCW(object pThis); + internal static extern void StubUnregisterRCW(object pThis); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetDelegateInvokeMethod(Delegate pThis); + internal static extern IntPtr GetDelegateInvokeMethod(Delegate pThis); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern object GetWinRTFactoryObject(IntPtr pCPCMD); + internal static extern object GetWinRTFactoryObject(IntPtr pCPCMD); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetWinRTFactoryReturnValue(object pThis, IntPtr pCtorEntry); + internal static extern IntPtr GetWinRTFactoryReturnValue(object pThis, IntPtr pCtorEntry); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetOuterInspectable(object pThis, IntPtr pCtorMD); + internal static extern IntPtr GetOuterInspectable(object pThis, IntPtr pCtorMD); #if MDA_SUPPORTED [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern Exception TriggerExceptionSwallowedMDA(Exception ex, IntPtr pManagedTarget); + internal static extern Exception TriggerExceptionSwallowedMDA(Exception ex, IntPtr pManagedTarget); #endif // MDA_SUPPORTED #endif // FEATURE_COMINTEROP #if MDA_SUPPORTED [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void CheckCollectedDelegateMDA(IntPtr pEntryThunk); + internal static extern void CheckCollectedDelegateMDA(IntPtr pEntryThunk); #endif // MDA_SUPPORTED //------------------------------------------------------- @@ -1721,21 +1721,21 @@ namespace System.StubHelpers //------------------------------------------------------- #if PROFILING_SUPPORTED [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr ProfilerBeginTransitionCallback(IntPtr pSecretParam, IntPtr pThread, object pThis); + internal static extern IntPtr ProfilerBeginTransitionCallback(IntPtr pSecretParam, IntPtr pThread, object pThis); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ProfilerEndTransitionCallback(IntPtr pMD, IntPtr pThread); + internal static extern void ProfilerEndTransitionCallback(IntPtr pMD, IntPtr pThread); #endif // PROFILING_SUPPORTED //------------------------------------------------------ // misc //------------------------------------------------------ - static internal void CheckStringLength(int length) + internal static void CheckStringLength(int length) { CheckStringLength((uint)length); } - static internal void CheckStringLength(uint length) + internal static void CheckStringLength(uint length) { if (length > 0x7ffffff0) { @@ -1744,49 +1744,49 @@ namespace System.StubHelpers } [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal unsafe extern int strlen(sbyte* ptr); + internal static extern unsafe int strlen(sbyte* ptr); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void DecimalCanonicalizeInternal(ref Decimal dec); + internal static extern void DecimalCanonicalizeInternal(ref Decimal dec); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal unsafe extern void FmtClassUpdateNativeInternal(object obj, byte* pNative, ref CleanupWorkList pCleanupWorkList); + internal static extern unsafe void FmtClassUpdateNativeInternal(object obj, byte* pNative, ref CleanupWorkList pCleanupWorkList); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal unsafe extern void FmtClassUpdateCLRInternal(object obj, byte* pNative); + internal static extern unsafe void FmtClassUpdateCLRInternal(object obj, byte* pNative); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal unsafe extern void LayoutDestroyNativeInternal(byte* pNative, IntPtr pMT); + internal static extern unsafe void LayoutDestroyNativeInternal(byte* pNative, IntPtr pMT); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern object AllocateInternal(IntPtr typeHandle); + internal static extern object AllocateInternal(IntPtr typeHandle); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void MarshalToUnmanagedVaListInternal(IntPtr va_list, uint vaListSize, IntPtr pArgIterator); + internal static extern void MarshalToUnmanagedVaListInternal(IntPtr va_list, uint vaListSize, IntPtr pArgIterator); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void MarshalToManagedVaListInternal(IntPtr va_list, IntPtr pArgIterator); + internal static extern void MarshalToManagedVaListInternal(IntPtr va_list, IntPtr pArgIterator); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern uint CalcVaListSize(IntPtr va_list); + internal static extern uint CalcVaListSize(IntPtr va_list); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ValidateObject(object obj, IntPtr pMD, object pThis); + internal static extern void ValidateObject(object obj, IntPtr pMD, object pThis); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void LogPinnedArgument(IntPtr localDesc, IntPtr nativeArg); + internal static extern void LogPinnedArgument(IntPtr localDesc, IntPtr nativeArg); [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void ValidateByref(IntPtr byref, IntPtr pMD, object pThis); // the byref is pinned so we can safely "cast" it to IntPtr + internal static extern void ValidateByref(IntPtr byref, IntPtr pMD, object pThis); // the byref is pinned so we can safely "cast" it to IntPtr [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetStubContext(); + internal static extern IntPtr GetStubContext(); #if BIT64 [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern IntPtr GetStubContextAddr(); + internal static extern IntPtr GetStubContextAddr(); #endif // BIT64 #if MDA_SUPPORTED [MethodImplAttribute(MethodImplOptions.InternalCall)] - static internal extern void TriggerGCForMDA(); + internal static extern void TriggerGCForMDA(); #endif // MDA_SUPPORTED #if FEATURE_ARRAYSTUB_AS_IL diff --git a/src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs b/src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs index 6455b48..6e4dd68 100644 --- a/src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs +++ b/src/mscorlib/src/System/Text/StringBuilder.CoreCLR.cs @@ -9,10 +9,10 @@ namespace System.Text public partial class StringBuilder { [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe extern void ReplaceBufferInternal(char* newBuffer, int newLength); + internal extern unsafe void ReplaceBufferInternal(char* newBuffer, int newLength); [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe extern void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength); + internal extern unsafe void ReplaceBufferAnsiInternal(sbyte* newBuffer, int newLength); /// /// Copies the contents of this builder to the specified buffer. diff --git a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs index 5e0f2af..ea03087 100644 --- a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs +++ b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandle.cs @@ -254,7 +254,7 @@ namespace System.Threading /// is . /// [CLSCompliant(false)] - public unsafe static object GetNativeOverlappedState(NativeOverlapped* overlapped) + public static unsafe object GetNativeOverlappedState(NativeOverlapped* overlapped) { if (overlapped == null) throw new ArgumentNullException(nameof(overlapped)); diff --git a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs index 1aea2a2..7ce8936 100644 --- a/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs +++ b/src/mscorlib/src/System/Threading/ClrThreadPoolBoundHandleOverlapped.cs @@ -29,7 +29,7 @@ namespace System.Threading _nativeOverlapped->OffsetHigh = 0; } - private unsafe static void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) + private static unsafe void CompletionCallback(uint errorCode, uint numBytes, NativeOverlapped* nativeOverlapped) { ThreadPoolBoundHandleOverlapped overlapped = (ThreadPoolBoundHandleOverlapped)Overlapped.Unpack(nativeOverlapped); diff --git a/src/mscorlib/src/System/Threading/Overlapped.cs b/src/mscorlib/src/System/Threading/Overlapped.cs index 660e9f4..f4c6a60 100644 --- a/src/mscorlib/src/System/Threading/Overlapped.cs +++ b/src/mscorlib/src/System/Threading/Overlapped.cs @@ -56,7 +56,7 @@ namespace System.Threading #region class _IOCompletionCallback - unsafe internal class _IOCompletionCallback + internal unsafe class _IOCompletionCallback { private IOCompletionCallback _ioCompletionCallback; private ExecutionContext _executionContext; @@ -71,8 +71,8 @@ namespace System.Threading _executionContext = ExecutionContext.Capture(); } // Context callback: same sig for SendOrPostCallback and ContextCallback - static internal ContextCallback _ccb = new ContextCallback(IOCompletionCallback_Context); - static internal void IOCompletionCallback_Context(Object state) + internal static ContextCallback _ccb = new ContextCallback(IOCompletionCallback_Context); + internal static void IOCompletionCallback_Context(Object state) { _IOCompletionCallback helper = (_IOCompletionCallback)state; Debug.Assert(helper != null, "_IOCompletionCallback cannot be null"); @@ -81,7 +81,7 @@ namespace System.Threading // call back helper - static unsafe internal void PerformIOCompletionCallback(uint errorCode, // Error code + internal static unsafe void PerformIOCompletionCallback(uint errorCode, // Error code uint numBytes, // No. of bytes transferred NativeOverlapped* pOVERLAP // ptr to OVERLAP structure ) @@ -161,7 +161,7 @@ namespace System.Threading m_nativeOverlapped.InternalHigh = IntPtr.Zero; } - unsafe internal NativeOverlapped* Pack(IOCompletionCallback iocb, Object userData) + internal unsafe NativeOverlapped* Pack(IOCompletionCallback iocb, Object userData) { if (m_pinSelf != IntPtr.Zero) { @@ -193,7 +193,7 @@ namespace System.Threading return AllocateNativeOverlapped(); } - unsafe internal NativeOverlapped* UnsafePack(IOCompletionCallback iocb, Object userData) + internal unsafe NativeOverlapped* UnsafePack(IOCompletionCallback iocb, Object userData) { if (m_pinSelf != IntPtr.Zero) { @@ -223,16 +223,16 @@ namespace System.Threading } [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe private extern NativeOverlapped* AllocateNativeOverlapped(); + private extern unsafe NativeOverlapped* AllocateNativeOverlapped(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe internal static extern void FreeNativeOverlapped(NativeOverlapped* nativeOverlappedPtr); + internal static extern unsafe void FreeNativeOverlapped(NativeOverlapped* nativeOverlappedPtr); [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe internal static extern OverlappedData GetOverlappedFromNative(NativeOverlapped* nativeOverlappedPtr); + internal static extern unsafe OverlappedData GetOverlappedFromNative(NativeOverlapped* nativeOverlappedPtr); [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe internal static extern void CheckVMForIOPacket(out NativeOverlapped* pOVERLAP, out uint errorCode, out uint numBytes); + internal static extern unsafe void CheckVMForIOPacket(out NativeOverlapped* pOVERLAP, out uint errorCode, out uint numBytes); } #endregion class OverlappedData @@ -314,26 +314,26 @@ namespace System.Threading ====================================================================*/ [Obsolete("This method is not safe. Use Pack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")] [CLSCompliant(false)] - unsafe public NativeOverlapped* Pack(IOCompletionCallback iocb) + public unsafe NativeOverlapped* Pack(IOCompletionCallback iocb) { return Pack(iocb, null); } [CLSCompliant(false)] - unsafe public NativeOverlapped* Pack(IOCompletionCallback iocb, Object userData) + public unsafe NativeOverlapped* Pack(IOCompletionCallback iocb, Object userData) { return m_overlappedData.Pack(iocb, userData); } [Obsolete("This method is not safe. Use UnsafePack (iocb, userData) instead. http://go.microsoft.com/fwlink/?linkid=14202")] [CLSCompliant(false)] - unsafe public NativeOverlapped* UnsafePack(IOCompletionCallback iocb) + public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback iocb) { return UnsafePack(iocb, null); } [CLSCompliant(false)] - unsafe public NativeOverlapped* UnsafePack(IOCompletionCallback iocb, Object userData) + public unsafe NativeOverlapped* UnsafePack(IOCompletionCallback iocb, Object userData) { return m_overlappedData.UnsafePack(iocb, userData); } @@ -343,7 +343,7 @@ namespace System.Threading * Unpins the native Overlapped struct ====================================================================*/ [CLSCompliant(false)] - unsafe public static Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) + public static unsafe Overlapped Unpack(NativeOverlapped* nativeOverlappedPtr) { if (nativeOverlappedPtr == null) throw new ArgumentNullException(nameof(nativeOverlappedPtr)); @@ -354,7 +354,7 @@ namespace System.Threading } [CLSCompliant(false)] - unsafe public static void Free(NativeOverlapped* nativeOverlappedPtr) + public static unsafe void Free(NativeOverlapped* nativeOverlappedPtr) { if (nativeOverlappedPtr == null) throw new ArgumentNullException(nameof(nativeOverlappedPtr)); diff --git a/src/mscorlib/src/System/Threading/PinnableBufferCache.cs b/src/mscorlib/src/System/Threading/PinnableBufferCache.cs index a896fa2..48af6e6 100644 --- a/src/mscorlib/src/System/Threading/PinnableBufferCache.cs +++ b/src/mscorlib/src/System/Threading/PinnableBufferCache.cs @@ -536,7 +536,7 @@ namespace System public void AgePendingBuffersResults(string cacheName, int promotedToFreeListCount, int heldBackCount) { } public void WalkFreeListResult(string cacheName, int freeListCount, int gen0BuffersInFreeList) { } - static internal ulong AddressOf(object obj) + internal static ulong AddressOf(object obj) { return 0; } diff --git a/src/mscorlib/src/System/Threading/Tasks/AsyncCausalityTracer.cs b/src/mscorlib/src/System/Threading/Tasks/AsyncCausalityTracer.cs index 322b4f8..0e4ed9b 100644 --- a/src/mscorlib/src/System/Threading/Tasks/AsyncCausalityTracer.cs +++ b/src/mscorlib/src/System/Threading/Tasks/AsyncCausalityTracer.cs @@ -83,7 +83,7 @@ namespace System.Threading.Tasks // [FriendAccessAllowed] internal static class AsyncCausalityTracer { - static internal void EnableToETW(bool enabled) + internal static void EnableToETW(bool enabled) { #if FEATURE_COMINTEROP if (enabled) diff --git a/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs b/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs index c23991f..14d5fe8 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TPLETWProvider.cs @@ -518,7 +518,7 @@ namespace System.Threading.Tasks } [NonEvent] - unsafe public void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref Object))); } + public unsafe void RunningContinuation(int TaskID, object Object) { RunningContinuation(TaskID, (long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref Object))); } [Event(20, Keywords = Keywords.Debug)] private void RunningContinuation(int TaskID, long Object) { @@ -527,7 +527,7 @@ namespace System.Threading.Tasks } [NonEvent] - unsafe public void RunningContinuationList(int TaskID, int Index, object Object) { RunningContinuationList(TaskID, Index, (long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref Object))); } + public unsafe void RunningContinuationList(int TaskID, int Index, object Object) { RunningContinuationList(TaskID, Index, (long)*((void**)JitHelpers.UnsafeCastToStackPointer(ref Object))); } [Event(21, Keywords = Keywords.Debug)] public void RunningContinuationList(int TaskID, int Index, long Object) diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index 11f754c..8778abc 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -46,9 +46,9 @@ namespace System.Threading _executionContext = ec; } - static internal ContextCallback _ccb = new ContextCallback(ThreadStart_Context); + internal static ContextCallback _ccb = new ContextCallback(ThreadStart_Context); - static private void ThreadStart_Context(Object state) + private static void ThreadStart_Context(Object state) { ThreadHelper t = (ThreadHelper)state; if (t._start is ThreadStart) @@ -201,7 +201,7 @@ namespace System.Threading return _managedThreadId; } - extern public new int ManagedThreadId + public extern new int ManagedThreadId { [MethodImplAttribute(MethodImplOptions.InternalCall)] get; @@ -286,7 +286,7 @@ namespace System.Threading // correctness) and for FileStream's async code path (for perf, to // avoid creating a Thread instance). [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal extern static IntPtr InternalGetCurrentThread(); + internal static extern IntPtr InternalGetCurrentThread(); /*========================================================================= ** Suspends the current thread for timeout milliseconds. If timeout == 0, diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index e10212a..69c189f 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -1116,7 +1116,7 @@ namespace System.Threading } [CLSCompliant(false)] - unsafe public delegate void IOCompletionCallback(uint errorCode, // Error code + public unsafe delegate void IOCompletionCallback(uint errorCode, // Error code uint numBytes, // No. of bytes transferred NativeOverlapped* pOVERLAP // ptr to OVERLAP structure ); @@ -1444,10 +1444,10 @@ namespace System.Threading internal static extern bool RequestWorkerThread(); [MethodImplAttribute(MethodImplOptions.InternalCall)] - unsafe private static extern bool PostQueuedCompletionStatus(NativeOverlapped* overlapped); + private static extern unsafe bool PostQueuedCompletionStatus(NativeOverlapped* overlapped); [CLSCompliant(false)] - unsafe public static bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => + public static unsafe bool UnsafeQueueNativeOverlapped(NativeOverlapped* overlapped) => PostQueuedCompletionStatus(overlapped); // The thread pool maintains a per-appdomain managed work queue. diff --git a/src/mscorlib/src/System/TypedReference.cs b/src/mscorlib/src/System/TypedReference.cs index 4733aba..1a378d4 100644 --- a/src/mscorlib/src/System/TypedReference.cs +++ b/src/mscorlib/src/System/TypedReference.cs @@ -70,7 +70,7 @@ namespace System [MethodImplAttribute(MethodImplOptions.InternalCall)] // reference to TypedReference is banned, so have to pass result as pointer - private unsafe static extern void InternalMakeTypedReference(void* result, Object target, IntPtr[] flds, RuntimeType lastFieldType); + private static extern unsafe void InternalMakeTypedReference(void* result, Object target, IntPtr[] flds, RuntimeType lastFieldType); public override int GetHashCode() { @@ -85,13 +85,13 @@ namespace System throw new NotSupportedException(SR.NotSupported_NYI); } - public unsafe static Object ToObject(TypedReference value) + public static unsafe Object ToObject(TypedReference value) { return InternalToObject(&value); } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe extern static Object InternalToObject(void* value); + internal static extern unsafe Object InternalToObject(void* value); internal bool IsNull { @@ -113,12 +113,12 @@ namespace System // This may cause the type to be changed. [CLSCompliant(false)] - public unsafe static void SetTypedReference(TypedReference target, Object value) + public static unsafe void SetTypedReference(TypedReference target, Object value) { InternalSetTypedReference(&target, value); } [MethodImplAttribute(MethodImplOptions.InternalCall)] - internal unsafe extern static void InternalSetTypedReference(void* target, Object value); + internal static extern unsafe void InternalSetTypedReference(void* target, Object value); } }