From 748f72326d9a295958bc9ba63bbb1a5d39030ef7 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Fri, 27 Jun 2008 23:03:39 +0000 Subject: last round of warning squashing. calling it a day now. --- OpenSim/Region/Application/OpenSimBase.cs | 2 +- .../Region/ClientStack/LindenUDP/LLClientView.cs | 18 ++--- .../Region/ClientStack/LindenUDP/LLPacketQueue.cs | 4 +- .../Region/ClientStack/LindenUDP/LLUDPServer.cs | 6 +- OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 13 ++-- OpenSim/Region/DataSnapshot/EstateSnapshot.cs | 4 +- OpenSim/Region/DataSnapshot/LandSnapshot.cs | 4 +- OpenSim/Region/DataSnapshot/ObjectSnapshot.cs | 4 +- .../Modules/World/Archiver/ArchiveConstants.cs | 4 ++ .../Modules/World/Archiver/ArchiverModule.cs | 2 +- .../Environment/Modules/World/NPC/NPCModule.cs | 16 ++--- .../Environment/Modules/World/Sun/SunModule.cs | 24 +++---- OpenSim/Region/Environment/Scenes/Scene.cs | 2 +- .../Region/Environment/Scenes/SceneObjectGroup.cs | 4 +- .../Region/Environment/Scenes/SceneObjectPart.cs | 2 +- .../Region/Examples/SimpleModule/RegionModule.cs | 84 +++++++++++----------- .../Modules/AvatarFactory/AvatarFactoryModule.cs | 2 +- .../Modules/SvnSerialiser/SvnBackupModule.cs | 24 +++---- OpenSim/Region/Physics/Meshing/HelperTypes.cs | 6 +- .../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 6 +- .../Common/ScriptEngineBase/MaintenanceThread.cs | 4 +- .../Common/ScriptEngineBase/ScriptManager.cs | 6 +- .../DotNetEngine/Compiler/LSL/Compiler.cs | 4 +- .../DotNetEngine/Compiler/LSL/YP2CSConverter.cs | 6 +- .../Compiler/YieldProlog/BagofAnswers.cs | 5 ++ .../Compiler/YieldProlog/FindallAnswers.cs | 5 ++ .../DotNetEngine/Compiler/YieldProlog/Functor1.cs | 5 ++ .../DotNetEngine/Compiler/YieldProlog/Functor2.cs | 5 ++ .../DotNetEngine/Compiler/YieldProlog/Functor3.cs | 4 ++ .../DotNetEngine/Compiler/YieldProlog/Parser.cs | 14 ++-- .../DotNetEngine/Compiler/YieldProlog/Variable.cs | 4 ++ .../DotNetEngine/Compiler/YieldProlog/YP.cs | 6 +- .../Compiler/YieldProlog/YPCompiler.cs | 60 +++++++++------- .../Shared/Api/Implementation/LSL_Api.cs | 16 ++--- .../Shared/Api/Runtime/YieldProlog/BagofAnswers.cs | 28 ++++++++ .../Api/Runtime/YieldProlog/FindallAnswers.cs | 8 +++ .../Shared/Api/Runtime/YieldProlog/Functor1.cs | 9 +++ .../Shared/Api/Runtime/YieldProlog/Functor2.cs | 8 +++ .../Shared/Api/Runtime/YieldProlog/Functor3.cs | 8 +++ .../Shared/Api/Runtime/YieldProlog/Parser.cs | 13 ++-- .../Shared/Api/Runtime/YieldProlog/Variable.cs | 4 ++ .../Shared/Api/Runtime/YieldProlog/YP.cs | 35 ++++++++- .../Shared/Api/Runtime/YieldProlog/YPCompiler.cs | 63 +++++++++------- .../ScriptEngine/Shared/CodeTools/Compiler.cs | 12 ++-- .../Shared/CodeTools/YP2CSConverter.cs | 6 +- OpenSim/Region/ScriptEngine/XEngine/Executor.cs | 2 +- OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 18 ++--- 47 files changed, 383 insertions(+), 206 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d0d5378..9583b6d 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -153,7 +153,7 @@ namespace OpenSim m_config = new OpenSimConfigSource(); m_config.Source = new IniConfigSource(); - IConfigSource icong; + // IConfigSource icong; //check for .INI file (either default or name passed in command line) if (File.Exists(Application.iniFilePath)) diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 49174bd..08b93f3 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -253,9 +253,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP private UpdateVector handlerUpdatePrimGroupScale = null; //OnUpdateGroupScale; private UpdateVector handlerUpdateVector = null; //OnUpdatePrimGroupPosition; private UpdatePrimRotation handlerUpdatePrimRotation = null; //OnUpdatePrimGroupRotation; - private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation; + // private UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = null; //OnUpdatePrimGroupMouseRotation; private PacketStats handlerPacketStats = null; // OnPacketStats;# - private RequestAsset handlerRequestAsset = null; // OnRequestAsset; + // private RequestAsset handlerRequestAsset = null; // OnRequestAsset; private UUIDNameRequest handlerTeleportHomeRequest = null; private ScriptAnswer handlerScriptAnswer = null; @@ -3467,7 +3467,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } else { - LLUUID partId = part.UUID; + // LLUUID partId = part.UUID; UpdatePrimRotation handlerUpdatePrimRotation = OnUpdatePrimGroupRotation; UpdatePrimGroupRotation handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; @@ -4135,7 +4135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP byte[] message = inchatpack.ChatData.Message; byte type = inchatpack.ChatData.Type; LLVector3 fromPos = new LLVector3(); // ClientAvatar.Pos; - LLUUID fromAgentID = AgentId; + // LLUUID fromAgentID = AgentId; int channel = inchatpack.ChatData.Channel; @@ -4388,7 +4388,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP DetachAttachmentIntoInvPacket detachtoInv = (DetachAttachmentIntoInvPacket)Pack; LLUUID itemID = detachtoInv.ObjectData.ItemID; - LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; + // LLUUID ATTACH_agentID = detachtoInv.ObjectData.AgentID; handlerDetachAttachmentIntoInv(itemID, this); } @@ -5938,7 +5938,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.RequestRegionInfo: - RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; + // RequestRegionInfoPacket.AgentDataBlock mPacket = ((RequestRegionInfoPacket)Pack).AgentData; handlerRegionInfoRequest = OnRegionInfoRequest; if (handlerRegionInfoRequest != null) @@ -5948,8 +5948,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.EstateCovenantRequest: - EstateCovenantRequestPacket.AgentDataBlock epack = - ((EstateCovenantRequestPacket)Pack).AgentData; + // EstateCovenantRequestPacket.AgentDataBlock epack = + // ((EstateCovenantRequestPacket)Pack).AgentData; handlerEstateCovenantRequest = OnEstateCovenantRequest; if (handlerEstateCovenantRequest != null) @@ -6287,7 +6287,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendLandStatReply(uint reportType, uint requestFlags, uint resultCount, LandStatReportItem[] lsrpia) { LandStatReplyPacket lsrp = new LandStatReplyPacket(); - LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock(); + // LandStatReplyPacket.RequestDataBlock lsreqdpb = new LandStatReplyPacket.RequestDataBlock(); LandStatReplyPacket.ReportDataBlock[] lsrepdba = new LandStatReplyPacket.ReportDataBlock[lsrpia.Length]; //LandStatReplyPacket.ReportDataBlock lsrepdb = new LandStatReplyPacket.ReportDataBlock(); // lsrepdb. diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs index 3786489..51dcde7 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLPacketQueue.cs @@ -57,8 +57,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP private Queue TextureOutgoingPacketQueue; private Queue AssetOutgoingPacketQueue; - private Dictionary PendingAcks = new Dictionary(); - private Dictionary NeedAck = new Dictionary(); + // private Dictionary PendingAcks = new Dictionary(); + // private Dictionary NeedAck = new Dictionary(); // All throttle times and number of bytes are calculated by dividing by this value // This value also determines how many times per throttletimems the timer will run diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs index eb4b8e7..d705ef2 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLUDPServer.cs @@ -418,9 +418,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP m_socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); m_socket.Bind(ServerIncoming); // Add flags to the UDP socket to prevent "Socket forcibly closed by host" - uint IOC_IN = 0x80000000; - uint IOC_VENDOR = 0x18000000; - uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12; + // uint IOC_IN = 0x80000000; + // uint IOC_VENDOR = 0x18000000; + // uint SIO_UDP_CONNRESET = IOC_IN | IOC_VENDOR | 12; // TODO: this apparently works in .NET but not in Mono, need to sort out the right flags here. // m_socket.IOControl((int)SIO_UDP_CONNRESET, new byte[] { Convert.ToByte(false) }, null); diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index ae0b5ff..55ef047 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -79,7 +79,7 @@ namespace OpenSim.Region.DataSnapshot //Program objects private SnapshotStore m_snapStore = null; - private DataRequestHandler m_requests = null; + // private DataRequestHandler m_requests = null; #endregion @@ -144,7 +144,7 @@ namespace OpenSim.Region.DataSnapshot m_passedCheck.Start(); //Hand it the first scene, assuming that all scenes have the same BaseHTTPServer - m_requests = new DataRequestHandler(scene, this); + // m_requests = new DataRequestHandler(scene, this); m_hostname = scene.RegionInfo.ExternalHostName; m_snapStore = new SnapshotStore(m_snapsDir, m_gridinfo, m_listener_port, m_hostname); @@ -325,17 +325,18 @@ namespace OpenSim.Region.DataSnapshot m_log.Warn("[DATASNAPSHOT] Ignoring unknown exception " + e.ToString()); } byte[] response = new byte[1024]; - int n = 0; + // int n = 0; try { - n = reply.Read(response, 0, 1024); + // n = reply.Read(response, 0, 1024); + reply.Read(response, 0, 1024); } catch (Exception e) { - m_log.Warn("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. " + e.StackTrace); + m_log.WarnFormat("[DATASNAPSHOT] Unable to decode reply from data service. Ignoring. {0}", e.StackTrace); } // This is not quite working, so... - string responseStr = Encoding.UTF8.GetString(response); + // string responseStr = Encoding.UTF8.GetString(response); m_log.Info("[DATASNAPSHOT] data service notified: " + url); } diff --git a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs index 9a25c1d..99a4a0d 100644 --- a/OpenSim/Region/DataSnapshot/EstateSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/EstateSnapshot.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.DataSnapshot.Providers * I don't think anything changes the fields beyond RegionModule PostInit, however. */ private Scene m_scene = null; - private DataSnapshotManager m_parent = null; + // private DataSnapshotManager m_parent = null; private bool m_stale = true; #region IDataSnapshotProvider Members @@ -84,7 +84,7 @@ namespace OpenSim.Region.DataSnapshot.Providers public void Initialize(Scene scene, DataSnapshotManager parent) { m_scene = scene; - m_parent = parent; + // m_parent = parent; } public Scene GetParentScene diff --git a/OpenSim/Region/DataSnapshot/LandSnapshot.cs b/OpenSim/Region/DataSnapshot/LandSnapshot.cs index 02e80ba..efc4a84 100644 --- a/OpenSim/Region/DataSnapshot/LandSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/LandSnapshot.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.DataSnapshot.Providers public class LandSnapshot : IDataSnapshotProvider { private Scene m_scene = null; - private DataSnapshotManager m_parent = null; + // private DataSnapshotManager m_parent = null; //private Dictionary m_landIndexed = new Dictionary(); private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private bool m_stale = true; @@ -106,7 +106,7 @@ namespace OpenSim.Region.DataSnapshot.Providers public void Initialize(Scene scene, DataSnapshotManager parent) { m_scene = scene; - m_parent = parent; + // m_parent = parent; //Brought back from the dead for staleness checks. m_scene.EventManager.OnNewClient += OnNewClient; diff --git a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs index e5b2ad4..d2a5051 100644 --- a/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs +++ b/OpenSim/Region/DataSnapshot/ObjectSnapshot.cs @@ -40,14 +40,14 @@ namespace OpenSim.Region.DataSnapshot.Providers public class ObjectSnapshot : IDataSnapshotProvider { private Scene m_scene = null; - private DataSnapshotManager m_parent = null; + // private DataSnapshotManager m_parent = null; private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private bool m_stale = true; public void Initialize(Scene scene, DataSnapshotManager parent) { m_scene = scene; - m_parent = parent; + // m_parent = parent; //To check for staleness, we must catch all incoming client packets. m_scene.EventManager.OnNewClient += OnNewClient; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs index 0766c95..f4586b0 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiveConstants.cs @@ -72,7 +72,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Notecard] = ".ncd"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Object] = ".oob"; ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.RootFolder] = ".rfd"; // Not sure if we'll ever see this + #pragma warning disable 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Script] = ".spt"; // Not sure if we'll ever see this + #pragma warning restore 0612 ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Simstate] = ".sst"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.SnapshotFolder] = ".sfd"; // Not sure if we'll ever see this ASSET_TYPE_TO_EXTENSION[(sbyte)AssetType.Sound] = ".ogg"; @@ -95,7 +97,9 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver EXTENSION_TO_ASSET_TYPE[".ncd"] = (sbyte)AssetType.Notecard; EXTENSION_TO_ASSET_TYPE[".oob"] = (sbyte)AssetType.Object; EXTENSION_TO_ASSET_TYPE[".rfd"] = (sbyte)AssetType.RootFolder; + #pragma warning disable 0612 EXTENSION_TO_ASSET_TYPE[".spt"] = (sbyte)AssetType.Script; + #pragma warning restore 0612 EXTENSION_TO_ASSET_TYPE[".sst"] = (sbyte)AssetType.Simstate; EXTENSION_TO_ASSET_TYPE[".sfd"] = (sbyte)AssetType.SnapshotFolder; EXTENSION_TO_ASSET_TYPE[".ogg"] = (sbyte)AssetType.Sound; diff --git a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs index ae3d333..69f712c 100644 --- a/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Archiver/ArchiverModule.cs @@ -42,7 +42,7 @@ namespace OpenSim.Region.Environment.Modules.World.Archiver /// public class ArchiverModule : IRegionModule, IRegionArchiver { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); /// /// Scene to which this module belongs diff --git a/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs index 32a3cc4..86472f6 100644 --- a/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs +++ b/OpenSim/Region/Environment/Modules/World/NPC/NPCModule.cs @@ -34,17 +34,17 @@ namespace OpenSim.Region.Environment.Modules.World.NPC { public class NPCModule : IRegionModule { - private const bool m_enabled = false; + // private const bool m_enabled = false; public void Initialise(Scene scene, IConfigSource source) { - if (m_enabled) - { - NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene); - NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene); - scene.AddNewClient(testAvatar, false); - scene.AddNewClient(testAvatar2, false); - } + // if (m_enabled) + // { + // NPCAvatar testAvatar = new NPCAvatar("Jack", "NPC", new LLVector3(128, 128, 40), scene); + // NPCAvatar testAvatar2 = new NPCAvatar("Jill", "NPC", new LLVector3(136, 128, 40), scene); + // scene.AddNewClient(testAvatar, false); + // scene.AddNewClient(testAvatar2, false); + // } } public void PostInitialise() diff --git a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs index bb4a568..f73c193 100644 --- a/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs +++ b/OpenSim/Region/Environment/Modules/World/Sun/SunModule.cs @@ -57,16 +57,16 @@ namespace OpenSim.Region.Environment.Modules private double m_day_length = 0; private int m_year_length = 0; private double m_day_night = 0; - private double m_longitude = 0; - private double m_latitude = 0; + // private double m_longitude = 0; + // private double m_latitude = 0; // Configurable defaults Defaults close to SL private string d_mode = "SL"; private int d_frame_mod = 100; // Every 10 seconds (actually less) private double d_day_length = 4; // A VW day is 4 RW hours long private int d_year_length = 60; // There are 60 VW days in a VW year private double d_day_night = 0.45; // axis offset: ratio of light-to-dark, approx 1:3 - private double d_longitude = -73.53; - private double d_latitude = 41.29; + // private double d_longitude = -73.53; + // private double d_latitude = 41.29; // Frame counter private uint m_frame = 0; @@ -80,7 +80,7 @@ namespace OpenSim.Region.Environment.Modules private uint SecondsPerYear; // Length of a virtual year in RW seconds private double SunSpeed; // Rate of passage in radians/second private double SeasonSpeed; // Rate of change for seasonal effects - private double HoursToRadians; // Rate of change for seasonal effects + // private double HoursToRadians; // Rate of change for seasonal effects private long TicksOffset = 0; // seconds offset from UTC // Calculated every update private float OrbitalPosition; // Orbital placement at a point in time @@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment.Modules private double TotalDistanceTravelled; // Distance since beginning of time (in radians) private double SeasonalOffset; // Seaonal variation of tilt private float Magnitude; // Normal tilt - private double VWTimeRatio; // VW time as a ratio of real time + // private double VWTimeRatio; // VW time as a ratio of real time // Working values private LLVector3 Position = new LLVector3(0,0,0); @@ -173,9 +173,9 @@ namespace OpenSim.Region.Environment.Modules // Mode: determines how the sun is handled m_mode = config.Configs["Sun"].GetString("mode", d_mode); // Mode: determines how the sun is handled - m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude); + // m_latitude = config.Configs["Sun"].GetDouble("latitude", d_latitude); // Mode: determines how the sun is handled - m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude); + // m_longitude = config.Configs["Sun"].GetDouble("longitude", d_longitude); // Day length in decimal hours m_year_length = config.Configs["Sun"].GetInt("year_length", d_year_length); // Day length in decimal hours @@ -193,8 +193,8 @@ namespace OpenSim.Region.Environment.Modules m_day_length = d_day_length; m_day_night = d_day_night; m_frame_mod = d_frame_mod; - m_latitude = d_latitude; - m_longitude = d_longitude; + // m_latitude = d_latitude; + // m_longitude = d_longitude; } switch (m_mode) @@ -209,7 +209,7 @@ namespace OpenSim.Region.Environment.Modules // Ration of real-to-virtual time - VWTimeRatio = 24/m_day_length; + // VWTimeRatio = 24/m_day_length; // Speed of rotation needed to complete a cycle in the // designated period (day and season) @@ -220,7 +220,7 @@ namespace OpenSim.Region.Environment.Modules // Horizon translation HorizonShift = m_day_night; // Z axis translation - HoursToRadians = (SunCycle/24)*VWTimeRatio; + // HoursToRadians = (SunCycle/24)*VWTimeRatio; // Insert our event handling hooks diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3879b57..b7117df 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes public InnerScene m_innerScene; - private Random Rand = new Random(); + // private Random Rand = new Random(); private uint _primCount = 720000; private readonly Mutex _primAllocateMutex = new Mutex(false); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs index 74f9d6c..4a24dad 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs @@ -87,7 +87,7 @@ namespace OpenSim.Region.Environment.Scenes /// public partial class SceneObjectGroup : EntityBase { - private PrimCountTaintedDelegate handlerPrimCountTainted = null; + // private PrimCountTaintedDelegate handlerPrimCountTainted = null; /// /// Signal whether the non-inventory attributes of any prims in the group have changed @@ -107,7 +107,7 @@ namespace OpenSim.Region.Environment.Scenes protected ulong m_regionHandle; protected SceneObjectPart m_rootPart; - private Dictionary m_scriptEvents = new Dictionary(); + // private Dictionary m_scriptEvents = new Dictionary(); private Dictionary m_targets = new Dictionary(); diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index b610477..7b04c82 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -169,7 +169,7 @@ namespace OpenSim.Region.Environment.Scenes private Color m_color = Color.Black; private string m_description = String.Empty; private List m_lastColliders = new List(); - private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; + // private PhysicsVector m_lastRotationalVelocity = PhysicsVector.Zero; private int m_linkNum = 0; [XmlIgnore] private int m_scriptAccessPin = 0; diff --git a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs index 327bd75..46b7efd 100644 --- a/OpenSim/Region/Examples/SimpleModule/RegionModule.cs +++ b/OpenSim/Region/Examples/SimpleModule/RegionModule.cs @@ -48,9 +48,9 @@ namespace OpenSim.Region.Examples.SimpleModule public void PostInitialise() { - RegionInfo regionInfo = m_scene.RegionInfo; + // RegionInfo regionInfo = m_scene.RegionInfo; - LLVector3 pos = new LLVector3(110, 129, 27); + // LLVector3 pos = new LLVector3(110, 129, 27); //AddCpuCounter(regionInfo, pos); // AddComplexObjects(regionInfo, pos); @@ -58,27 +58,27 @@ namespace OpenSim.Region.Examples.SimpleModule // AddFileSystemObjects(); } - private void AddFileSystemObjects() - { - DirectoryInfo dirInfo = new DirectoryInfo("."); + // private void AddFileSystemObjects() + // { + // DirectoryInfo dirInfo = new DirectoryInfo("."); - float x = 0; - float z = 0; + // float x = 0; + // float z = 0; - foreach (FileInfo fileInfo in dirInfo.GetFiles()) - { - LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z); - x = x + 2; - if (x > 50) - { - x = 0; - z = z + 2; - } - - FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); - m_scene.AddNewSceneObject(fileObject, true); - } - } + // foreach (FileInfo fileInfo in dirInfo.GetFiles()) + // { + // LLVector3 filePos = new LLVector3(100 + x, 129, 27 + z); + // x = x + 2; + // if (x > 50) + // { + // x = 0; + // z = z + 2; + // } + + // FileSystemObject fileObject = new FileSystemObject(m_scene, fileInfo, filePos); + // m_scene.AddNewSceneObject(fileObject, true); + // } + // } private void AddAvatars() { @@ -96,27 +96,27 @@ namespace OpenSim.Region.Examples.SimpleModule } } - private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos) - { - int objs = 3; - - for (int i = 0; i < (objs*objs*objs); i++) - { - LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); - ComplexObject complexObject = - new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), - pos + posOffset); - m_scene.AddNewSceneObject(complexObject, true); - } - } - - private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos) - { - SceneObjectGroup sceneObject = - new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), - pos + new LLVector3(1f, 1f, 1f)); - m_scene.AddNewSceneObject(sceneObject, true); - } + // private void AddComplexObjects(RegionInfo regionInfo, LLVector3 pos) + // { + // int objs = 3; + + // for (int i = 0; i < (objs*objs*objs); i++) + // { + // LLVector3 posOffset = new LLVector3((i % objs) * 4, ((i % (objs*objs)) / (objs)) * 4, (i / (objs*objs)) * 4); + // ComplexObject complexObject = + // new ComplexObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), + // pos + posOffset); + // m_scene.AddNewSceneObject(complexObject, true); + // } + // } + + // private void AddCpuCounter(RegionInfo regionInfo, LLVector3 pos) + // { + // SceneObjectGroup sceneObject = + // new CpuCounterObject(m_scene, regionInfo.RegionHandle, LLUUID.Zero, m_scene.PrimIDAllocate(), + // pos + new LLVector3(1f, 1f, 1f)); + // m_scene.AddNewSceneObject(sceneObject, true); + // } public void Close() { diff --git a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs index 7ce90f5..9c70a04 100644 --- a/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs +++ b/OpenSim/Region/Modules/AvatarFactory/AvatarFactoryModule.cs @@ -132,7 +132,7 @@ namespace OpenSim.Region.Modules.AvatarFactory } else { - LLUUID assetId; + // LLUUID assetId; InventoryItemBase baseItem = profile.RootFolder.FindItem(appearance.Wearables[i].ItemID); diff --git a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs index 8f314b1..4826ff2 100644 --- a/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs +++ b/OpenSim/Region/Modules/SvnSerialiser/SvnBackupModule.cs @@ -133,21 +133,21 @@ namespace OpenSim.Region.Modules.SvnSerialiser m_svnClient.Checkout2(m_svnurl, m_svndir, revision, revision, true, false); } - private void CheckoutSvnPartial(string subdir) - { - if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) - Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); + // private void CheckoutSvnPartial(string subdir) + // { + // if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) + // Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); - m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false); - } + // m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, Svn.Revision.Head, Svn.Revision.Head, true, false); + // } - private void CheckoutSvnPartial(string subdir, SvnRevision revision) - { - if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) - Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); + // private void CheckoutSvnPartial(string subdir, SvnRevision revision) + // { + // if (!Directory.Exists(m_svndir + Slash.DirectorySeparatorChar + subdir)) + // Directory.CreateDirectory(m_svndir + Slash.DirectorySeparatorChar + subdir); - m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false); - } + // m_svnClient.Checkout2(m_svnurl + "/" + subdir, m_svndir, revision, revision, true, false); + // } #endregion diff --git a/OpenSim/Region/Physics/Meshing/HelperTypes.cs b/OpenSim/Region/Physics/Meshing/HelperTypes.cs index aed6c45..5d9823c 100644 --- a/OpenSim/Region/Physics/Meshing/HelperTypes.cs +++ b/OpenSim/Region/Physics/Meshing/HelperTypes.cs @@ -192,7 +192,10 @@ public class Vertex : PhysicsVector, IComparable { return new Vertex(Y * v.Z - Z * v.Y, Z * v.X - X * v.Z, X * v.Y - Y * v.X); } - + + // mono compiler moans about overloading operators hiding base + // operator but should not according to C# language spec + #pragma warning disable 0108 public static Vertex operator *(Vertex v, Quaternion q) { Matrix4 tm = q.computeMatrix(); @@ -250,6 +253,7 @@ public class Vertex : PhysicsVector, IComparable v1.Z *= mul; return v1; } + #pragma warning restore 0108 public float dot(Vertex v) diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index 28a512b..6324f1a 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs @@ -3122,7 +3122,7 @@ namespace OpenSim.Region.ScriptEngine.Common } - double angle = 2 * Math.Acos(rot.s); + // double angle = 2 * Math.Acos(rot.s); double s = Math.Sqrt(1 - rot.s * rot.s); if (s < 0.001) { @@ -3960,7 +3960,7 @@ namespace OpenSim.Region.ScriptEngine.Common { int index = str.IndexOf(delimiters[i].ToString()); bool found = index != -1; - if (found && String.Empty != delimiters[i]) + if (found && String.Empty != (string)delimiters[i]) { if ((cindex > index) || (cindex == -1)) { @@ -4049,7 +4049,7 @@ namespace OpenSim.Region.ScriptEngine.Common private String[] GetNotecardLines(string name) { - bool found = false; + // bool found = false; int notecardIndex = 0; String[] notecardLines = { "0" }; notecardLines[0] = String.Empty; diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs index fc005ab..ef87b2f 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs @@ -125,7 +125,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase } } - private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception + // private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception /// /// A thread should run in this loop and check all running scripts /// @@ -171,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase //{ foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) { - lastScriptEngine = m_ScriptEngine; + // lastScriptEngine = m_ScriptEngine; // Re-reading config every x seconds if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other) { diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index 366aaf1..eed0b86 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs @@ -59,7 +59,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase private Thread scriptLoadUnloadThread; private static Thread staticScriptLoadUnloadThread; - private int scriptLoadUnloadThread_IdleSleepms; + // private int scriptLoadUnloadThread_IdleSleepms; private Queue LUQueue = new Queue(); private static bool PrivateThread; private int LoadUnloadMaxQueueSize; @@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase public void ReadConfig() { - scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30); + // scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30); // TODO: Requires sharing of all ScriptManagers to single thread PrivateThread = true; // m_scriptEngine.ScriptConfigSource.GetBoolean("PrivateScriptLoadUnloadThread", false); LoadUnloadMaxQueueSize = m_scriptEngine.ScriptConfigSource.GetInt("LoadUnloadMaxQueueSize", 100); @@ -245,7 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase #region Start/Stop/Reset script - private readonly Object startStopLock = new Object(); + // private readonly Object startStopLock = new Object(); /// /// Fetches, loads and hooks up a script to an objects events diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs index 3f53456..0d3c8c6 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs @@ -65,7 +65,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL private enumCompileType DefaultCompileLanguage; private bool WriteScriptSourceToDebugFile; private bool CompileWithDebugInformation; - private bool CleanUpOldScriptsOnStartup; + // private bool CleanUpOldScriptsOnStartup; private Dictionary AllowedCompilers = new Dictionary(StringComparer.CurrentCultureIgnoreCase); private Dictionary LanguageMapping = new Dictionary(StringComparer.CurrentCultureIgnoreCase); @@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL // Get some config WriteScriptSourceToDebugFile = m_scriptEngine.ScriptConfigSource.GetBoolean("WriteScriptSourceToDebugFile", true); CompileWithDebugInformation = m_scriptEngine.ScriptConfigSource.GetBoolean("CompileWithDebugInformation", true); - CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true); + // CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true); // Get file prefix from scriptengine name and make it file system safe: FilePrefix = m_scriptEngine.ScriptEngineName; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs index 0bd3b0c..b615baa 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/YP2CSConverter.cs @@ -69,11 +69,14 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL YP.tell(myCS_SW); //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in Parser.parseInput(TermList)) { foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) { - ListPair VFC = new ListPair(FunctionCode, new Variable()); + // ListPair VFC = new ListPair(FunctionCode, new Variable()); //Console.WriteLine("-------------------------") //Console.WriteLine(FunctionCode.ToString()) //Console.WriteLine("-------------------------") @@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL //YPCompiler.convertStringCodesCSharp(VFC); } } + #pragma warning restore 0168 YP.seen(); myCS_SW.Close(); YP.told(); diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs index 250ad59..e6f10ca 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/BagofAnswers.cs @@ -113,6 +113,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 + /// /// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag. /// @@ -204,6 +208,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog bagOfAnswers.add(); return bagOfAnswers.resultSet(Bag); } + #pragma warning restore 0168 /// /// A TermArrayEqualityComparer implements IEqualityComparer to compare two object arrays using YP.termEqual. diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs index cfc6788..4327715 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/FindallAnswers.cs @@ -71,6 +71,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog return YP.unify(Bag, result); } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 + /// /// This is a simplified findall when the goal is a single call. /// @@ -99,5 +103,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog findallAnswers.add(); return findallAnswers.resultArray(); } + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs index 114e338..e023984 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor1.cs @@ -49,6 +49,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 public IEnumerable unify(object arg) { arg = YP.getValue(arg); @@ -67,6 +70,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog yield return false; } } + #pragma warning restore 0168 + public override string ToString() { diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs index 132d417..432d328 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor2.cs @@ -51,6 +51,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 public IEnumerable unify(object arg) { arg = YP.getValue(arg); @@ -72,6 +75,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog yield return false; } } + #pragma warning restore 0168 + public override string ToString() { diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs index 064ec19..b429608 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Functor3.cs @@ -53,6 +53,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 public IEnumerable unify(object arg) { arg = YP.getValue(arg); @@ -77,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog yield return false; } } + #pragma warning restore 0168 public override string ToString() { diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs index b2fad45..3ceb0df 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Parser.cs @@ -44,6 +44,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog yield return false; } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168, 0219 + // Debug: Hand-modify this central predicate to do tail recursion. public static IEnumerable read_tokens(object arg1, object arg2, object arg3) { @@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog // Compiler output follows. class YPInnerClass { } - static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } + // static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } public static IEnumerable parseInput(object TermList) { @@ -224,11 +228,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog if (YP.termEqual(Term, Atom.a(@"end_of_file"))) { yield break; - goto cutIf1; + // goto cutIf1; } yield return false; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4452,6 +4456,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog { } } } - + #pragma warning restore 0168, 0219 } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs index 7829770..281fb42 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/Variable.cs @@ -92,8 +92,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } else { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(this, arg)) yield return false; + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs index 68cfd3e..31f007f 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YP.cs @@ -561,6 +561,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog return _repeat; } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 public static IEnumerable univ(object Term, object List) { Term = YP.getValue(Term); @@ -1414,7 +1417,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog /// public static void script_event(object script_event, object script_params) { - string function = ((Atom)YP.getValue(script_event))._name; + // string function = ((Atom)YP.getValue(script_event))._name; object[] array = ListPair.toArray(script_params); if (array == null) return; // YP.fail(); @@ -1640,5 +1643,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog throw new NotImplementedException(); } } + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs index 572583b..8a22388 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/YieldProlog/YPCompiler.cs @@ -202,6 +202,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog return YP.unify(Symbol, Atom.a(Base.ToString() + ++((CompilerState)State)._gensymCounter)); } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 public static bool isDetNoneOut(object State, object Term) { State = YP.getValue(State); @@ -239,6 +242,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog return false; } + #pragma warning restore 0168 /// /// Return false if any of args is out, otherwise true. @@ -275,6 +279,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog } } + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168, 0219 + /// /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction /// to return an anonymous YP.IClause for the Head and Body of a rule clause. @@ -395,7 +403,7 @@ namespace Temporary { public static void repeatWrite(object arg1, object N) { { - object _Value = arg1; + // object _Value = arg1; if (YP.termEqual(N, 0)) { return; @@ -470,7 +478,7 @@ namespace Temporary { public static void processCompilerDirectives(object arg1, object arg2) { { - object _State = arg2; + // object _State = arg2; foreach (bool l2 in YP.unify(arg1, Atom.NIL)) { return; @@ -3939,12 +3947,12 @@ namespace Temporary { YP.nl(); convertStatementListCSharp(RestStatements, Level); return; - goto cutIf1; + // goto cutIf1; } convertStatementListCSharp(RestStatements, Level); return; - cutIf1: - { } + // cutIf1: + // { } } } { @@ -4111,12 +4119,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListCSharp(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListCSharp(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4266,13 +4274,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesCSharp(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesCSharp(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4623,12 +4631,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListJavascript(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListJavascript(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4777,7 +4785,7 @@ namespace Temporary { YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - goto cutIf1; + // goto cutIf1; } if (YP.termEqual(Code, 92)) { @@ -4785,13 +4793,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5420,12 +5428,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListPython(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListPython(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5573,7 +5581,7 @@ namespace Temporary { YP.put_code(Code); convertStringCodesPython(RestCodes); return; - goto cutIf1; + // goto cutIf1; } if (YP.termEqual(Code, 92)) { @@ -5581,13 +5589,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesPython(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesPython(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5646,6 +5654,6 @@ namespace Temporary { } } } - + #pragma warning restore 0168, 0219 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index fea3fc2..70a88fb 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -2776,7 +2776,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api m_host.AddScriptLPS(1); - uint partLocalID; + // uint partLocalID; LLUUID partItemID; switch ((int)linknum) @@ -2790,7 +2790,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10) { - partLocalID = part.LocalId; + // partLocalID = part.LocalId; partItemID = item.ItemID; object[] resobj = new object[] @@ -2815,7 +2815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10) { - partLocalID = partInst.LocalId; + // partLocalID = partInst.LocalId; partItemID = item.ItemID; Object[] resobj = new object[] { @@ -2843,7 +2843,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10) { - partLocalID = partInst.LocalId; + // partLocalID = partInst.LocalId; partItemID = item.ItemID; Object[] resobj = new object[] { @@ -2873,7 +2873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10) { - partLocalID = partInst.LocalId; + // partLocalID = partInst.LocalId; partItemID = item.ItemID; Object[] resobj = new object[] { @@ -2924,7 +2924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api { if (item.Type == 10) { - partLocalID = partInst.LocalId; + // partLocalID = partInst.LocalId; partItemID = item.ItemID; Object[] resObjDef = new object[] { @@ -3049,7 +3049,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } - double angle = 2 * Math.Acos(rot.s); + // double angle = 2 * Math.Acos(rot.s); double s = Math.Sqrt(1 - rot.s * rot.s); if (s < 0.001) { @@ -6592,7 +6592,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api while (count < len) { - int l = input[idx].Length; + // int l = input[idx].Length; string ln = input[idx]; int need = len-count-1; diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs index 70c1b5a..c52adb1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs @@ -127,19 +127,27 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // No unbound free variables, so we only filled one bag. If empty, bagof fails. if (_findallBagArray.Count > 0) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in bagArrayVariable.unify(_findallBagArray)) yield return false; + #pragma warning restore 0168 } } else { foreach (KeyValuePair> valuesAndBag in _bagForFreeVariables) { + // disable warning on l1 and l2, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key)) { foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value)) yield return false; } + #pragma warning restore 0168 // Debug: Should we free memory of the answers already returned? } } @@ -153,11 +161,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog public IEnumerable result(object Bag) { Variable bagArrayVariable = new Variable(); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in resultArray(bagArrayVariable)) { foreach (bool l2 in YP.unify(Bag, ListPair.make((List)bagArrayVariable.getValue()))) yield return false; } + #pragma warning restore 0168 } /// @@ -169,6 +181,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog public IEnumerable resultSet(object Bag) { Variable bagArrayVariable = new Variable(); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in resultArray(bagArrayVariable)) { List bagArray = (List)bagArrayVariable.getValue(); @@ -176,14 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray))) yield return false; } + #pragma warning restore 0168 } public static IEnumerable bagofArray (object Template, object Goal, IEnumerable goalIterator, Variable bagArrayVariable) { BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); + #pragma warning restore 0168 return bagOfAnswers.resultArray(bagArrayVariable); } @@ -191,8 +211,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog (object Template, object Goal, IEnumerable goalIterator, object Bag) { BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); + #pragma warning restore 0168 return bagOfAnswers.result(Bag); } @@ -200,8 +224,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog (object Template, object Goal, IEnumerable goalIterator, object Bag) { BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); + #pragma warning restore 0168 return bagOfAnswers.resultSet(Bag); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/FindallAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/FindallAnswers.cs index 28709e1..fbb173e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/FindallAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/FindallAnswers.cs @@ -81,8 +81,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog public static IEnumerable findall(object Template, IEnumerable goal, object Bag) { FindallAnswers findallAnswers = new FindallAnswers(Template); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in goal) findallAnswers.add(); + #pragma warning restore 0168 return findallAnswers.result(Bag); } @@ -95,8 +99,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog public static List findallArray(object Template, IEnumerable goal) { FindallAnswers findallAnswers = new FindallAnswers(Template); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in goal) findallAnswers.add(); + #pragma warning restore 0168 return findallAnswers.resultArray(); } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs index 3c0c1c4..69fbeee 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor1.cs @@ -57,14 +57,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor1 argFunctor = (Functor1)arg; if (_name.Equals(argFunctor._name)) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) yield return false; + #pragma warning restore 0168 } } else if (arg is Variable) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in ((Variable)arg).unify(this)) yield return false; + #pragma warning restore 0168 + } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs index 596b763..7e4f27d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs @@ -59,17 +59,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor2 argFunctor = (Functor2)arg; if (_name.Equals(argFunctor._name)) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) { foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) yield return false; } + #pragma warning restore 0168 } } else if (arg is Variable) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in ((Variable)arg).unify(this)) yield return false; + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs index 041cceb..6ef8327 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs @@ -61,6 +61,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Functor3 argFunctor = (Functor3)arg; if (_name.Equals(argFunctor._name)) { + // disable warning on l1, l2, l3 don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) { foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) @@ -69,12 +72,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog yield return false; } } + #pragma warning restore 0168 } } else if (arg is Variable) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in ((Variable)arg).unify(this)) yield return false; + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs index 105b556..e9dd8f1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs @@ -44,6 +44,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog yield return false; } + // disable warning about unused variables: the following code + // is infested with it. + #pragma warning disable 0168, 0219 + // Debug: Hand-modify this central predicate to do tail recursion. public static IEnumerable read_tokens(object arg1, object arg2, object arg3) { @@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // Compiler output follows. class YPInnerClass { } - static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } + // static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } public static IEnumerable parseInput(object TermList) { @@ -224,10 +228,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (YP.termEqual(Term, Atom.a(@"end_of_file"))) { yield break; - goto cutIf1; + // unreachable code: + // goto cutIf1; } yield return false; - cutIf1: + // cutIf1: { } } } @@ -4452,6 +4457,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { } } } - + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs index 2b5b0f1..8e2aa7e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs @@ -92,8 +92,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } else { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(this, arg)) yield return false; + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 74704aa..f0e8147 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -572,6 +572,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog Variable Name = new Variable(); Variable ArgList = new Variable(); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) { object[] args = ListPair.toArray(ArgList); @@ -585,6 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); } + #pragma warning restore 0168 return YP.fail(); } @@ -597,11 +601,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (!(Term is Variable)) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term))) { foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length)) yield return false; } + #pragma warning restore 0168 } else throw new NotImplementedException("Debug: must finish functor/3"); @@ -621,8 +629,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (argNumberInt >= 1 && argNumberInt <= termArgs.Length) { // The first ArgNumber is at 1, not 0. + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) yield return false; + #pragma warning restore 0168 } } } @@ -814,8 +826,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog object[] args = new object[] { Priority, Specifier, Operator }; foreach (object[] answer in _operatorTable) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unifyArrays(args, answer)) yield return false; + #pragma warning restore 0168 } } @@ -847,12 +863,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog int afterInt = atomAtom._name.Length - (beforeInt + lengthInt); if (afterInt >= 0) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(After, afterInt)) { foreach (bool l2 in YP.unify (Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt)))) yield return false; } + #pragma warning restore 0168 } } @@ -1201,9 +1221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT)) return false; // Use the same mapping to static predicates in YP as the compiler. + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable())) return false; // Debug: Do we need to check if name._module is null? + #pragma warning restore 0168 return true; } @@ -1342,9 +1366,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog foreach (NameArity key in _predicatesStore.Keys) { + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify (new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity)) yield return false; + #pragma warning restore 0168 } } @@ -1414,7 +1442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public static void script_event(object script_event, object script_params) { - string function = ((Atom)YP.getValue(script_event))._name; + // string function = ((Atom)YP.getValue(script_event))._name; object[] array = ListPair.toArray(script_params); if (array == null) return; // YP.fail(); @@ -1600,11 +1628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog if (_exception != null) { bool didUnify = false; + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in YP.unify(_exception._term, Catcher)) { didUnify = true; yield return false; } + #pragma warning restore 0168 + if (!didUnify) throw _exception; } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs index c2040c9..d6115ce 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs @@ -209,14 +209,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog object[] functorArgs = YP.getFunctorArgs(Term); Variable pred = new Variable(); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in ((CompilerState)State)._pred.match - (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) + (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) { if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) { return true; } } + #pragma warning restore 0168 return false; } @@ -228,14 +232,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog object[] functorArgs = YP.getFunctorArgs(Term); Variable pred = new Variable(); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in ((CompilerState)State)._pred.match - (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) + (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) { if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) { return true; } } + #pragma warning restore 0168 return false; } @@ -275,6 +283,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } } + // disable warning unused variables, the following code is + // infested with it. + #pragma warning disable 0168, 0219 + /// /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction /// to return an anonymous YP.IClause for the Head and Body of a rule clause. @@ -3939,12 +3951,12 @@ namespace Temporary { YP.nl(); convertStatementListCSharp(RestStatements, Level); return; - goto cutIf1; + // goto cutIf1; } convertStatementListCSharp(RestStatements, Level); return; - cutIf1: - { } + // cutIf1: + // { } } } { @@ -4111,12 +4123,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListCSharp(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListCSharp(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4266,13 +4278,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesCSharp(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesCSharp(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4623,12 +4635,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListJavascript(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListJavascript(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -4777,7 +4789,7 @@ namespace Temporary { YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - goto cutIf1; + // goto cutIf1; } if (YP.termEqual(Code, 92)) { @@ -4785,13 +4797,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesJavascript(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5420,12 +5432,12 @@ namespace Temporary { YP.write(Atom.a(@", ")); convertArgListPython(Tail); return; - goto cutIf1; + // goto cutIf1; } convertArgListPython(Tail); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5573,7 +5585,7 @@ namespace Temporary { YP.put_code(Code); convertStringCodesPython(RestCodes); return; - goto cutIf1; + // goto cutIf1; } if (YP.termEqual(Code, 92)) { @@ -5581,13 +5593,13 @@ namespace Temporary { YP.put_code(Code); convertStringCodesPython(RestCodes); return; - goto cutIf1; + // goto cutIf1; } YP.put_code(Code); convertStringCodesPython(RestCodes); return; - cutIf1: - { } + // cutIf1: + // { } } } } @@ -5646,6 +5658,7 @@ namespace Temporary { } } } + #pragma warning restore 0168 } } diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index 841ed26..d54d2f5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs @@ -40,8 +40,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { public class Compiler { - private static readonly log4net.ILog m_log - = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + // private static readonly log4net.ILog m_log + // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); // * Uses "LSL2Converter" to convert LSL to C# if necessary. // * Compiles C#-code into an assembly @@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp private static YP2CSConverter YP_Converter = new YP2CSConverter(); - private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files + // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files private static UInt64 scriptCompileCounter = 0; // And a counter public IScriptEngine m_scriptEngine; @@ -273,7 +273,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { Directory.CreateDirectory(ScriptEnginesPath); } - catch (Exception ex) + catch (Exception) { } } @@ -285,7 +285,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools { Directory.CreateDirectory(ScriptEnginesPath); } - catch (Exception ex) + catch (Exception) { } } @@ -486,7 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools // } string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); - string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location); + // string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location); //Console.WriteLine("Assembly location: " + rootPath); parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll")); parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll")); diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index 54b4861..69f9fdc 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs @@ -69,11 +69,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools YP.tell(myCS_SW); //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); + // disable warning on l1, don't see how we can + // code this differently + #pragma warning disable 0168 foreach (bool l1 in Parser.parseInput(TermList)) { foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) { - ListPair VFC = new ListPair(FunctionCode, new Variable()); + // ListPair VFC = new ListPair(FunctionCode, new Variable()); //Console.WriteLine("-------------------------") //Console.WriteLine(FunctionCode.ToString()) //Console.WriteLine("-------------------------") @@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools //YPCompiler.convertStringCodesCSharp(VFC); } } + #pragma warning restore 0168 YP.seen(); myCS_SW.Close(); YP.told(); diff --git a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs index e12f2bf..b848a02 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/Executor.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/Executor.cs @@ -73,7 +73,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine eventFlags |= kvp.Value; } } - catch(Exception e) + catch(Exception) { //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); } diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 1dc0b1e..3c1acb4 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine private Scene m_Scene; private IConfig m_ScriptConfig; private Compiler m_Compiler; - private EventManager m_EventManager; + // private EventManager m_EventManager; private int m_EventLimit; private bool m_KillTimedOutScripts; public AsyncCommandManager m_AsyncCommands; @@ -111,12 +111,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine get { return m_ScriptEngines; } } - private struct RezScriptParms - { - uint LocalID; - LLUUID ItemID; - string Script; - } + // private struct RezScriptParms + // { + // uint LocalID; + // LLUUID ItemID; + // string Script; + // } public IConfig Config { @@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine m_ScriptEngines.Add(this); } - m_EventManager = new EventManager(this); + // m_EventManager = new EventManager(this); StartEngine(minThreads, maxThreads, idleTimeout, prio, maxScriptQueue, stackSize); @@ -527,7 +527,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (File.Exists(m_Assemblies[assetID]+".mdb")) File.Delete(m_Assemblies[assetID]+".mdb"); } - catch (Exception e) + catch (Exception) { } m_Assemblies.Remove(assetID); -- cgit v1.1