Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
alnlarsen committed Apr 19, 2024
1 parent 22a4578 commit 4a8c10b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 14 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/ci.yml
Expand Up @@ -178,7 +178,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: Build
run: dotnet publish -c Release OpenTAP.sln
- name: Copy Debug Package
Expand All @@ -205,6 +205,10 @@ jobs:
- name: Fix tags
if: startsWith(github.ref, 'refs/tags/v')
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }} # Fixes an issue with actions/checkout@v4. See https://github.com/actions/checkout/issues/290
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Nuget Cache
uses: actions/cache@v4
id: cache
Expand Down Expand Up @@ -256,7 +260,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: Build
run: dotnet publish -c Release OpenTAP.sln
- name: Copy Debug Package
Expand Down Expand Up @@ -371,7 +375,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: Download binaries
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -401,7 +405,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: Download binaries
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -568,7 +572,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
dotnet-version: '8.0.x'
- name: Update Version
run: |
Set-Content .\templates\Templates.csproj (Get-Content .\templates\Templates.csproj).Replace("`$(GitVersion)", "${{needs.GetVersion.outputs.LongVersion}}")
Expand Down
3 changes: 3 additions & 0 deletions Engine/IPictureDataProvider.cs
Expand Up @@ -4,6 +4,7 @@
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Threading.Tasks;

namespace OpenTap
Expand Down Expand Up @@ -64,7 +65,9 @@ public async Task<Stream> GetStream(IPicture picture)
var source = normalizeSource(picture.Source);
if (Uri.TryCreate(source, UriKind.Absolute, out var uri))
{
#pragma warning disable SYSLIB0014
var req = WebRequest.Create(uri);
#pragma warning restore SYSLIB0014
var response = await req.GetResponseAsync();
return response.GetResponseStream();
}
Expand Down
2 changes: 1 addition & 1 deletion Engine/ParameterCollection.cs
Expand Up @@ -22,6 +22,6 @@ public ParameterCollection(IParameter[] list) : base(list)

}

internal static readonly ParameterCollection Empty = new ParameterCollection(Array.Empty<IParameter>());
internal new static readonly ParameterCollection Empty = new ParameterCollection(Array.Empty<IParameter>());
}
}
5 changes: 1 addition & 4 deletions Engine/PluginManager.cs
Expand Up @@ -594,10 +594,7 @@ Assembly loadFrom(string loadFilename)
{
try
{
if (!reflectionOnly)
return Assembly.LoadFrom(loadFilename);
else
return Assembly.ReflectionOnlyLoadFrom(loadFilename);
return Assembly.LoadFrom(loadFilename);
}
catch(Exception ex)
{
Expand Down
1 change: 0 additions & 1 deletion Engine/ScpiInstrument.cs
Expand Up @@ -77,7 +77,6 @@ private static void RaiseError2(int error)
throw new VISAException(0, error);
}

[System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions] // Required by .NET to catch AccessViolationException.
internal static int GetResourceManager()
{
try
Expand Down
1 change: 0 additions & 1 deletion Engine/VisaDeviceDiscovery.cs
Expand Up @@ -139,7 +139,6 @@ public bool CanDetect(DeviceAddressAttribute DeviceAddress)
static bool visa_tried_load;


[System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions] // Required by .NET to catch AccessViolationException.
internal static int GetResourceManager()
{
try
Expand Down
1 change: 0 additions & 1 deletion Engine/VisaLibraryLoader.cs
Expand Up @@ -92,7 +92,6 @@ static T GetSymbol<T>(IntPtr s)
return Marshal.GetDelegateForFunctionPointer<T>(s);
}
static TraceSource staticLog = OpenTap.Log.CreateSource("VisaLibraryLoader");
[System.Runtime.ExceptionServices.HandleProcessCorruptedStateExceptions] // Required by .NET to catch AccessViolationException.
private void Load()
{
try
Expand Down
3 changes: 2 additions & 1 deletion Shared/SubProcessHost.cs
Expand Up @@ -6,6 +6,7 @@
using System.IO.Pipes;
using System.Linq;
using System.Reflection;
using System.Runtime.Versioning;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -27,7 +28,7 @@ class SubProcessHost

public static bool IsAdmin()
{
if (OperatingSystem.Current == OperatingSystem.Windows)
if (System.OperatingSystem.IsWindows())
{
using (WindowsIdentity identity = WindowsIdentity.GetCurrent())
{
Expand Down

0 comments on commit 4a8c10b

Please sign in to comment.