1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00

Remove unused private parameters in SPC (#63015)

This commit is contained in:
Marek Safar 2022-02-12 18:44:41 +01:00 committed by GitHub
parent d78094e038
commit 47bcd1a8b0
Signed by: github
GPG key ID: 4AEE18F83AFDEB23
67 changed files with 153 additions and 107 deletions

View file

@ -774,7 +774,7 @@ dotnet_diagnostic.CA5383.severity = none
# CA5384: Do Not Use Digital Signature Algorithm (DSA)
dotnet_diagnostic.CA5384.severity = warning
# CA5385: Use RivestShamirAdleman (RSA) Algorithm With Sufficient Key Size
# CA5385: Use Rivest-Shamir-Adleman (RSA) Algorithm With Sufficient Key Size
dotnet_diagnostic.CA5385.severity = warning
# CA5386: Avoid hardcoding SecurityProtocolType value
@ -1448,6 +1448,7 @@ dotnet_diagnostic.IDE0059.severity = warning
# IDE0060: Remove unused parameter
dotnet_diagnostic.IDE0060.severity = silent
dotnet_code_quality_unused_parameters = non_public
# IDE0061: Use expression body for local functions
dotnet_diagnostic.IDE0061.severity = silent

View file

@ -4,6 +4,8 @@
using System;
using System.Runtime.InteropServices;
#pragma warning disable IDE0060
namespace Internal.Runtime.InteropServices
{
public static class ComActivator

View file

@ -521,7 +521,7 @@ namespace System
_this[index] = value;
}
private void Add<T>(T value)
private void Add<T>(T _)
{
// Not meaningful for arrays.
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
@ -556,20 +556,20 @@ namespace System
return Array.IndexOf(_this, value, 0, _this.Length);
}
private void Insert<T>(int index, T value)
private void Insert<T>(int _, T _1)
{
// Not meaningful for arrays
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
}
private bool Remove<T>(T value)
private bool Remove<T>(T _)
{
// Not meaningful for arrays
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
return default;
}
private void RemoveAt<T>(int index)
private void RemoveAt<T>(int _)
{
// Not meaningful for arrays
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);

View file

@ -52,7 +52,9 @@ namespace System.Diagnostics
}
}
#pragma warning disable IDE0060
private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false;
#pragma warning restore IDE0060
[GeneratedDllImport(RuntimeHelpers.QCall, EntryPoint = "StackFrame_GetMethodDescFromNativeIP")]
private static partial RuntimeMethodHandleInternal GetMethodDescFromNativeIP(IntPtr ip);

View file

@ -571,6 +571,7 @@ namespace System
private static void ThrowNullThisInDelegateToInstance() =>
throw new ArgumentException(SR.Arg_DlgtNullInst);
#pragma warning disable IDE0060
[System.Diagnostics.DebuggerNonUserCode]
private void CtorClosed(object target, IntPtr methodPtr)
{
@ -635,5 +636,6 @@ namespace System
this._methodPtrAux = GetCallStub(methodPtr);
this._methodBase = System.Runtime.InteropServices.GCHandle.InternalGet(gchandle);
}
#pragma warning restore IDE0060
}
}

View file

@ -28,7 +28,6 @@ namespace System.Reflection.Emit
internal PropertyBuilder(
ModuleBuilder mod, // the module containing this PropertyBuilder
string name, // property name
SignatureHelper sig, // property signature descriptor info
PropertyAttributes attr, // property attribute such as DefaultProperty, Bindable, DisplayBind, etc
Type returnType, // return type of the property.
int prToken, // the metadata token for this property

View file

@ -1774,7 +1774,6 @@ namespace System.Reflection.Emit
return new PropertyBuilder(
m_module,
name,
sigHelper,
attributes,
returnType,
prToken,

View file

@ -2800,7 +2800,7 @@ namespace System
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types, modifiers) as ConstructorInfo;
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types) as ConstructorInfo;
binder ??= DefaultBinder;
return binder.SelectMethod(bindingAttr, candidates.ToArray(), types, modifiers) as ConstructorInfo;
@ -2836,7 +2836,7 @@ namespace System
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types, modifiers);
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types);
binder ??= DefaultBinder;
return binder.SelectProperty(bindingAttr, candidates.ToArray(), returnType, types, modifiers);

View file

@ -39,7 +39,7 @@ namespace System.Reflection.Runtime.TypeInfos
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types, modifiers) as ConstructorInfo;
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types) as ConstructorInfo;
if (binder == null)
binder = DefaultBinder;
@ -173,7 +173,7 @@ namespace System.Reflection.Runtime.TypeInfos
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types, modifiers);
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types);
if (binder == null)
binder = DefaultBinder;

View file

@ -184,9 +184,7 @@ namespace Microsoft.Win32.SafeHandles
Interop.Sys.Permissions openPermissions = DefaultOpenPermissions,
Func<Interop.ErrorInfo, Interop.Sys.OpenFlags, string, Exception?>? createOpenException = null)
{
long fileLength;
Interop.Sys.Permissions filePermissions;
return Open(fullPath, mode, access, share, options, preallocationSize, openPermissions, out fileLength, out filePermissions, createOpenException);
return Open(fullPath, mode, access, share, options, preallocationSize, openPermissions, out _, out _, createOpenException);
}
private static SafeFileHandle Open(string fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize,
@ -317,7 +315,7 @@ namespace Microsoft.Win32.SafeHandles
if ((access & FileAccess.Write) == 0)
{
// Stat the file descriptor to avoid race conditions.
FStatCheckIO(this, path, ref status, ref statusHasValue);
FStatCheckIO(path, ref status, ref statusHasValue);
if ((status.Mode & Interop.Sys.FileTypes.S_IFMT) == Interop.Sys.FileTypes.S_IFDIR)
{
@ -367,7 +365,7 @@ namespace Microsoft.Win32.SafeHandles
if (_isLocked && ((options & FileOptions.DeleteOnClose) != 0) &&
share == FileShare.None && mode == FileMode.OpenOrCreate)
{
FStatCheckIO(this, path, ref status, ref statusHasValue);
FStatCheckIO(path, ref status, ref statusHasValue);
Interop.Sys.FileStatus pathStatus;
if (Interop.Sys.Stat(path, out pathStatus) < 0)
@ -482,7 +480,7 @@ namespace Microsoft.Win32.SafeHandles
}
}
private void FStatCheckIO(SafeFileHandle handle, string path, ref Interop.Sys.FileStatus status, ref bool statusHasValue)
private void FStatCheckIO(string path, ref Interop.Sys.FileStatus status, ref bool statusHasValue)
{
if (!statusHasValue)
{

View file

@ -58,7 +58,7 @@ namespace System.Buffers.Text
//
[DoesNotReturn]
[StackTraceHidden]
public static bool TryParseThrowFormatException<T>(ReadOnlySpan<byte> source, out T value, out int bytesConsumed) where T : struct
public static bool TryParseThrowFormatException<T>(ReadOnlySpan<byte> _, out T value, out int bytesConsumed) where T : struct
{
// The parameters to this method are ordered the same as our callers' parameters
// allowing the JIT to avoid unnecessary register swapping or spilling.

View file

@ -16,6 +16,7 @@ namespace System
private readonly IntPtr _value;
#pragma warning restore CA1823, 169
#pragma warning disable IDE0060
[Intrinsic]
public ByReference(ref T value)
{
@ -24,6 +25,7 @@ namespace System
// or if intrinsic is missed.
throw new PlatformNotSupportedException();
}
#pragma warning restore IDE0060
#pragma warning disable CA1822 // Mark members as static
public ref T Value

View file

@ -223,7 +223,7 @@ namespace System.Collections
// Note: this constructor is a bogus constructor that does nothing
// and is for use only with SyncHashtable.
internal Hashtable(bool trash)
internal Hashtable(bool _)
{
}

View file

@ -15,10 +15,17 @@ namespace System
}
}
#pragma warning disable IDE0060
// Never called
private static DateTime FromFileTimeLeapSecondsAware(ulong fileTime) => default;
// Never called
private static ulong ToFileTimeLeapSecondsAware(long ticks) => default;
// IsValidTimeWithLeapSeconds is not expected to be called at all for now on non-Windows platforms
internal static bool IsValidTimeWithLeapSeconds(int year, int month, int day, int hour, int minute, DateTimeKind kind) => false;
#pragma warning restore IDE0060
}
}

View file

@ -767,7 +767,7 @@ namespace System
// Return any exact bindings that may exist. (This method is not defined on the
// Binder and is used by RuntimeType.)
public static MethodBase? ExactBinding(MethodBase[] match!!, Type[] types, ParameterModifier[]? modifiers)
public static MethodBase? ExactBinding(MethodBase[] match!!, Type[] types)
{
MethodBase[] aExactMatches = new MethodBase[match.Length];
int cExactMatches = 0;
@ -807,7 +807,7 @@ namespace System
// Return any exact bindings that may exist. (This method is not defined on the
// Binder and is used by RuntimeType.)
public static PropertyInfo? ExactPropertyBinding(PropertyInfo[] match!!, Type? returnType, Type[]? types, ParameterModifier[]? modifiers)
public static PropertyInfo? ExactPropertyBinding(PropertyInfo[] match!!, Type? returnType, Type[]? types)
{
PropertyInfo? bestMatch = null;
int typesLength = (types != null) ? types.Length : 0;

View file

@ -9,10 +9,14 @@ namespace System
{
// Systems without the Windows registry pretend that it's always empty.
#pragma warning disable IDE0060
private static string? GetEnvironmentVariableFromRegistry(string variable, bool fromMachine) => null;
#pragma warning restore IDE0060
private static void SetEnvironmentVariableFromRegistry(string variable, string? value, bool fromMachine) { }
static partial void SetEnvironmentVariableFromRegistry(string variable, string? value, bool fromMachine);
#pragma warning disable IDE0060
private static IDictionary GetEnvironmentVariablesFromRegistry(bool fromMachine) => new Hashtable();
#pragma warning restore IDE0060
}
}

View file

@ -709,7 +709,7 @@ namespace System.Globalization
internal static int GetSystemTwoDigitYearSetting(CalendarId CalID, int defaultYearValue)
{
int twoDigitYearMax = GlobalizationMode.UseNls ? CalendarData.NlsGetTwoDigitYearMax(CalID) : CalendarData.IcuGetTwoDigitYearMax(CalID);
int twoDigitYearMax = GlobalizationMode.UseNls ? CalendarData.NlsGetTwoDigitYearMax(CalID) : CalendarData.IcuGetTwoDigitYearMax();
return twoDigitYearMax >= 0 ? twoDigitYearMax : defaultYearValue;
}
}

View file

@ -81,7 +81,7 @@ namespace System.Globalization
return result;
}
internal static int IcuGetTwoDigitYearMax(CalendarId calendarId)
internal static int IcuGetTwoDigitYearMax()
{
Debug.Assert(!GlobalizationMode.UseNls);

View file

@ -8,7 +8,9 @@ namespace System.Globalization
private bool LoadCalendarDataFromSystemCore(string localeName, CalendarId calendarId) =>
IcuLoadCalendarDataFromSystem(localeName, calendarId);
#pragma warning disable IDE0060
internal static int GetCalendarsCore(string localeName, bool useUserOverride, CalendarId[] calendars) =>
IcuGetCalendars(localeName, calendars);
#pragma warning restore IDE0060
}
}

View file

@ -209,7 +209,7 @@ namespace System.Globalization
}
// no support to lookup by region name, other than the hard-coded list in CultureData
private static CultureData? IcuGetCultureDataFromRegionName(string? regionName) => null;
private static CultureData? IcuGetCultureDataFromRegionName() => null;
private string IcuGetLanguageDisplayName(string cultureName) => IcuGetLocaleInfo(cultureName, LocaleStringData.LocalizedDisplayName, CultureInfo.CurrentUICulture.Name);

View file

@ -9,11 +9,8 @@ namespace System.Globalization
{
private bool InitCultureDataCore() => InitIcuCultureDataCore();
private void InitUserOverride(bool useUserOverride)
{
// Unix doesn't support user overrides
_bUseOverrides = false;
}
// Unix doesn't support user overrides
partial void InitUserOverride(bool useUserOverride);
private static string? LCIDToLocaleName(int culture)
{

View file

@ -475,7 +475,7 @@ namespace System.Globalization
// If not found in the hard coded table we'll have to find a culture that works for us
if (!GlobalizationMode.Invariant && (retVal == null || retVal.IsNeutralCulture))
{
retVal = GlobalizationMode.UseNls ? NlsGetCultureDataFromRegionName(cultureName) : IcuGetCultureDataFromRegionName(cultureName);
retVal = GlobalizationMode.UseNls ? NlsGetCultureDataFromRegionName(cultureName) : IcuGetCultureDataFromRegionName();
}
// If we found one we can use, then cache it for next time

View file

@ -5223,10 +5223,12 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR,
return "\\u" + ((int)c).ToString("x4", CultureInfo.InvariantCulture);
}
#pragma warning disable IDE0060
private static void Trace(string s)
{
// Internal.Console.WriteLine(s);
//Internal.Console.WriteLine(s);
}
#pragma warning restore IDE0060
// for testing; do not make this readonly
private static bool s_tracingEnabled;

View file

@ -39,6 +39,7 @@ namespace System.IO
}
}
#pragma warning disable IDE0060
public static void Encrypt(string path)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption);
@ -48,6 +49,7 @@ namespace System.IO
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_FileEncryption);
}
#pragma warning restore IDE0060
private static void LinkOrCopyFile (string sourceFullPath, string destFullPath)
{
@ -106,8 +108,8 @@ namespace System.IO
}
}
public static void ReplaceFile(string sourceFullPath, string destFullPath, string? destBackupFullPath, bool ignoreMetadataErrors)
#pragma warning disable IDE0060
public static void ReplaceFile(string sourceFullPath, string destFullPath, string? destBackupFullPath, bool ignoreMetadataErrors /* unused */)
{
// Unix rename works in more cases, we limit to what is allowed by Windows File.Replace.
// These checks are not atomic, the file could change after a check was performed and before it is renamed.
@ -172,6 +174,7 @@ namespace System.IO
// Finally, rename the source to the destination, overwriting the destination.
Interop.CheckIo(Interop.Sys.Rename(sourceFullPath, destFullPath));
}
#pragma warning restore IDE0060
public static void MoveFile(string sourceFullPath, string destFullPath)
{
@ -597,7 +600,9 @@ namespace System.IO
return DriveInfoInternal.GetLogicalDrives();
}
#pragma warning disable IDE0060
internal static string? GetLinkTarget(ReadOnlySpan<char> linkPath, bool isDirectory) => Interop.Sys.ReadLink(linkPath);
#pragma warning restore IDE0060
internal static void CreateSymbolicLink(string path, string pathToTarget, bool isDirectory)
{
@ -610,7 +615,7 @@ namespace System.IO
ValueStringBuilder sb = new(Interop.DefaultPathBufferSize);
sb.Append(linkPath);
string? linkTarget = GetLinkTarget(linkPath, isDirectory: false /* Irrelevant in Unix */);
string? linkTarget = Interop.Sys.ReadLink(linkPath);
if (linkTarget == null)
{
sb.Dispose();
@ -643,7 +648,7 @@ namespace System.IO
}
GetLinkTargetFullPath(ref sb, current);
current = GetLinkTarget(sb.AsSpan(), isDirectory: false);
current = Interop.Sys.ReadLink(sb.AsSpan());
visitCount++;
}
}

View file

@ -8,8 +8,10 @@ namespace System.IO.Strategies
// this type defines a set of stateless FileStream/FileStreamStrategy helper methods
internal static partial class FileStreamHelpers
{
#pragma warning disable IDE0060
private static OSFileStreamStrategy ChooseStrategyCore(SafeFileHandle handle, FileAccess access, bool isAsync) =>
new UnixFileStreamStrategy(handle, access);
#pragma warning restore IDE0060
private static FileStreamStrategy ChooseStrategyCore(string path, FileMode mode, FileAccess access, FileShare share, FileOptions options, long preallocationSize) =>
new UnixFileStreamStrategy(path, mode, access, share, options, preallocationSize);
@ -28,7 +30,7 @@ namespace System.IO.Strategies
return result;
}
internal static long Seek(SafeFileHandle handle, long offset, SeekOrigin origin, bool closeInvalidHandle = false) =>
internal static long Seek(SafeFileHandle handle, long offset, SeekOrigin origin) =>
CheckFileCall(Interop.Sys.LSeek(handle, offset, (Interop.Sys.SeekWhence)(int)origin), handle.Path); // SeekOrigin values are the same as Interop.libc.SeekWhence values
internal static void ThrowInvalidArgument(SafeFileHandle handle) =>

View file

@ -32,7 +32,7 @@ namespace System.Resources
// For RuntimeResourceSet, ignore the Table parameter - it's a wasted
// allocation.
internal ResourceSet(bool junk)
internal ResourceSet(bool _)
{
}

View file

@ -116,11 +116,12 @@ namespace System.Runtime.CompilerServices
// The following intrinsics return true if input is a compile-time constant
// Feel free to add more overloads on demand
#pragma warning disable IDE0060
[Intrinsic]
internal static bool IsKnownConstant(string? t) => false;
[Intrinsic]
internal static bool IsKnownConstant(char t) => false;
#pragma warning restore IDE0060
}
}

View file

@ -162,6 +162,7 @@ namespace System.Runtime.InteropServices
throw new PlatformNotSupportedException(SR.PlatformNotSupported_ComInterop);
}
#pragma warning disable IDE0060
internal static Type? GetTypeFromCLSID(Guid clsid, string? server, bool throwOnError)
{
if (throwOnError)
@ -169,6 +170,7 @@ namespace System.Runtime.InteropServices
return null;
}
#pragma warning restore IDE0060
[SupportedOSPlatform("windows")]
public static string GetTypeInfoName(ITypeInfo typeInfo)

View file

@ -160,6 +160,7 @@ namespace System.Runtime.InteropServices
}
}
#pragma warning disable IDE0060
internal static Type? GetTypeFromProgID(string progID!!, string? server, bool throwOnError)
{
if (throwOnError)
@ -167,6 +168,7 @@ namespace System.Runtime.InteropServices
return null;
}
#pragma warning restore IDE0060
/// <summary>
/// Get the last system error on the current thread

View file

@ -619,6 +619,7 @@ namespace System.Runtime.InteropServices
}
#if !CORECLR
#pragma warning disable IDE0060
private static Exception? GetExceptionForHRInternal(int errorCode, IntPtr errorInfo)
{
switch (errorCode)
@ -848,6 +849,7 @@ namespace System.Runtime.InteropServices
return new COMException("", errorCode);
}
}
#pragma warning restore IDE0060
#endif
/// <summary>

View file

@ -15,7 +15,7 @@ namespace System.Runtime.Loader
private const string LibraryNameSuffix = ".so";
#endif
internal static IEnumerable<LibraryNameVariation> DetermineLibraryNameVariations(string libName, bool isRelativePath, bool forOSLoader = false)
internal static IEnumerable<LibraryNameVariation> DetermineLibraryNameVariations(string libName, bool isRelativePath)
{
// This is a copy of the logic in DetermineLibNameVariations in dllimport.cpp in CoreCLR

View file

@ -9,7 +9,7 @@ namespace System.Runtime.Loader
{
private const string LibraryNameSuffix = ".dll";
internal static IEnumerable<LibraryNameVariation> DetermineLibraryNameVariations(string libName, bool isRelativePath, bool forOSLoader = false)
internal static IEnumerable<LibraryNameVariation> DetermineLibraryNameVariations(string libName, bool isRelativePath)
{
// This is a copy of the logic in DetermineLibNameVariations in dllimport.cpp in CoreCLR
@ -17,7 +17,6 @@ namespace System.Runtime.Loader
// Follow LoadLibrary rules if forOSLoader is true
if (isRelativePath &&
(!forOSLoader || libName.Contains('.') && !libName.EndsWith('.')) &&
!libName.EndsWith(".dll", StringComparison.OrdinalIgnoreCase) &&
!libName.EndsWith(".exe", StringComparison.OrdinalIgnoreCase))
{

View file

@ -20,6 +20,7 @@ namespace System.Runtime
return false;
}
#pragma warning disable IDE0060
// Based on the shouldThrow parameter, this will throw an exception, or
// returns whether there is enough space. In all cases, we update
// our last known free address space, hopefully avoiding needing to
@ -35,5 +36,6 @@ namespace System.Runtime
{
// Unreachable until CheckForAvailableMemory is implemented
}
#pragma warning restore IDE0060
}
}

View file

@ -286,7 +286,7 @@ namespace System.Runtime
~MemoryFailPoint()
{
Dispose(false);
Disposing();
}
// Applications must call Dispose, which conceptually "releases" the
@ -298,11 +298,11 @@ namespace System.Runtime
// memory, apps will help their performance greatly by calling Dispose.
public void Dispose()
{
Dispose(true);
Disposing();
GC.SuppressFinalize(this);
}
private void Dispose(bool disposing)
private void Disposing()
{
// This is just bookkeeping to ensure multiple threads can really
// get enough memory, and this does not actually reserve memory

View file

@ -112,7 +112,7 @@ namespace System.Text
}
// non-validating ctor
private Rune(uint scalarValue, bool unused)
private Rune(uint scalarValue, bool _)
{
UnicodeDebug.AssertIsValidScalar(scalarValue);
_value = scalarValue;

View file

@ -19,10 +19,12 @@ namespace System.Threading
createdNew = true;
}
#pragma warning disable IDE0060
private static OpenExistingResult OpenExistingWorker(string name, out EventWaitHandle? result)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
}
#pragma warning restore IDE0060
public bool Reset()
{

View file

@ -21,10 +21,12 @@ namespace System.Threading
createdNew = true;
}
#pragma warning disable IDE0060
private static OpenExistingResult OpenExistingWorker(string name, out Semaphore? result)
{
throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives);
}
#pragma warning restore IDE0060
private int ReleaseCore(int releaseCount)
{

View file

@ -34,10 +34,14 @@ namespace System.Threading
// Threadpool specific initialization of a new thread. Used by OS-provided threadpools. No-op for portable threadpool.
internal static void InitializeForThreadPoolThread() { }
#pragma warning disable IDE0060
internal static bool CanSetMinIOCompletionThreads(int ioCompletionThreads) => true;
internal static void SetMinIOCompletionThreads(int ioCompletionThreads) { }
internal static bool CanSetMaxIOCompletionThreads(int ioCompletionThreads) => true;
#pragma warning restore IDE0060
[Conditional("unnecessary")]
internal static void SetMinIOCompletionThreads(int ioCompletionThreads) { }
[Conditional("unnecessary")]
internal static void SetMaxIOCompletionThreads(int ioCompletionThreads) { }
public static bool SetMaxThreads(int workerThreads, int completionPortThreads) =>
@ -92,7 +96,9 @@ namespace System.Threading
/// </summary>
/// <param name="cpuUtilization">CPU utilization as a percentage since the last call</param>
/// <returns>True if the runtime still needs to perform gate activities, false otherwise</returns>
#pragma warning disable IDE0060
internal static bool PerformRuntimeSpecificGateActivities(int cpuUtilization) => false;
#pragma warning restore IDE0060
internal static void NotifyWorkItemProgress() => PortableThreadPool.ThreadPoolInstance.NotifyWorkItemProgress();

View file

@ -23,9 +23,11 @@ namespace System.Threading
private bool _isScheduled;
private long _scheduledDueTimeMs;
#pragma warning disable IDE0060
private TimerQueue(int id)
{
}
#pragma warning restore IDE0060
private static List<TimerQueue> InitializeScheduledTimerManager_Locked()
{

View file

@ -59,11 +59,13 @@ namespace System
return standardDisplayName;
}
#pragma warning disable IDE0060
// Helper function to get the full display name for the UTC static time zone instance
private static string GetUtcFullDisplayName(string timeZoneId, string standardDisplayName)
{
return $"(UTC) {standardDisplayName}";
}
#pragma warning restore IDE0060
// Helper function that retrieves various forms of time zone display names from ICU
private static unsafe void GetDisplayName(string timeZoneId, Interop.Globalization.TimeZoneDisplayNameType nameType, string uiCulture, ref string? displayName)

View file

@ -54,14 +54,12 @@ namespace System
byte[] typeOfLocalTime;
TZifType[] transitionType;
string zoneAbbreviations;
bool[] StandardTime;
bool[] GmtTime;
string? futureTransitionsPosixFormat;
string? standardAbbrevName = null;
string? daylightAbbrevName = null;
// parse the raw TZif bytes; this method can throw ArgumentException when the data is malformed.
TZif_ParseRaw(data, out t, out dts, out typeOfLocalTime, out transitionType, out zoneAbbreviations, out StandardTime, out GmtTime, out futureTransitionsPosixFormat);
TZif_ParseRaw(data, out t, out dts, out typeOfLocalTime, out transitionType, out zoneAbbreviations, out futureTransitionsPosixFormat);
// find the best matching baseUtcOffset and display strings based on the current utcNow value.
// NOTE: read the Standard and Daylight display strings from the tzfile now in case they can't be loaded later
@ -118,7 +116,7 @@ namespace System
if (!dstDisabled)
{
// only create the adjustment rule if DST is enabled
TZif_GenerateAdjustmentRules(out _adjustmentRules, _baseUtcOffset, dts, typeOfLocalTime, transitionType, StandardTime, GmtTime, futureTransitionsPosixFormat);
TZif_GenerateAdjustmentRules(out _adjustmentRules, _baseUtcOffset, dts, typeOfLocalTime, transitionType, futureTransitionsPosixFormat);
}
ValidateTimeZoneInfo(_id, _baseUtcOffset, _adjustmentRules, out _supportsDaylightSavingTime);
@ -464,7 +462,7 @@ namespace System
//
//
private static void TZif_GenerateAdjustmentRules(out AdjustmentRule[]? rules, TimeSpan baseUtcOffset, DateTime[] dts, byte[] typeOfLocalTime,
TZifType[] transitionType, bool[] StandardTime, bool[] GmtTime, string? futureTransitionsPosixFormat)
TZifType[] transitionType, string? futureTransitionsPosixFormat)
{
rules = null;
@ -475,7 +473,7 @@ namespace System
while (index <= dts.Length)
{
TZif_GenerateAdjustmentRule(ref index, baseUtcOffset, rulesList, dts, typeOfLocalTime, transitionType, StandardTime, GmtTime, futureTransitionsPosixFormat);
TZif_GenerateAdjustmentRule(ref index, baseUtcOffset, rulesList, dts, typeOfLocalTime, transitionType, futureTransitionsPosixFormat);
}
rules = rulesList.ToArray();
@ -487,7 +485,7 @@ namespace System
}
private static void TZif_GenerateAdjustmentRule(ref int index, TimeSpan timeZoneBaseUtcOffset, List<AdjustmentRule> rulesList, DateTime[] dts,
byte[] typeOfLocalTime, TZifType[] transitionTypes, bool[] StandardTime, bool[] GmtTime, string? futureTransitionsPosixFormat)
byte[] typeOfLocalTime, TZifType[] transitionTypes, string? futureTransitionsPosixFormat)
{
// To generate AdjustmentRules, use the following approach:
// The first AdjustmentRule will go from DateTime.MinValue to the first transition time greater than DateTime.MinValue.
@ -1114,7 +1112,7 @@ namespace System
DateTimeOffset.FromUnixTimeSeconds(unixTime).UtcDateTime;
private static void TZif_ParseRaw(byte[] data, out TZifHead t, out DateTime[] dts, out byte[] typeOfLocalTime, out TZifType[] transitionType,
out string zoneAbbreviations, out bool[] StandardTime, out bool[] GmtTime, out string? futureTransitionsPosixFormat)
out string zoneAbbreviations, out string? futureTransitionsPosixFormat)
{
futureTransitionsPosixFormat = null;
@ -1140,8 +1138,6 @@ namespace System
dts = new DateTime[t.TimeCount];
typeOfLocalTime = new byte[t.TimeCount];
transitionType = new TZifType[t.TypeCount];
StandardTime = new bool[t.TypeCount];
GmtTime = new bool[t.TypeCount];
// read in the UTC transition points and convert them to Windows
//
@ -1191,10 +1187,7 @@ namespace System
// FALSE = transition time is wall clock time
// ABSENT = transition time is wall clock time
//
for (int i = 0; i < t.IsStdCount && i < t.TypeCount && index < data.Length; i++)
{
StandardTime[i] = (data[index++] != 0);
}
index += (int)Math.Min(t.IsStdCount, t.TypeCount);
// read in the GMT Time table. There should be a 1:1 mapping between Type-Index and GMT Time table
// entries.
@ -1203,10 +1196,7 @@ namespace System
// FALSE = transition time is local time
// ABSENT = transition time is local time
//
for (int i = 0; i < t.IsGmtCount && i < t.TypeCount && index < data.Length; i++)
{
GmtTime[i] = (data[index++] != 0);
}
index += (int)Math.Min(t.IsGmtCount, t.TypeCount);
if (t.Version != TZVersion.V1)
{

View file

@ -538,12 +538,12 @@ namespace System
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_ReadOnlyCollection);
}
internal void InternalArray__ICollection_Add<T>(T item)
internal void InternalArray__ICollection_Add<T>(T _)
{
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
}
internal bool InternalArray__ICollection_Remove<T>(T item)
internal bool InternalArray__ICollection_Remove<T>(T _)
{
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
return default;
@ -575,12 +575,12 @@ namespace System
return Length;
}
internal void InternalArray__Insert<T>(int index, T item)
internal void InternalArray__Insert<T>(int _, T _1)
{
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
}
internal void InternalArray__RemoveAt(int index)
internal void InternalArray__RemoveAt(int _)
{
ThrowHelper.ThrowNotSupportedException(ExceptionResource.NotSupported_FixedSizeCollection);
}

View file

@ -45,7 +45,9 @@ namespace System.Diagnostics
}
}
#pragma warning disable IDE0060
private static bool AppendStackFrameWithoutMethodBase(StringBuilder sb) => false;
#pragma warning restore IDE0060
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern bool get_frame_info(int skipFrames, bool needFileInfo,

View file

@ -5,9 +5,11 @@ namespace System.IO
{
public partial class FileLoadException
{
#pragma warning disable IDE0060
internal static string FormatFileLoadExceptionMessage(string? fileName, int hResult)
{
return "";
}
#pragma warning restore IDE0060
}
}

View file

@ -5,9 +5,11 @@ namespace System
{
public partial class MissingMemberException
{
#pragma warning disable IDE0060
internal static string FormatSignature(byte[] signature)
{
return "";
}
#pragma warning restore IDE0060
}
}

View file

@ -227,7 +227,7 @@ namespace System.Reflection.Emit
basic_init(this);
// Netcore only allows one module per assembly
manifest_module = new ModuleBuilder(this, "RefEmit_InMemoryManifestModule", false);
manifest_module = new ModuleBuilder(this, "RefEmit_InMemoryManifestModule");
modules = new ModuleBuilder[] { manifest_module };
}

View file

@ -78,7 +78,7 @@ namespace System.Reflection.Emit
type = tb;
this.paramModReq = paramModReq;
this.paramModOpt = paramModOpt;
table_idx = get_next_table_index(this, 0x06, 1);
table_idx = get_next_table_index(0x06, 1);
((ModuleBuilder)tb.Module).RegisterToken(this, MetadataToken);
}
@ -348,9 +348,9 @@ namespace System.Reflection.Emit
}
}
internal override int get_next_table_index(object obj, int table, int count)
internal override int get_next_table_index(int table, int count)
{
return type.get_next_table_index(obj, table, count);
return type.get_next_table_index(table, count);
}
private void RejectIfCreated()

View file

@ -62,12 +62,12 @@ namespace System.Reflection.Emit
attrs = eventAttrs;
type = eventType;
typeb = tb;
table_idx = get_next_table_index(this, 0x14, 1);
table_idx = get_next_table_index(0x14, 1);
}
internal int get_next_table_index(object obj, int table, int count)
internal int get_next_table_index(int table, int count)
{
return typeb.get_next_table_index(obj, table, count);
return typeb.get_next_table_index(table, count);
}
public void AddOtherMethod(MethodBuilder mdBuilder)

View file

@ -99,7 +99,7 @@ namespace System.Reflection.Emit
Array.Copy(parameterTypes, this.parameters, parameterTypes.Length);
}
type = tb;
table_idx = get_next_table_index(this, 0x06, 1);
table_idx = get_next_table_index(0x06, 1);
((ModuleBuilder)tb.Module).RegisterToken(this, MetadataToken);
}
@ -505,9 +505,9 @@ namespace System.Reflection.Emit
return name.GetHashCode();
}
internal override int get_next_table_index(object obj, int table, int count)
internal override int get_next_table_index(int table, int count)
{
return type.get_next_table_index(obj, table, count);
return type.get_next_table_index(table, count);
}
private static void ExtendArray<T>([NotNull] ref T[]? array, T elem)

View file

@ -87,13 +87,13 @@ namespace System.Reflection.Emit
private static extern void set_wrappers_type(ModuleBuilder mb, Type? ab);
[DynamicDependency(nameof(table_indexes))] // Automatically keeps all previous fields too due to StructLayout
internal ModuleBuilder(AssemblyBuilder assb, string name, bool emitSymbolInfo)
internal ModuleBuilder(AssemblyBuilder assb, string name)
{
this.name = this.scopename = name;
this.fqname = name;
this.assembly = this.assemblyb = assb;
guid = Guid.NewGuid().ToByteArray();
table_idx = get_next_table_index(this, 0x00, 1);
table_idx = get_next_table_index(0x00, 1);
name_cache = new Dictionary<ITypeName, TypeBuilder>();
us_string_cache = new Dictionary<string, int>(512);
@ -466,7 +466,7 @@ namespace System.Reflection.Emit
return result;
}
internal int get_next_table_index(object obj, int table, int count)
internal int get_next_table_index(int table, int count)
{
if (table_indexes == null)
{

View file

@ -64,7 +64,7 @@ namespace System.Reflection.Emit
if (mb is DynamicMethod)
table_idx = 0;
else
table_idx = mb.get_next_table_index(this, 0x08, 1);
table_idx = mb.get_next_table_index(0x08, 1);
}
public virtual int Attributes

View file

@ -77,7 +77,7 @@ namespace System.Reflection.Emit
Array.Copy(parameterTypes, this.parameters, this.parameters.Length);
}
typeb = tb;
table_idx = tb.get_next_table_index(this, 0x17, 1);
table_idx = tb.get_next_table_index(0x17, 1);
}
public override PropertyAttributes Attributes

View file

@ -145,7 +145,7 @@ namespace System.Reflection.Emit
this.parent = typeof(object);
// skip .<Module> ?
table_idx = mb.get_next_table_index(this, 0x02, 1);
table_idx = mb.get_next_table_index(0x02, 1);
this.fullname = GetFullName();
}
@ -1641,9 +1641,9 @@ namespace System.Reflection.Emit
this.parent = ResolveUserType(this.parent);
}
internal int get_next_table_index(object obj, int table, int count)
internal int get_next_table_index(int table, int count)
{
return pmodule.get_next_table_index(obj, table, count);
return pmodule.get_next_table_index(table, count);
}
[ComVisible(true)]

View file

@ -70,7 +70,7 @@ namespace System.Reflection
return parameterTypes;
}
internal virtual int get_next_table_index(object obj, int table, int count)
internal virtual int get_next_table_index(int table, int count)
{
throw new NotImplementedException();
}

View file

@ -180,7 +180,7 @@ namespace System.Reflection
StringBuilder sbName = new StringBuilder(Name);
if (IsGenericMethod)
sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this, TypeNameFormatFlags.FormatBasic));
sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this));
sbName.Append('(');
RuntimeParameterInfo.FormatParameters(sbName, GetParametersNoCopy(), CallingConvention);
@ -211,7 +211,7 @@ namespace System.Reflection
sbName.Append(Name);
if (IsGenericMethod)
sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this, TypeNameFormatFlags.FormatBasic));
sbName.Append(RuntimeMethodHandle.ConstructInstantiation(this));
sbName.Append('(');
AppendParameters(ref sbName, GetParameterTypes(), CallingConvention);

View file

@ -352,7 +352,7 @@ namespace System.Reflection
return getter((T)obj!);
}
private static object? StaticGetterAdapterFrame<R>(StaticGetter<R> getter, object? obj)
private static object? StaticGetterAdapterFrame<R>(StaticGetter<R> getter, object? _)
{
return getter();
}

View file

@ -5,10 +5,12 @@ namespace System.Runtime.CompilerServices
{
internal static class JitHelpers
{
#pragma warning disable IDE0060
[Intrinsic]
public static bool EnumEquals<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
[Intrinsic]
public static int EnumCompareTo<T>(T x, T y) where T : struct, Enum => throw new NotImplementedException();
#pragma warning restore IDE0060
}
}

View file

@ -9,6 +9,7 @@ namespace System.Runtime.InteropServices.ObjectiveC
{
public static partial class ObjectiveCMarshal
{
#pragma warning disable IDE0060 // Remove when implemented
/// <summary>
/// Sets a pending exception to be thrown the next time the runtime is entered from an Objective-C msgSend P/Invoke.
/// </summary>

View file

@ -36,6 +36,7 @@ namespace System.Runtime.Loader
[RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
[System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
#pragma warning disable IDE0060
private Assembly InternalLoadFromPath(string? assemblyPath, string? nativeImagePath)
{
StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;
@ -44,6 +45,7 @@ namespace System.Runtime.Loader
// TODO: Handle nativeImagePath
return InternalLoadFile(NativeALC, assemblyPath, ref stackMark);
}
#pragma warning restore IDE0060
[RequiresUnreferencedCode("Types and members the loaded assembly depends on might be removed")]
internal Assembly InternalLoad(byte[] arrAssembly, byte[]? arrSymbols)

View file

@ -71,7 +71,7 @@ namespace System
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void SetValueInternal(FieldInfo fi, object? obj, object? value);
internal static void SetValue(RuntimeFieldInfo field, object? obj, object? value, RuntimeType? fieldType, FieldAttributes fieldAttr, RuntimeType? declaringType, ref bool domainInitialized)
internal static void SetValue(RuntimeFieldInfo field, object? obj, object? value, RuntimeType? _, FieldAttributes _1, RuntimeType? _2, ref bool _3)
{
SetValueInternal(field, obj, value);
}

View file

@ -66,7 +66,7 @@ namespace System
return !left.Equals(right);
}
internal static string ConstructInstantiation(RuntimeMethodInfo method, TypeNameFormatFlags format)
internal static string ConstructInstantiation(RuntimeMethodInfo method)
{
var sb = new StringBuilder();
Type[]? gen_params = method.GetGenericArguments();

View file

@ -151,7 +151,7 @@ namespace System
throw new ArgumentNullException(nameof(typeName));
return RuntimeTypeHandle.GetTypeByName(
typeName, throwOnError, ignoreCase, ref stackMark, false);
typeName, throwOnError, ignoreCase, ref stackMark);
}
private static void SplitName(string? fullname, out string? name, out string? ns)
@ -833,7 +833,7 @@ namespace System
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types, modifiers) as ConstructorInfo;
return System.DefaultBinder.ExactBinding(candidates.ToArray(), types) as ConstructorInfo;
if (binder == null)
binder = DefaultBinder;
@ -873,7 +873,7 @@ namespace System
}
if ((bindingAttr & BindingFlags.ExactBinding) != 0)
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types, modifiers);
return System.DefaultBinder.ExactPropertyBinding(candidates.ToArray(), returnType, types);
if (binder == null)
binder = DefaultBinder;

View file

@ -231,16 +231,13 @@ namespace System
return isGenericCOM ? false : IsComObject(new QCallTypeHandle(ref type));
}
internal static bool IsContextful(RuntimeType type)
{
return false;
}
#pragma warning disable IDE0060
internal static bool IsEquivalentTo(RuntimeType rtType1, RuntimeType rtType2)
{
// refence check is done earlier and we don't recognize anything else
return false;
}
#pragma warning restore IDE0060
internal static bool IsInterface(RuntimeType type)
{
@ -364,8 +361,7 @@ namespace System
private static extern void internal_from_name(IntPtr name, ref StackCrawlMark stackMark, ObjectHandleOnStack res, bool throwOnError, bool ignoreCase);
[RequiresUnreferencedCode("Types might be removed")]
internal static RuntimeType? GetTypeByName(string typeName, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark,
bool loadTypeFromPartialName)
internal static RuntimeType? GetTypeByName(string typeName, bool throwOnError, bool ignoreCase, ref StackCrawlMark stackMark)
{
if (typeName == null)
throw new ArgumentNullException(nameof(typeName));

View file

@ -12,10 +12,12 @@ namespace System.Threading
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern IntPtr InitInternal();
#pragma warning disable IDE0060
private void Create(int maximumSignalCount)
{
lifo_semaphore = InitInternal();
}
#pragma warning restore IDE0060
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private static extern void DeleteInternal(IntPtr semaphore);

View file

@ -10,6 +10,5 @@ namespace System.Threading
[CLSCompliantAttribute(false)]
public static PreAllocatedOverlapped UnsafeCreate(IOCompletionCallback callback, object? state, object? pinData) => new PreAllocatedOverlapped(callback, state, pinData);
public void Dispose() { }
internal bool IsUserObject(byte[]? buffer) => false;
}
}

View file

@ -3,11 +3,13 @@
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Diagnostics;
namespace System.Threading
{
public static partial class ThreadPool
{
[Conditional("unnecessary")]
internal static void ReportThreadStatus(bool isWorking)
{
}

View file

@ -417,7 +417,7 @@ namespace Microsoft.NET.Build.Tasks
}
// save these most expensive checks for last. We don't want to scan all references for IL code
if (ReferencesWinMD(mdReader) || !HasILCode(pereader, mdReader))
if (ReferencesWinMD(mdReader) || !HasILCode(mdReader))
{
// Forwarder assemblies are not separately compiled via R2R, but when performing composite compilation, they are included in the bundle
if (excludeFromComposite || !compositeCompile)
@ -488,7 +488,7 @@ namespace Microsoft.NET.Build.Tasks
return false;
}
private static bool HasILCode(PEReader peReader, MetadataReader mdReader)
private static bool HasILCode(MetadataReader mdReader)
{
foreach (var methoddefHandle in mdReader.MethodDefinitions)
{