未验证 提交 241f0c75 编写于 作者: S Stephen Toub 提交者: GitHub

Remove some NoWarns from CoreLib (#183)

上级 9cfe4f87
......@@ -52,7 +52,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<NoWarn>$(NoWarn),0419,0649,1573,1591,3021,CA2002</NoWarn>
<NoWarn>$(NoWarn),0419,0649</NoWarn>
<Nullable>enable</Nullable>
<!-- Ignore all previous constants since SPCL is sensitive to what is defined and the Sdk adds some by default -->
......
......@@ -18,6 +18,10 @@ internal sealed partial class NativeRuntimeEventSource : EventSource
/// Dispatch a single event with the specified event ID and payload.
/// </summary>
/// <param name="eventID">The eventID corresponding to the event as defined in the auto-generated portion of the NativeRuntimeEventSource class.</param>
/// <param name="osThreadID">The thread ID of the operating system thread.</param>
/// <param name="timeStamp">The current timestamp.</param>
/// <param name="activityId">The ID of the current activity.</param>
/// <param name="childActivityId">The ID of the current child activity.</param>
/// <param name="payload">A span pointing to the data payload for the event.</param>
[NonEvent]
internal unsafe void ProcessEvent(uint eventID, uint osThreadID, DateTime timeStamp, Guid activityId, Guid childActivityId, ReadOnlySpan<byte> payload)
......
......@@ -23,7 +23,6 @@ internal static bool InternalExists(string fullPath)
/// Returns 0 on success, otherwise a Win32 error code. Note that
/// classes should use -1 as the uninitialized state for dataInitialized.
/// </summary>
/// <param name="returnErrorOnNotFound">Return the error code for not found errors?</param>
internal static int FillAttributeInfo(string path, ref Interop.Kernel32.WIN32_FILE_ATTRIBUTE_DATA data, bool returnErrorOnNotFound)
{
int errorCode = Interop.Errors.ERROR_SUCCESS;
......
......@@ -874,6 +874,8 @@ private static bool Add32To96(ref Buf12 bufNum, uint value)
/// Adds or subtracts two decimal values.
/// On return, d1 contains the result of the operation and d2 is trashed.
/// </summary>
/// <param name="d1">First decimal to add or subtract.</param>
/// <param name="d2">Second decimal to add or subtract.</param>
/// <param name="sign">True means subtract and false means add.</param>
internal static unsafe void DecAddSub(ref DecCalc d1, ref DecCalc d2, bool sign)
{
......
......@@ -930,6 +930,9 @@ private static void SetLastError(WriteEventErrorCode error)
/// <param name="eventDescriptor">
/// Event Descriptor for this event.
/// </param>
/// <param name="eventHandle">
/// Event handle for this event.
/// </param>
/// <param name="activityID">
/// A pointer to the activity ID GUID to log
/// </param>
......@@ -1132,6 +1135,9 @@ internal unsafe bool WriteEvent(ref EventDescriptor eventDescriptor, IntPtr even
/// <param name="eventDescriptor">
/// Event Descriptor for this event.
/// </param>
/// <param name="eventHandle">
/// Event handle for this event.
/// </param>
/// <param name="activityID">
/// A pointer to the activity ID to log
/// </param>
......
......@@ -29,6 +29,7 @@ public partial class IncrementingPollingCounter : DiagnosticCounter
/// </summary>
/// <param name="name">The name.</param>
/// <param name="eventSource">The event source.</param>
/// <param name="totalValueProvider">The delegate to invoke to get the total value for this counter.</param>
public IncrementingPollingCounter(string name, EventSource eventSource, Func<double> totalValueProvider) : base(name, eventSource)
{
if (totalValueProvider == null)
......
......@@ -27,6 +27,7 @@ public partial class PollingCounter : DiagnosticCounter
/// </summary>
/// <param name="name">The name.</param>
/// <param name="eventSource">The event source.</param>
/// <param name="metricProvider">The delegate to invoke to get the current metric value.</param>
public PollingCounter(string name, EventSource eventSource, Func<double> metricProvider) : base(name, eventSource)
{
if (metricProvider == null)
......
......@@ -66,6 +66,7 @@ private SafeFileHandle OpenHandle(FileMode mode, FileShare share, FileOptions op
/// <summary>Initializes a stream for reading or writing a Unix file.</summary>
/// <param name="mode">How the file should be opened.</param>
/// <param name="share">What other access to the file should be allowed. This is currently ignored.</param>
/// <param name="originalPath">The original path specified for the FileStream.</param>
private void Init(FileMode mode, FileShare share, string originalPath)
{
_fileHandle.IsAsync = _useAsyncIO;
......@@ -802,6 +803,7 @@ public override long Seek(long offset, SeekOrigin origin)
}
/// <summary>Sets the current position of this stream to the given value.</summary>
/// <param name="fileHandle">The file handle on which to seek.</param>
/// <param name="offset">The point relative to origin from which to begin seeking. </param>
/// <param name="origin">
/// Specifies the beginning, the end, or the current position as a reference
......
......@@ -567,6 +567,7 @@ public virtual Task WriteAsync(string? value)
/// StringBuilder.GetChunks() method to avoid creating the intermediate string
/// </summary>
/// <param name="value">The string (as a StringBuilder) to write to the stream</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
public virtual Task WriteAsync(StringBuilder? value, CancellationToken cancellationToken = default)
{
return
......@@ -641,6 +642,7 @@ public virtual Task WriteLineAsync(string? value)
/// StringBuilder.GetChunks() method to avoid creating the intermediate string
/// </summary>
/// <param name="value">The string (as a StringBuilder) to write to the stream</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
public virtual Task WriteLineAsync(StringBuilder? value, CancellationToken cancellationToken = default)
{
return
......
......@@ -151,6 +151,7 @@ public struct AsyncTaskMethodBuilder<TResult>
/// <summary>Gets the "boxed" state machine object.</summary>
/// <typeparam name="TStateMachine">Specifies the type of the async state machine.</typeparam>
/// <param name="stateMachine">The state machine.</param>
/// <param name="taskField">The reference to the Task field storing the Task instance.</param>
/// <returns>The "boxed" state machine.</returns>
private static IAsyncStateMachineBox GetStateMachineBox<TStateMachine>(
ref TStateMachine stateMachine,
......@@ -427,16 +428,17 @@ public void SetResult(TResult result)
/// <summary>Completes the already initialized task with the specified result.</summary>
/// <param name="result">The result to use to complete the task.</param>
internal static void SetExistingTaskResult(Task<TResult> taskField, [AllowNull] TResult result)
/// <param name="task">The task to complete.</param>
internal static void SetExistingTaskResult(Task<TResult> task, [AllowNull] TResult result)
{
Debug.Assert(taskField != null, "Expected non-null task");
Debug.Assert(task != null, "Expected non-null task");
if (AsyncCausalityTracer.LoggingOn)
{
AsyncCausalityTracer.TraceOperationCompletion(taskField, AsyncCausalityStatus.Completed);
AsyncCausalityTracer.TraceOperationCompletion(task, AsyncCausalityStatus.Completed);
}
if (!taskField.TrySetResult(result))
if (!task.TrySetResult(result))
{
ThrowHelper.ThrowInvalidOperationException(ExceptionResource.TaskT_TransitionToFinal_AlreadyCompleted);
}
......
......@@ -262,6 +262,7 @@ public CancellationToken(bool canceled) : this(canceled ? CancellationTokenSourc
/// <param name="useSynchronizationContext">A Boolean value that indicates whether to capture
/// the current <see cref="System.Threading.SynchronizationContext">SynchronizationContext</see> and use it
/// when invoking the <paramref name="callback"/>.</param>
/// <param name="useExecutionContext">true to capture the current ExecutionContext; otherwise, false.</param>
/// <returns>The <see cref="System.Threading.CancellationTokenRegistration"/> instance that can
/// be used to unregister the callback.</returns>
/// <exception cref="System.ArgumentNullException"><paramref name="callback"/> is null.</exception>
......
......@@ -4229,6 +4229,7 @@ public Task<TResult> ContinueWith<TResult>(Func<Task, object?, TResult> continua
/// <param name="continuationTask">The continuation task itself.</param>
/// <param name="scheduler">TaskScheduler with which to associate continuation task.</param>
/// <param name="options">Restrictions on when the continuation becomes active.</param>
/// <param name="cancellationToken">The token to monitor for cancellation requests.</param>
internal void ContinueWithCore(Task continuationTask,
TaskScheduler scheduler,
CancellationToken cancellationToken,
......
......@@ -194,6 +194,7 @@ public static class Keywords // this name is important for EventSource
/// <param name="TaskID">The task ID.</param>
/// <param name="CreatingTaskID">The task ID</param>
/// <param name="TaskCreationOptions">The options used to create the task.</param>
/// <param name="appDomain">The ID for the current AppDomain.</param>
[Event(TASKSCHEDULED_ID, Task = Tasks.TaskScheduled, Version = 1, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void TaskScheduled(
......@@ -392,11 +393,12 @@ public void TaskWaitContinuationStarted(int TaskID)
/// </summary>
/// <param name="OriginatingTaskSchedulerID">The scheduler ID.</param>
/// <param name="OriginatingTaskID">The task ID.</param>
/// <param name="ContinueWithTaskId">The ID of the continuation object.</param>
[Event(AWAITTASKCONTINUATIONSCHEDULED_ID, Task = Tasks.AwaitTaskContinuationScheduled, Opcode = EventOpcode.Send,
Level = EventLevel.Informational, Keywords = Keywords.TaskTransfer | Keywords.Tasks)]
public void AwaitTaskContinuationScheduled(
int OriginatingTaskSchedulerID, int OriginatingTaskID, // PFX_COMMON_EVENT_HEADER
int ContinuwWithTaskId)
int ContinueWithTaskId)
{
if (IsEnabled() && IsEnabled(EventLevel.Informational, Keywords.TaskTransfer | Keywords.Tasks))
{
......@@ -410,11 +412,11 @@ public void TaskWaitContinuationStarted(int TaskID)
eventPayload[1].DataPointer = ((IntPtr)(&OriginatingTaskID));
eventPayload[1].Reserved = 0;
eventPayload[2].Size = sizeof(int);
eventPayload[2].DataPointer = ((IntPtr)(&ContinuwWithTaskId));
eventPayload[2].DataPointer = ((IntPtr)(&ContinueWithTaskId));
eventPayload[2].Reserved = 0;
if (TasksSetActivityIds)
{
Guid continuationActivityId = CreateGuidForTaskID(ContinuwWithTaskId);
Guid continuationActivityId = CreateGuidForTaskID(ContinueWithTaskId);
WriteEventWithRelatedActivityIdCore(AWAITTASKCONTINUATIONSCHEDULED_ID, &continuationActivityId, 3, eventPayload);
}
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册