Skip to content
This repository has been archived by the owner on Jan 6, 2022. It is now read-only.

Warning cleanup #521

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
163126b
Removed unnecessary "usings"
sebeksd Apr 27, 2016
9ee4f13
Remove unused exception variables
sebeksd Apr 27, 2016
8a0c7f0
Removed warning about hiding parent class member, this commit should …
sebeksd Apr 27, 2016
06daf77
Cleanup method overriding and hiding
sebeksd Apr 27, 2016
2be437e
Removed unnecessary "break" statement
sebeksd Apr 27, 2016
e60d19c
Removed unused variables and fields
sebeksd Apr 27, 2016
a818337
Set correct value for creating MyProfilerBlock pool
sebeksd Apr 27, 2016
3c6304c
Removed unused variables and fields (this time with values set to them)
sebeksd Apr 27, 2016
2070f48
Removed "Unreachable code detected" for debug code. It's not pretty b…
sebeksd Apr 28, 2016
14c177c
Removed unused variables (but with values)
sebeksd Apr 28, 2016
ef173fb
Removed false code never or always executed, this commit should be re…
sebeksd Apr 28, 2016
63edf9b
Added GetHashCode where it was missing (CS0661)
sebeksd Apr 30, 2016
eab91d1
Added Equals where it was missing (CS0660)
sebeksd Apr 30, 2016
c1b7087
Removed incorrect default values (CS1066)
sebeksd May 1, 2016
20dad30
GetHashCode for MyToolbarItemDefinition is sealed but Equals was over…
sebeksd May 1, 2016
155b431
Corrected Pack64() calculation for negative x/y/z values and removed …
sebeksd May 1, 2016
99d090b
Removed warning for "Unreachable code detected" (CS0162) for probably…
sebeksd May 1, 2016
a4ec93a
Fixed planet distance calculation, removed warning "Possible mistaken…
sebeksd May 1, 2016
a8c615e
Removed warnings about never assigned value (CS0649), some was releat…
sebeksd May 1, 2016
9ada281
Commented out some unused (debug) code
sebeksd May 1, 2016
6301016
MyMeshMaterialId moved to different file, added missing methods after…
sebeksd May 1, 2016
0735e9e
Last change after updating source code from main repo. Removed warnin…
sebeksd May 1, 2016
e9548ee
Fix to one of my commits overriding GetHashCode (GetHashCode full imp…
sebeksd May 3, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public MyObjectBuilderType InputItemType
/// <summary>
/// Postprocess initialization. Should set PostprocessNeeded to false if initialization was successful.
/// </summary>
public abstract void Postprocess();
public abstract override void Postprocess();

/// <summary>
/// Whether the Postprocess method still needs to be called.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public class MyGuiBlockCategoryDefinition : MyDefinitionBase
public bool SearchBlocks = true;
public bool ShowAnimations = false;
public bool ShowInCreative = true;
public bool Public = true;
public new bool Public = true;

private class SubtypeComparer : IComparer<MyGuiBlockCategoryDefinition>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected override void Init(MyObjectBuilder_DefinitionBase builder)
MyDebug.AssertDebug(m_postprocessBuilder != null);
}

public void Postprocess()
public override void Postprocess()
{
bool valid = true;

Expand Down
9 changes: 0 additions & 9 deletions Sources/Sandbox.Game/Definitions/MyDefinitionManager.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@

#region Using

using Sandbox.Common;
using Sandbox.Common.ObjectBuilders;
using Sandbox.Common.ObjectBuilders.Definitions;
using Sandbox.Engine.Utils;
using Sandbox.Engine.Voxels;
using Sandbox.Game.Entities;
using Sandbox.Game.Entities.Cube;
using Sandbox.Game.Localization;
using Sandbox.Game.Screens;
using Sandbox.Game.World.Generator;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand All @@ -23,13 +17,10 @@

using VRage;
using VRage.Collections;
using VRage;
using VRage.Audio;
using VRage.Plugins;
using VRage.Utils;
using VRage.Data;
using VRage.Filesystem.FindFilesRegEx;
using VRage.Utils;
using VRageMath;
using VRageRender;
using VRage.Library.Utils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Sandbox.Definitions
public class MyDestructionDefinition : MyDefinitionBase
{
public float DestructionDamage;
public string[] Icons;
public new string[] Icons;
public float ConvertedFractureIntegrityRatio;

public class MyFracturedPieceDefinition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ protected override void Init(MyObjectBuilder_DefinitionBase builder)
}
}

public void Postprocess()
public override void Postprocess()
{
List<MySpawnGroupDefinition> spawnGroups = new List<MySpawnGroupDefinition>();
List<float> frequencies = new List<float>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using Sandbox.Game.Entities;
using Sandbox.Game.Entities.Cube;
using Sandbox.Game.Gui;
using Sandbox.Game.Screens;
using VRage;
using VRageMath;
using Sandbox.Common;
using Sandbox.Game.World;
using Sandbox.Game.Multiplayer;

using Sandbox.Engine.Utils;
using Sandbox.Common.ObjectBuilders;
using VRage;
using Sandbox.Game.Localization;
using VRage.Utils;
using VRage.Library.Utils;
using Sandbox.Game.SessionComponents;
using Sandbox.Game.Entities.Blocks;
using VRage.Game;

Expand Down
11 changes: 0 additions & 11 deletions Sources/Sandbox.Game/Engine/Multiplayer/MyMultiplayerClient.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
#region Using

using Sandbox.Common;

using Sandbox.Common.ObjectBuilders;
using Sandbox.Engine.Networking;
using Sandbox.Engine.Utils;
using Sandbox.Game;
using Sandbox.Game.Gui;
using Sandbox.Game.Localization;
using Sandbox.Game.Multiplayer;
using Sandbox.Game.World;
using Sandbox.Graphics.GUI;
using SteamSDK;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Net;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;

using VRage;
using VRage.Utils;
using VRage.Trace;
using VRage.Utils;
using VRage.Library.Utils;
using VRage.Network;
using VRage.Replication;
Expand Down
9 changes: 1 addition & 8 deletions Sources/Sandbox.Game/Engine/Networking/MyReceiveQueue.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
using Sandbox.Engine.Networking;
using Sandbox.Game.Multiplayer;
using SteamSDK;
using SteamSDK;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Threading;
using VRage.Collections;
using VRage.Library.Utils;
using VRage.Utils;
using VRage.Utils;

namespace Sandbox.Engine.Networking
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
using Havok;
using Sandbox.Definitions;
using Sandbox.Engine.Models;
using Sandbox.Engine.Utils;
using Sandbox.Engine.Voxels;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VRage;
using VRage;
using VRage.Game;
using VRage.Utils;
Expand Down
5 changes: 0 additions & 5 deletions Sources/Sandbox.Game/Engine/Physics/MyDestructionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using VRage;
using VRage;
using VRage.Game.Components;
using VRage.Library.Utils;
using VRage.ModAPI;
using VRageMath;
using Sandbox.Game.EntityComponents;
using Sandbox.Engine.Multiplayer;
using VRage.Game;
using VRage.Utils;
using VRage.Game.Entity;
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sandbox.Game/Engine/Utils/MyConfigDedicated.cs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ bool IMyConfigDedicated.PauseGameWhenEmpty
}
}

void IMyConfigDedicated.Save(string path = null)
void IMyConfigDedicated.Save(string path)
{
Save(path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MySpectatorCameraController : MySpectator, IMyCameraController
// Increases how far the light can reflect
private const int REFLECTOR_RANGE_MULTIPLIER = 5;

public static MySpectatorCameraController Static;
public static new MySpectatorCameraController Static;

private double m_yaw;
private double m_pitch;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,6 @@ private void ComputeSizeAndOrigin(int lodIdx, Vector3I storageSize)
private void CreateTriangles(ref Vector3I coord0, int cubeIndex, ref Vector3I tempVoxelCoord0)
{
MyVoxelVertex tmpVertex = new MyVoxelVertex();
int g = MyVoxelConstants.GEOMETRY_CELL_SIZE_IN_VOXELS;
Vector3I edge = new Vector3I(coord0.X, coord0.Y, coord0.Z);
for (int i = 0; MyMarchingCubesConstants.TriangleTable[cubeIndex, i] != -1; i += 3)
{
Expand Down
4 changes: 2 additions & 2 deletions Sources/Sandbox.Game/Engine/Voxels/MyPrecalcComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public override void UpdateBeforeSimulation()
job.DebugDraw(new Color((shade - p) / shade, 0.0f, p / shade, (max - xi) / max));
}
}
catch (Exception e)
catch (Exception)
{ }
}

Expand Down Expand Up @@ -330,7 +330,7 @@ public WorkPriority Priority
set { m_workPriority = value; }
}

void IWork.DoWork(ParallelTasks.WorkData workData = null)
void IWork.DoWork(ParallelTasks.WorkData workData)
{
m_timer.Start();
MyPrecalcJob work;
Expand Down
7 changes: 1 addition & 6 deletions Sources/Sandbox.Game/Engine/Voxels/MyVoxelGeometry.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@

using Sandbox.Common;
using Sandbox.Engine.Physics;
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using VRage;
using VRage.Collections;
using VRage;
using VRage.Utils;
using VRage.Voxels;
using VRageMath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,7 @@ public void ReadMaterialRange(ref MyVoxelDataRequest req)
var target = req.Target;

float lodVoxelSize = 1 << req.Lod;

MyVoxelRequestFlags usedFlags = 0;


bool computeOcclusion = req.RequestedData.Requests(MyStorageDataTypeEnum.Occlusion);

// We don't bother determining where the surface is if we don't have the normal.
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sandbox.Game/Engine/Voxels/Storage/IMyStorage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public interface IMyStorage : VRage.ModAPI.IMyStorage

void OverwriteAllMaterials(MyVoxelMaterialDefinition material);

void Save(out byte[] outCompressedData);
new void Save(out byte[] outCompressedData);

/// <summary>
/// Reads range of content and/or materials from specified LOD. If you want to write data back later, you must read LOD0 as that is the only writable one.
Expand Down
2 changes: 0 additions & 2 deletions Sources/Sandbox.Game/Game/AI/Actions/MyHumanoidBotActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ private void AreaReservationHandler(ref MyAiTargetManager.ReservedAreaData reser
[MyBehaviorTreeAction("TryReserveEntity")]
protected MyBehaviorTreeState TryReserveEntity([BTIn] ref MyBBMemoryTarget inTarget, [BTParam] int timeMs)
{
MyBehaviorTreeState retStatus = MyBehaviorTreeState.FAILURE;
if(Bot == null || Bot.Player == null)
return MyBehaviorTreeState.FAILURE;

Expand Down Expand Up @@ -140,7 +139,6 @@ protected MyBehaviorTreeState TryReserveEntity([BTIn] ref MyBBMemoryTarget inTar
break;
default:
logic.ReservationStatus = Logic.MyReservationStatus.FAILURE;
retStatus = MyBehaviorTreeState.FAILURE;
break;
}
m_reservationTimeOut = MySandboxGame.Static.UpdateTime + MyTimeSpan.FromSeconds(RESERVATION_WAIT_TIMEOUT_SECONDS);
Expand Down
9 changes: 0 additions & 9 deletions Sources/Sandbox.Game/Game/AI/BehaviorTree/MyBehaviorTree.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
using Sandbox.Definitions;
using Sandbox.Engine.Utils;
using Sandbox.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using VRageMath;
using VRage.Win32;
using VRage.Utils;
using VRage.Utils;
using VRage.Library.Utils;

namespace Sandbox.Game.AI.BehaviorTree
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
using Sandbox.Definitions;
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using VRageMath;
using VRage.Utils;
using Sandbox.Common;
using VRage;
using VRage.Game;
using VRage.Utils;
using VRage.Library.Utils;

namespace Sandbox.Game.AI.BehaviorTree
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using VRage.Utils;
using System.Diagnostics;
using VRage.Utils;
using VRage.Library.Utils;
using VRage.Collections;
using VRage.Game;

Expand Down
4 changes: 0 additions & 4 deletions Sources/Sandbox.Game/Game/AI/Navigation/MyBotNavigation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@
using Sandbox.Game.Entities;
using Sandbox.Game.Entities.Character;
using Sandbox.Game.GameSystems;
using Sandbox.Graphics;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using VRage;
using VRage;
using VRage.Game.Entity;
using VRageMath;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using VRage;
using VRage;
using VRage.Utils;
using VRage.Voxels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,13 @@ public void FixOuterEdge(int edgeIndex, bool firstPoint, Vector3 currentPosition
{
OuterEdgePoint data = new OuterEdgePoint(edgeIndex, firstPoint);
var query = m_outerEdgePoints.QueryPointsSphere(ref currentPosition, OUTER_EDGE_EPSILON * 3);
bool moved = false;

while (query.MoveNext())
{
if (query.Current.EdgeIndex == edgeIndex && query.Current.FirstPoint == firstPoint)
{
//Debug.Assert(moved == false, "The point was already moved!");
m_outerEdgePoints.MovePoint(query.StorageIndex, ref currentPosition);
moved = true;
}
}
}
Expand Down
Loading