summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnirudh Agnihotry <anirudhagnihotry098@gmail.com>2019-04-11 18:06:24 -0700
committerStephen Toub <stoub@microsoft.com>2019-04-11 21:06:24 -0400
commit9eace659c245d85917e09ad6861d11205ac082f3 (patch)
treeb3238aab1f7fa0d47323deb6cfcefb94ac13dad2
parenta648c2dc510ddd4ba3eb0cdff36750add83b6c1d (diff)
downloadcoreclr-9eace659c245d85917e09ad6861d11205ac082f3.tar.gz
coreclr-9eace659c245d85917e09ad6861d11205ac082f3.tar.bz2
coreclr-9eace659c245d85917e09ad6861d11205ac082f3.zip
Nullable System.Diagnostics.Store (#23874)
* removing using systems and adding nullability for System.Diagnostics.SymbolStore * annotating the class that implements the internal interface * adding bang to fix failure * correcting the byte array declarations
-rw-r--r--src/System.Private.CoreLib/shared/System/Diagnostics/SymbolStore/ISymbolDocumentWriter.cs1
-rw-r--r--src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/ISymWriter.cs6
-rw-r--r--src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs3
-rw-r--r--src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/Token.cs6
-rw-r--r--src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs25
5 files changed, 19 insertions, 22 deletions
diff --git a/src/System.Private.CoreLib/shared/System/Diagnostics/SymbolStore/ISymbolDocumentWriter.cs b/src/System.Private.CoreLib/shared/System/Diagnostics/SymbolStore/ISymbolDocumentWriter.cs
index 4980ed76f6..1db401fcc1 100644
--- a/src/System.Private.CoreLib/shared/System/Diagnostics/SymbolStore/ISymbolDocumentWriter.cs
+++ b/src/System.Private.CoreLib/shared/System/Diagnostics/SymbolStore/ISymbolDocumentWriter.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
namespace System.Diagnostics.SymbolStore
{
public interface ISymbolDocumentWriter
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/ISymWriter.cs b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
index 31f81e1bed..e8148203d6 100644
--- a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
+++ b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/ISymWriter.cs
@@ -12,11 +12,9 @@
**
===========================================================*/
-using System;
-using System.Text;
+#nullable enable
using System.Reflection;
using System.Runtime.InteropServices;
-using System.Runtime.Versioning;
namespace System.Diagnostics.SymbolStore
{
@@ -26,7 +24,7 @@ namespace System.Diagnostics.SymbolStore
// Define a source document. Guid's will be provided for the
// languages, vendors, and document types that we currently know
// about.
- ISymbolDocumentWriter DefineDocument(string url,
+ ISymbolDocumentWriter? DefineDocument(string url,
Guid language,
Guid languageVendor,
Guid documentType);
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
index 15b3c7f4f7..9005156ce6 100644
--- a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
+++ b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/SymAddressKind.cs
@@ -13,8 +13,7 @@
===========================================================*/
// Only statics, does not need to be marked with the serializable attribute
-using System;
-
+#nullable enable
namespace System.Diagnostics.SymbolStore
{
internal enum SymAddressKind
diff --git a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/Token.cs b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/Token.cs
index 238e3a524d..52eb1bf351 100644
--- a/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/Token.cs
+++ b/src/System.Private.CoreLib/src/System/Diagnostics/SymbolStore/Token.cs
@@ -10,9 +10,7 @@
**
===========================================================*/
-using System;
-using System.Runtime.InteropServices;
-
+#nullable enable
namespace System.Diagnostics.SymbolStore
{
internal struct SymbolToken
@@ -25,7 +23,7 @@ namespace System.Diagnostics.SymbolStore
public override int GetHashCode() { return m_token; }
- public override bool Equals(object obj)
+ public override bool Equals(object? obj)
{
if (obj is SymbolToken)
return Equals((SymbolToken)obj);
diff --git a/src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs b/src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs
index 0301329185..41ca6778e4 100644
--- a/src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs
+++ b/src/System.Private.CoreLib/src/System/Reflection/Emit/ISymWrapperCore.cs
@@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+#nullable enable
using System;
using System.Security;
using System.Runtime.InteropServices;
@@ -90,7 +91,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.SetCheckSum(m_pDocWriter, algorithmId, (uint)checkSum.Length, checkSum);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -165,7 +166,7 @@ namespace System.Reflection.Emit
//------------------------------------------------------------------------------
// DefineDocument() wrapper
//------------------------------------------------------------------------------
- ISymbolDocumentWriter ISymbolWriter.DefineDocument(string url,
+ ISymbolDocumentWriter? ISymbolWriter.DefineDocument(string url,
Guid language,
Guid languageVendor,
Guid documentType)
@@ -175,7 +176,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.DefineDocument(m_pWriter, url, ref language, ref languageVendor, ref documentType, out psymUnmanagedDocumentWriter);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
if (psymUnmanagedDocumentWriter.IsInvalid)
{
@@ -192,7 +193,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.OpenMethod(m_pWriter, method.GetToken());
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -204,7 +205,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.CloseMethod(m_pWriter);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -259,10 +260,10 @@ namespace System.Reflection.Emit
// Regardless, this cast is important for security - we cannot allow our caller to provide
// arbitrary instances of this interface.
SymDocumentWriter docwriter = (SymDocumentWriter)document;
- int hr = m_vtable.DefineSequencePoints(m_pWriter, docwriter.GetUnmanaged(), spCount, offsets, lines, columns, endLines, endColumns);
+ int hr = m_vtable.DefineSequencePoints(m_pWriter, docwriter.GetUnmanaged(), spCount!, offsets!, lines!, columns!, endLines!, endColumns!);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -275,7 +276,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.OpenScope(m_pWriter, startOffset, out ret);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
return ret;
}
@@ -288,7 +289,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.CloseScope(m_pWriter, endOffset);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -318,7 +319,7 @@ namespace System.Reflection.Emit
endOffset);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -330,7 +331,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.SetSymAttribute(m_pWriter, parent.GetToken(), name, data.Length, data);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}
@@ -342,7 +343,7 @@ namespace System.Reflection.Emit
int hr = m_vtable.UsingNamespace(m_pWriter, name);
if (hr < 0)
{
- throw Marshal.GetExceptionForHR(hr);
+ throw Marshal.GetExceptionForHR(hr)!;
}
}