Skip to content

Commit

Permalink
Fix most non-obsolete warnings (#5555)
Browse files Browse the repository at this point in the history
  • Loading branch information
SpaceManiac authored Dec 13, 2024
1 parent 27f7f5e commit 0c7ace1
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 13 deletions.
1 change: 0 additions & 1 deletion Robust.Client/GameObjects/EntitySystems/ContainerSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using Robust.Shared.GameStates;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
Expand Down
5 changes: 0 additions & 5 deletions Robust.Client/UserInterface/Controls/ColorSelectorSliders.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using System;
using System.Collections.Generic;
using Robust.Client.Graphics;
using Robust.Client.ResourceManagement;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;

Expand Down Expand Up @@ -89,8 +86,6 @@ public bool IsAlphaVisible
private OptionButton _typeSelector;
private List<ColorSelectorType> _types = new();

private static ShaderInstance _shader = default!;

private ColorSelectorStyleBox _topStyle;
private ColorSelectorStyleBox _middleStyle;
private ColorSelectorStyleBox _bottomStyle;
Expand Down
4 changes: 1 addition & 3 deletions Robust.Server/ServerStatus/StatusHost.Acz.Sources.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Robust.Server.ServerStatus;

internal sealed partial class StatusHost
{
private (string binFolder, string[] assemblies)? _aczInfo;
private IMagicAczProvider? _magicAczProvider;
private IFullHybridAczProvider? _fullHybridAczProvider;

Expand Down Expand Up @@ -158,8 +157,7 @@ private async Task<bool> SourceAczViaMagic(AssetPass pass, IPackageLogger logger
{
_aczSawmill.Verbose("Using default magic ACZ provider");
// Default provider
var (binFolderPath, assemblyNames) =
_aczInfo ?? ("Content.Client", new[] { "Content.Client", "Content.Shared" });
var (binFolderPath, assemblyNames) = ("Content.Client", new[] { "Content.Client", "Content.Shared" });

var info = new DefaultMagicAczInfo(binFolderPath, assemblyNames);
provider = new DefaultMagicAczProvider(info, _deps);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ private void AddEntitiesIntersecting<T>(

return;

static bool PhysicsQuery<T>(ref QueryState<T> state, in FixtureProxy value) where T : IComponent
static bool PhysicsQuery(ref QueryState<T> state, in FixtureProxy value)
{
if (!state.Sensors && !value.Fixture.Hard)
return true;
Expand All @@ -196,7 +196,7 @@ static bool PhysicsQuery<T>(ref QueryState<T> state, in FixtureProxy value) wher
return true;
}

static bool SundriesQuery<T>(ref QueryState<T> state, in EntityUid value) where T : IComponent
static bool SundriesQuery(ref QueryState<T> state, in EntityUid value)
{
if (!state.Query.TryGetComponent(value, out var comp))
return true;
Expand Down Expand Up @@ -318,7 +318,7 @@ private bool AnyComponentsIntersecting<T>(

return state.Found;

static bool PhysicsQuery<T>(ref AnyQueryState<T> state, in FixtureProxy value) where T : IComponent
static bool PhysicsQuery(ref AnyQueryState<T> state, in FixtureProxy value)
{
if (value.Entity == state.Ignored)
return true;
Expand Down
1 change: 0 additions & 1 deletion Robust.Shared/Toolshed/Commands/Entities/WithCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Robust.Shared.Toolshed.Commands.Entities;
internal sealed class WithCommand : ToolshedCommand
{
[Dependency] private readonly IComponentFactory _componentFactory = default!;
[Dependency] private readonly IPrototypeManager _prototype = default!;

[CommandImplementation]
public IEnumerable<EntityUid> With(
Expand Down
2 changes: 2 additions & 0 deletions Robust.UnitTesting/Shared/IoC/IoCManager_Test.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,10 +243,12 @@ public class TestFieldInjectionParent
{
[Dependency]
#pragma warning disable 649
#pragma warning disable RA0032
private readonly TestFieldInjection myself = default!;

[Dependency]
public TestFieldInjection myotherself = default!;
#pragma warning restore RA0032
#pragma warning restore 649

public virtual void Test()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ public void Test()
Assert.That(def.Dict == copy.Dict, Is.False);

// Sanity check
#pragma warning disable CS1718 // Comparison made to same variable
Assert.That(def.Dict == def.Dict, Is.True);
#pragma warning restore CS1718 // Comparison made to same variable

Serialization.CopyTo(def, ref copy, notNullableOverride: true);

Assert.That(def.Dict == copy.Dict, Is.False);

// Sanity check
#pragma warning disable CS1718 // Comparison made to same variable
Assert.That(def.Dict == def.Dict, Is.True);
#pragma warning restore CS1718 // Comparison made to same variable
}

[Test]
Expand All @@ -38,15 +42,19 @@ public void NullableNonNullTest()
Assert.That(copy.Dict, Is.Not.Null);

// Sanity check
#pragma warning disable CS1718 // Comparison made to same variable
Assert.That(def.Dict == def.Dict, Is.True);
#pragma warning restore CS1718 // Comparison made to same variable

Serialization.CopyTo(def, ref copy, notNullableOverride: true);

Assert.That(def.Dict == copy.Dict, Is.False);
Assert.That(copy.Dict, Is.Not.Null);

// Sanity check
#pragma warning disable CS1718 // Comparison made to same variable
Assert.That(def.Dict == def.Dict, Is.True);
#pragma warning restore CS1718 // Comparison made to same variable
}

[Test]
Expand Down

0 comments on commit 0c7ace1

Please sign in to comment.