Skip to content

Commit

Permalink
Update HResults.cs and NullableAttributes.cs from upstream source
Browse files Browse the repository at this point in the history
  • Loading branch information
skrysmanski committed Sep 21, 2024
1 parent 19b2f0f commit 471b740
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
21 changes: 20 additions & 1 deletion src/AppMotor.Core/Logging/HResult/HResults.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Source: https://github.com/dotnet/runtime/blob/master/src/libraries/Common/src/System/HResults.cs
// Source: https://github.com/dotnet/runtime/blob/main/src/libraries/Common/src/System/HResults.cs

// ReSharper disable All
#pragma warning disable IDE0004 // Remove Unnecessary Cast
Expand Down Expand Up @@ -59,6 +59,7 @@ internal static partial class HResults
internal const int COR_E_ENTRYPOINTNOTFOUND = unchecked((int)0x80131523);
internal const int COR_E_EXCEPTION = unchecked((int)0x80131500);
internal const int COR_E_EXECUTIONENGINE = unchecked((int)0x80131506);
internal const int COR_E_FAILFAST = unchecked((int)0x80131623);
internal const int COR_E_FIELDACCESS = unchecked((int)0x80131507);
internal const int COR_E_FILELOAD = unchecked((int)0x80131621);
internal const int COR_E_FILENOTFOUND = unchecked((int)0x80070002);
Expand Down Expand Up @@ -117,7 +118,11 @@ internal static partial class HResults
internal const int COR_E_VERIFICATION = unchecked((int)0x8013150D);
internal const int COR_E_WAITHANDLECANNOTBEOPENED = unchecked((int)0x8013152C);
internal const int CO_E_NOTINITIALIZED = unchecked((int)0x800401F0);
internal const int DISP_E_PARAMNOTFOUND = unchecked((int)0x80020004);
internal const int DISP_E_TYPEMISMATCH = unchecked((int)0x80020005);
internal const int DISP_E_BADVARTYPE = unchecked((int)0x80020008);
internal const int DISP_E_OVERFLOW = unchecked((int)0x8002000A);
internal const int DISP_E_DIVBYZERO = unchecked((int)0x80020012);
internal const int E_BOUNDS = unchecked((int)0x8000000B);
internal const int E_CHANGED_STATE = unchecked((int)0x8000000C);
internal const int E_FILENOTFOUND = unchecked((int)0x80070002);
Expand All @@ -131,5 +136,19 @@ internal static partial class HResults
internal const int RO_E_CLOSED = unchecked((int)0x80000013);
internal const int RPC_E_CHANGED_MODE = unchecked((int)0x80010106);
internal const int TYPE_E_TYPEMISMATCH = unchecked((int)0x80028CA0);
internal const int STG_E_PATHNOTFOUND = unchecked((int)0x80030003);
internal const int CTL_E_PATHNOTFOUND = unchecked((int)0x800A004C);
internal const int CTL_E_FILENOTFOUND = unchecked((int)0x800A0035);
internal const int FUSION_E_INVALID_NAME = unchecked((int)0x80131047);
internal const int FUSION_E_REF_DEF_MISMATCH = unchecked((int)0x80131040);
internal const int ERROR_TOO_MANY_OPEN_FILES = unchecked((int)0x80070004);
internal const int ERROR_SHARING_VIOLATION = unchecked((int)0x80070020);
internal const int ERROR_LOCK_VIOLATION = unchecked((int)0x80070021);
internal const int ERROR_OPEN_FAILED = unchecked((int)0x8007006E);
internal const int ERROR_DISK_CORRUPT = unchecked((int)0x80070571);
internal const int ERROR_UNRECOGNIZED_VOLUME = unchecked((int)0x800703ED);
internal const int ERROR_DLL_INIT_FAILED = unchecked((int)0x8007045A);
internal const int MSEE_E_ASSEMBLYLOADINPROGRESS = unchecked((int)0x80131016);
internal const int ERROR_FILE_INVALID = unchecked((int)0x800703EE);
}
}
15 changes: 8 additions & 7 deletions src/AppMotor.NetStandardCompat/NullableAttributes.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Source: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Private.CoreLib/src/System/Diagnostics/CodeAnalysis/NullableAttributes.cs

// ReSharper disable All
#pragma warning disable IDE0009 // Member access should be qualified.
#pragma warning disable IDE0021 // Use block body for constructor
#pragma warning disable IDE0161 // Convert to file-scoped namespace
#pragma warning disable IDE0300 // Simplify collection initialization

//=============================================================================


// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
Expand Down Expand Up @@ -147,8 +150,7 @@ sealed class MemberNotNullAttribute : Attribute
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments", Justification = "Not our code")]
public MemberNotNullAttribute(string member) => Members = new[] { member };
public MemberNotNullAttribute(string member) => Members = [member];

/// <summary>Initializes the attribute with the list of field and property members.</summary>
/// <param name="members">
Expand All @@ -171,21 +173,20 @@ sealed class MemberNotNullWhenAttribute : Attribute
{
/// <summary>Initializes the attribute with the specified return value condition and a field or property member.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// The return value condition. If the method returns this value, the associated field or property member will not be null.
/// </param>
/// <param name="member">
/// The field or property member that is promised to be not-null.
/// </param>
[SuppressMessage("Design", "CA1019:Define accessors for attribute arguments", Justification = "Not our code")]
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new[] { member };
Members = [member];
}

/// <summary>Initializes the attribute with the specified return value condition and list of field and property members.</summary>
/// <param name="returnValue">
/// The return value condition. If the method returns this value, the associated parameter will not be null.
/// The return value condition. If the method returns this value, the associated field and property members will not be null.
/// </param>
/// <param name="members">
/// The list of field and property members that are promised to be not-null.
Expand Down

0 comments on commit 471b740

Please sign in to comment.