diff options
Diffstat (limited to '')
28 files changed, 266 insertions, 98 deletions
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 | |||
3122 | 3122 | ||
3123 | } | 3123 | } |
3124 | 3124 | ||
3125 | double angle = 2 * Math.Acos(rot.s); | 3125 | // double angle = 2 * Math.Acos(rot.s); |
3126 | double s = Math.Sqrt(1 - rot.s * rot.s); | 3126 | double s = Math.Sqrt(1 - rot.s * rot.s); |
3127 | if (s < 0.001) | 3127 | if (s < 0.001) |
3128 | { | 3128 | { |
@@ -3960,7 +3960,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
3960 | { | 3960 | { |
3961 | int index = str.IndexOf(delimiters[i].ToString()); | 3961 | int index = str.IndexOf(delimiters[i].ToString()); |
3962 | bool found = index != -1; | 3962 | bool found = index != -1; |
3963 | if (found && String.Empty != delimiters[i]) | 3963 | if (found && String.Empty != (string)delimiters[i]) |
3964 | { | 3964 | { |
3965 | if ((cindex > index) || (cindex == -1)) | 3965 | if ((cindex > index) || (cindex == -1)) |
3966 | { | 3966 | { |
@@ -4049,7 +4049,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
4049 | 4049 | ||
4050 | private String[] GetNotecardLines(string name) | 4050 | private String[] GetNotecardLines(string name) |
4051 | { | 4051 | { |
4052 | bool found = false; | 4052 | // bool found = false; |
4053 | int notecardIndex = 0; | 4053 | int notecardIndex = 0; |
4054 | String[] notecardLines = { "0" }; | 4054 | String[] notecardLines = { "0" }; |
4055 | notecardLines[0] = String.Empty; | 4055 | 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 | |||
125 | } | 125 | } |
126 | } | 126 | } |
127 | 127 | ||
128 | private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception | 128 | // private ScriptEngine lastScriptEngine; // Keep track of what ScriptEngine instance we are at so we can give exception |
129 | /// <summary> | 129 | /// <summary> |
130 | /// A thread should run in this loop and check all running scripts | 130 | /// A thread should run in this loop and check all running scripts |
131 | /// </summary> | 131 | /// </summary> |
@@ -171,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
171 | //{ | 171 | //{ |
172 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) | 172 | foreach (ScriptEngine m_ScriptEngine in new ArrayList(ScriptEngine.ScriptEngines)) |
173 | { | 173 | { |
174 | lastScriptEngine = m_ScriptEngine; | 174 | // lastScriptEngine = m_ScriptEngine; |
175 | // Re-reading config every x seconds | 175 | // Re-reading config every x seconds |
176 | if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other) | 176 | if (MaintenanceLoopTicks_Other_Count >= MaintenanceLoopTicks_Other) |
177 | { | 177 | { |
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 | |||
59 | 59 | ||
60 | private Thread scriptLoadUnloadThread; | 60 | private Thread scriptLoadUnloadThread; |
61 | private static Thread staticScriptLoadUnloadThread; | 61 | private static Thread staticScriptLoadUnloadThread; |
62 | private int scriptLoadUnloadThread_IdleSleepms; | 62 | // private int scriptLoadUnloadThread_IdleSleepms; |
63 | private Queue<LUStruct> LUQueue = new Queue<LUStruct>(); | 63 | private Queue<LUStruct> LUQueue = new Queue<LUStruct>(); |
64 | private static bool PrivateThread; | 64 | private static bool PrivateThread; |
65 | private int LoadUnloadMaxQueueSize; | 65 | private int LoadUnloadMaxQueueSize; |
@@ -100,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
100 | 100 | ||
101 | public void ReadConfig() | 101 | public void ReadConfig() |
102 | { | 102 | { |
103 | scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30); | 103 | // scriptLoadUnloadThread_IdleSleepms = m_scriptEngine.ScriptConfigSource.GetInt("ScriptLoadUnloadLoopms", 30); |
104 | // TODO: Requires sharing of all ScriptManagers to single thread | 104 | // TODO: Requires sharing of all ScriptManagers to single thread |
105 | PrivateThread = true; // m_scriptEngine.ScriptConfigSource.GetBoolean("PrivateScriptLoadUnloadThread", false); | 105 | PrivateThread = true; // m_scriptEngine.ScriptConfigSource.GetBoolean("PrivateScriptLoadUnloadThread", false); |
106 | LoadUnloadMaxQueueSize = m_scriptEngine.ScriptConfigSource.GetInt("LoadUnloadMaxQueueSize", 100); | 106 | LoadUnloadMaxQueueSize = m_scriptEngine.ScriptConfigSource.GetInt("LoadUnloadMaxQueueSize", 100); |
@@ -245,7 +245,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
245 | 245 | ||
246 | #region Start/Stop/Reset script | 246 | #region Start/Stop/Reset script |
247 | 247 | ||
248 | private readonly Object startStopLock = new Object(); | 248 | // private readonly Object startStopLock = new Object(); |
249 | 249 | ||
250 | /// <summary> | 250 | /// <summary> |
251 | /// Fetches, loads and hooks up a script to an objects events | 251 | /// 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 | |||
65 | private enumCompileType DefaultCompileLanguage; | 65 | private enumCompileType DefaultCompileLanguage; |
66 | private bool WriteScriptSourceToDebugFile; | 66 | private bool WriteScriptSourceToDebugFile; |
67 | private bool CompileWithDebugInformation; | 67 | private bool CompileWithDebugInformation; |
68 | private bool CleanUpOldScriptsOnStartup; | 68 | // private bool CleanUpOldScriptsOnStartup; |
69 | private Dictionary<string, bool> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase); | 69 | private Dictionary<string, bool> AllowedCompilers = new Dictionary<string, bool>(StringComparer.CurrentCultureIgnoreCase); |
70 | private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); | 70 | private Dictionary<string, enumCompileType> LanguageMapping = new Dictionary<string, enumCompileType>(StringComparer.CurrentCultureIgnoreCase); |
71 | 71 | ||
@@ -95,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
95 | // Get some config | 95 | // Get some config |
96 | WriteScriptSourceToDebugFile = m_scriptEngine.ScriptConfigSource.GetBoolean("WriteScriptSourceToDebugFile", true); | 96 | WriteScriptSourceToDebugFile = m_scriptEngine.ScriptConfigSource.GetBoolean("WriteScriptSourceToDebugFile", true); |
97 | CompileWithDebugInformation = m_scriptEngine.ScriptConfigSource.GetBoolean("CompileWithDebugInformation", true); | 97 | CompileWithDebugInformation = m_scriptEngine.ScriptConfigSource.GetBoolean("CompileWithDebugInformation", true); |
98 | CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true); | 98 | // CleanUpOldScriptsOnStartup = m_scriptEngine.ScriptConfigSource.GetBoolean("CleanUpOldScriptsOnStartup", true); |
99 | 99 | ||
100 | // Get file prefix from scriptengine name and make it file system safe: | 100 | // Get file prefix from scriptengine name and make it file system safe: |
101 | FilePrefix = m_scriptEngine.ScriptEngineName; | 101 | 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 | |||
69 | YP.tell(myCS_SW); | 69 | YP.tell(myCS_SW); |
70 | 70 | ||
71 | //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); | 71 | //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); |
72 | // disable warning on l1, don't see how we can | ||
73 | // code this differently | ||
74 | #pragma warning disable 0168 | ||
72 | foreach (bool l1 in Parser.parseInput(TermList)) | 75 | foreach (bool l1 in Parser.parseInput(TermList)) |
73 | { | 76 | { |
74 | foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) | 77 | foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) |
75 | { | 78 | { |
76 | ListPair VFC = new ListPair(FunctionCode, new Variable()); | 79 | // ListPair VFC = new ListPair(FunctionCode, new Variable()); |
77 | //Console.WriteLine("-------------------------") | 80 | //Console.WriteLine("-------------------------") |
78 | //Console.WriteLine(FunctionCode.ToString()) | 81 | //Console.WriteLine(FunctionCode.ToString()) |
79 | //Console.WriteLine("-------------------------") | 82 | //Console.WriteLine("-------------------------") |
@@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL | |||
81 | //YPCompiler.convertStringCodesCSharp(VFC); | 84 | //YPCompiler.convertStringCodesCSharp(VFC); |
82 | } | 85 | } |
83 | } | 86 | } |
87 | #pragma warning restore 0168 | ||
84 | YP.seen(); | 88 | YP.seen(); |
85 | myCS_SW.Close(); | 89 | myCS_SW.Close(); |
86 | YP.told(); | 90 | 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 | |||
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | // disable warning on l1, don't see how we can | ||
117 | // code this differently | ||
118 | #pragma warning disable 0168 | ||
119 | |||
116 | /// <summary> | 120 | /// <summary> |
117 | /// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag. | 121 | /// For each result, unify the _freeVariables and unify bagArrayVariable with the associated bag. |
118 | /// </summary> | 122 | /// </summary> |
@@ -204,6 +208,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
204 | bagOfAnswers.add(); | 208 | bagOfAnswers.add(); |
205 | return bagOfAnswers.resultSet(Bag); | 209 | return bagOfAnswers.resultSet(Bag); |
206 | } | 210 | } |
211 | #pragma warning restore 0168 | ||
207 | 212 | ||
208 | /// <summary> | 213 | /// <summary> |
209 | /// A TermArrayEqualityComparer implements IEqualityComparer to compare two object arrays using YP.termEqual. | 214 | /// 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 | |||
71 | return YP.unify(Bag, result); | 71 | return YP.unify(Bag, result); |
72 | } | 72 | } |
73 | 73 | ||
74 | // disable warning on l1, don't see how we can | ||
75 | // code this differently | ||
76 | #pragma warning disable 0168 | ||
77 | |||
74 | /// <summary> | 78 | /// <summary> |
75 | /// This is a simplified findall when the goal is a single call. | 79 | /// This is a simplified findall when the goal is a single call. |
76 | /// </summary> | 80 | /// </summary> |
@@ -99,5 +103,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
99 | findallAnswers.add(); | 103 | findallAnswers.add(); |
100 | return findallAnswers.resultArray(); | 104 | return findallAnswers.resultArray(); |
101 | } | 105 | } |
106 | #pragma warning restore 0168 | ||
102 | } | 107 | } |
103 | } | 108 | } |
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 | |||
49 | { | 49 | { |
50 | } | 50 | } |
51 | 51 | ||
52 | // disable warning on l1, don't see how we can | ||
53 | // code this differently | ||
54 | #pragma warning disable 0168 | ||
52 | public IEnumerable<bool> unify(object arg) | 55 | public IEnumerable<bool> unify(object arg) |
53 | { | 56 | { |
54 | arg = YP.getValue(arg); | 57 | arg = YP.getValue(arg); |
@@ -67,6 +70,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
67 | yield return false; | 70 | yield return false; |
68 | } | 71 | } |
69 | } | 72 | } |
73 | #pragma warning restore 0168 | ||
74 | |||
70 | 75 | ||
71 | public override string ToString() | 76 | public override string ToString() |
72 | { | 77 | { |
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 | |||
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | // disable warning on l1, don't see how we can | ||
55 | // code this differently | ||
56 | #pragma warning disable 0168 | ||
54 | public IEnumerable<bool> unify(object arg) | 57 | public IEnumerable<bool> unify(object arg) |
55 | { | 58 | { |
56 | arg = YP.getValue(arg); | 59 | arg = YP.getValue(arg); |
@@ -72,6 +75,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
72 | yield return false; | 75 | yield return false; |
73 | } | 76 | } |
74 | } | 77 | } |
78 | #pragma warning restore 0168 | ||
79 | |||
75 | 80 | ||
76 | public override string ToString() | 81 | public override string ToString() |
77 | { | 82 | { |
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 | |||
53 | { | 53 | { |
54 | } | 54 | } |
55 | 55 | ||
56 | // disable warning on l1, don't see how we can | ||
57 | // code this differently | ||
58 | #pragma warning disable 0168 | ||
56 | public IEnumerable<bool> unify(object arg) | 59 | public IEnumerable<bool> unify(object arg) |
57 | { | 60 | { |
58 | arg = YP.getValue(arg); | 61 | arg = YP.getValue(arg); |
@@ -77,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
77 | yield return false; | 80 | yield return false; |
78 | } | 81 | } |
79 | } | 82 | } |
83 | #pragma warning restore 0168 | ||
80 | 84 | ||
81 | public override string ToString() | 85 | public override string ToString() |
82 | { | 86 | { |
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 | |||
44 | yield return false; | 44 | yield return false; |
45 | } | 45 | } |
46 | 46 | ||
47 | // disable warning on l1, don't see how we can | ||
48 | // code this differently | ||
49 | #pragma warning disable 0168, 0219 | ||
50 | |||
47 | // Debug: Hand-modify this central predicate to do tail recursion. | 51 | // Debug: Hand-modify this central predicate to do tail recursion. |
48 | public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3) | 52 | public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3) |
49 | { | 53 | { |
@@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
188 | // Compiler output follows. | 192 | // Compiler output follows. |
189 | 193 | ||
190 | class YPInnerClass { } | 194 | class YPInnerClass { } |
191 | static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } | 195 | // static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } |
192 | 196 | ||
193 | public static IEnumerable<bool> parseInput(object TermList) | 197 | public static IEnumerable<bool> parseInput(object TermList) |
194 | { | 198 | { |
@@ -224,11 +228,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
224 | if (YP.termEqual(Term, Atom.a(@"end_of_file"))) | 228 | if (YP.termEqual(Term, Atom.a(@"end_of_file"))) |
225 | { | 229 | { |
226 | yield break; | 230 | yield break; |
227 | goto cutIf1; | 231 | // goto cutIf1; |
228 | } | 232 | } |
229 | yield return false; | 233 | yield return false; |
230 | cutIf1: | 234 | // cutIf1: |
231 | { } | 235 | // { } |
232 | } | 236 | } |
233 | } | 237 | } |
234 | } | 238 | } |
@@ -4452,6 +4456,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
4452 | { } | 4456 | { } |
4453 | } | 4457 | } |
4454 | } | 4458 | } |
4455 | 4459 | #pragma warning restore 0168, 0219 | |
4456 | } | 4460 | } |
4457 | } | 4461 | } |
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 | |||
92 | } | 92 | } |
93 | else | 93 | else |
94 | { | 94 | { |
95 | // disable warning on l1, don't see how we can | ||
96 | // code this differently | ||
97 | #pragma warning disable 0168 | ||
95 | foreach (bool l1 in YP.unify(this, arg)) | 98 | foreach (bool l1 in YP.unify(this, arg)) |
96 | yield return false; | 99 | yield return false; |
100 | #pragma warning restore 0168 | ||
97 | } | 101 | } |
98 | } | 102 | } |
99 | 103 | ||
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 | |||
561 | return _repeat; | 561 | return _repeat; |
562 | } | 562 | } |
563 | 563 | ||
564 | // disable warning on l1, don't see how we can | ||
565 | // code this differently | ||
566 | #pragma warning disable 0168 | ||
564 | public static IEnumerable<bool> univ(object Term, object List) | 567 | public static IEnumerable<bool> univ(object Term, object List) |
565 | { | 568 | { |
566 | Term = YP.getValue(Term); | 569 | Term = YP.getValue(Term); |
@@ -1414,7 +1417,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1414 | /// <returns></returns> | 1417 | /// <returns></returns> |
1415 | public static void script_event(object script_event, object script_params) | 1418 | public static void script_event(object script_event, object script_params) |
1416 | { | 1419 | { |
1417 | string function = ((Atom)YP.getValue(script_event))._name; | 1420 | // string function = ((Atom)YP.getValue(script_event))._name; |
1418 | object[] array = ListPair.toArray(script_params); | 1421 | object[] array = ListPair.toArray(script_params); |
1419 | if (array == null) | 1422 | if (array == null) |
1420 | return; // YP.fail(); | 1423 | return; // YP.fail(); |
@@ -1640,5 +1643,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
1640 | throw new NotImplementedException(); | 1643 | throw new NotImplementedException(); |
1641 | } | 1644 | } |
1642 | } | 1645 | } |
1646 | #pragma warning restore 0168 | ||
1643 | } | 1647 | } |
1644 | } | 1648 | } |
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 | |||
202 | return YP.unify(Symbol, Atom.a(Base.ToString() + ++((CompilerState)State)._gensymCounter)); | 202 | return YP.unify(Symbol, Atom.a(Base.ToString() + ++((CompilerState)State)._gensymCounter)); |
203 | } | 203 | } |
204 | 204 | ||
205 | // disable warning on l1, don't see how we can | ||
206 | // code this differently | ||
207 | #pragma warning disable 0168 | ||
205 | public static bool isDetNoneOut(object State, object Term) | 208 | public static bool isDetNoneOut(object State, object Term) |
206 | { | 209 | { |
207 | State = YP.getValue(State); | 210 | State = YP.getValue(State); |
@@ -239,6 +242,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
239 | 242 | ||
240 | return false; | 243 | return false; |
241 | } | 244 | } |
245 | #pragma warning restore 0168 | ||
242 | 246 | ||
243 | /// <summary> | 247 | /// <summary> |
244 | /// Return false if any of args is out, otherwise true. | 248 | /// Return false if any of args is out, otherwise true. |
@@ -275,6 +279,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.YieldProlog | |||
275 | } | 279 | } |
276 | } | 280 | } |
277 | 281 | ||
282 | // disable warning on l1, don't see how we can | ||
283 | // code this differently | ||
284 | #pragma warning disable 0168, 0219 | ||
285 | |||
278 | /// <summary> | 286 | /// <summary> |
279 | /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction | 287 | /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction |
280 | /// to return an anonymous YP.IClause for the Head and Body of a rule clause. | 288 | /// to return an anonymous YP.IClause for the Head and Body of a rule clause. |
@@ -395,7 +403,7 @@ namespace Temporary { | |||
395 | public static void repeatWrite(object arg1, object N) | 403 | public static void repeatWrite(object arg1, object N) |
396 | { | 404 | { |
397 | { | 405 | { |
398 | object _Value = arg1; | 406 | // object _Value = arg1; |
399 | if (YP.termEqual(N, 0)) | 407 | if (YP.termEqual(N, 0)) |
400 | { | 408 | { |
401 | return; | 409 | return; |
@@ -470,7 +478,7 @@ namespace Temporary { | |||
470 | public static void processCompilerDirectives(object arg1, object arg2) | 478 | public static void processCompilerDirectives(object arg1, object arg2) |
471 | { | 479 | { |
472 | { | 480 | { |
473 | object _State = arg2; | 481 | // object _State = arg2; |
474 | foreach (bool l2 in YP.unify(arg1, Atom.NIL)) | 482 | foreach (bool l2 in YP.unify(arg1, Atom.NIL)) |
475 | { | 483 | { |
476 | return; | 484 | return; |
@@ -3939,12 +3947,12 @@ namespace Temporary { | |||
3939 | YP.nl(); | 3947 | YP.nl(); |
3940 | convertStatementListCSharp(RestStatements, Level); | 3948 | convertStatementListCSharp(RestStatements, Level); |
3941 | return; | 3949 | return; |
3942 | goto cutIf1; | 3950 | // goto cutIf1; |
3943 | } | 3951 | } |
3944 | convertStatementListCSharp(RestStatements, Level); | 3952 | convertStatementListCSharp(RestStatements, Level); |
3945 | return; | 3953 | return; |
3946 | cutIf1: | 3954 | // cutIf1: |
3947 | { } | 3955 | // { } |
3948 | } | 3956 | } |
3949 | } | 3957 | } |
3950 | { | 3958 | { |
@@ -4111,12 +4119,12 @@ namespace Temporary { | |||
4111 | YP.write(Atom.a(@", ")); | 4119 | YP.write(Atom.a(@", ")); |
4112 | convertArgListCSharp(Tail); | 4120 | convertArgListCSharp(Tail); |
4113 | return; | 4121 | return; |
4114 | goto cutIf1; | 4122 | // goto cutIf1; |
4115 | } | 4123 | } |
4116 | convertArgListCSharp(Tail); | 4124 | convertArgListCSharp(Tail); |
4117 | return; | 4125 | return; |
4118 | cutIf1: | 4126 | // cutIf1: |
4119 | { } | 4127 | // { } |
4120 | } | 4128 | } |
4121 | } | 4129 | } |
4122 | } | 4130 | } |
@@ -4266,13 +4274,13 @@ namespace Temporary { | |||
4266 | YP.put_code(Code); | 4274 | YP.put_code(Code); |
4267 | convertStringCodesCSharp(RestCodes); | 4275 | convertStringCodesCSharp(RestCodes); |
4268 | return; | 4276 | return; |
4269 | goto cutIf1; | 4277 | // goto cutIf1; |
4270 | } | 4278 | } |
4271 | YP.put_code(Code); | 4279 | YP.put_code(Code); |
4272 | convertStringCodesCSharp(RestCodes); | 4280 | convertStringCodesCSharp(RestCodes); |
4273 | return; | 4281 | return; |
4274 | cutIf1: | 4282 | // cutIf1: |
4275 | { } | 4283 | // { } |
4276 | } | 4284 | } |
4277 | } | 4285 | } |
4278 | } | 4286 | } |
@@ -4623,12 +4631,12 @@ namespace Temporary { | |||
4623 | YP.write(Atom.a(@", ")); | 4631 | YP.write(Atom.a(@", ")); |
4624 | convertArgListJavascript(Tail); | 4632 | convertArgListJavascript(Tail); |
4625 | return; | 4633 | return; |
4626 | goto cutIf1; | 4634 | // goto cutIf1; |
4627 | } | 4635 | } |
4628 | convertArgListJavascript(Tail); | 4636 | convertArgListJavascript(Tail); |
4629 | return; | 4637 | return; |
4630 | cutIf1: | 4638 | // cutIf1: |
4631 | { } | 4639 | // { } |
4632 | } | 4640 | } |
4633 | } | 4641 | } |
4634 | } | 4642 | } |
@@ -4777,7 +4785,7 @@ namespace Temporary { | |||
4777 | YP.put_code(Code); | 4785 | YP.put_code(Code); |
4778 | convertStringCodesJavascript(RestCodes); | 4786 | convertStringCodesJavascript(RestCodes); |
4779 | return; | 4787 | return; |
4780 | goto cutIf1; | 4788 | // goto cutIf1; |
4781 | } | 4789 | } |
4782 | if (YP.termEqual(Code, 92)) | 4790 | if (YP.termEqual(Code, 92)) |
4783 | { | 4791 | { |
@@ -4785,13 +4793,13 @@ namespace Temporary { | |||
4785 | YP.put_code(Code); | 4793 | YP.put_code(Code); |
4786 | convertStringCodesJavascript(RestCodes); | 4794 | convertStringCodesJavascript(RestCodes); |
4787 | return; | 4795 | return; |
4788 | goto cutIf1; | 4796 | // goto cutIf1; |
4789 | } | 4797 | } |
4790 | YP.put_code(Code); | 4798 | YP.put_code(Code); |
4791 | convertStringCodesJavascript(RestCodes); | 4799 | convertStringCodesJavascript(RestCodes); |
4792 | return; | 4800 | return; |
4793 | cutIf1: | 4801 | // cutIf1: |
4794 | { } | 4802 | // { } |
4795 | } | 4803 | } |
4796 | } | 4804 | } |
4797 | } | 4805 | } |
@@ -5420,12 +5428,12 @@ namespace Temporary { | |||
5420 | YP.write(Atom.a(@", ")); | 5428 | YP.write(Atom.a(@", ")); |
5421 | convertArgListPython(Tail); | 5429 | convertArgListPython(Tail); |
5422 | return; | 5430 | return; |
5423 | goto cutIf1; | 5431 | // goto cutIf1; |
5424 | } | 5432 | } |
5425 | convertArgListPython(Tail); | 5433 | convertArgListPython(Tail); |
5426 | return; | 5434 | return; |
5427 | cutIf1: | 5435 | // cutIf1: |
5428 | { } | 5436 | // { } |
5429 | } | 5437 | } |
5430 | } | 5438 | } |
5431 | } | 5439 | } |
@@ -5573,7 +5581,7 @@ namespace Temporary { | |||
5573 | YP.put_code(Code); | 5581 | YP.put_code(Code); |
5574 | convertStringCodesPython(RestCodes); | 5582 | convertStringCodesPython(RestCodes); |
5575 | return; | 5583 | return; |
5576 | goto cutIf1; | 5584 | // goto cutIf1; |
5577 | } | 5585 | } |
5578 | if (YP.termEqual(Code, 92)) | 5586 | if (YP.termEqual(Code, 92)) |
5579 | { | 5587 | { |
@@ -5581,13 +5589,13 @@ namespace Temporary { | |||
5581 | YP.put_code(Code); | 5589 | YP.put_code(Code); |
5582 | convertStringCodesPython(RestCodes); | 5590 | convertStringCodesPython(RestCodes); |
5583 | return; | 5591 | return; |
5584 | goto cutIf1; | 5592 | // goto cutIf1; |
5585 | } | 5593 | } |
5586 | YP.put_code(Code); | 5594 | YP.put_code(Code); |
5587 | convertStringCodesPython(RestCodes); | 5595 | convertStringCodesPython(RestCodes); |
5588 | return; | 5596 | return; |
5589 | cutIf1: | 5597 | // cutIf1: |
5590 | { } | 5598 | // { } |
5591 | } | 5599 | } |
5592 | } | 5600 | } |
5593 | } | 5601 | } |
@@ -5646,6 +5654,6 @@ namespace Temporary { | |||
5646 | } | 5654 | } |
5647 | } | 5655 | } |
5648 | } | 5656 | } |
5649 | 5657 | #pragma warning restore 0168, 0219 | |
5650 | } | 5658 | } |
5651 | } | 5659 | } |
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 | |||
2776 | 2776 | ||
2777 | m_host.AddScriptLPS(1); | 2777 | m_host.AddScriptLPS(1); |
2778 | 2778 | ||
2779 | uint partLocalID; | 2779 | // uint partLocalID; |
2780 | LLUUID partItemID; | 2780 | LLUUID partItemID; |
2781 | 2781 | ||
2782 | switch ((int)linknum) | 2782 | switch ((int)linknum) |
@@ -2790,7 +2790,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2790 | { | 2790 | { |
2791 | if (item.Type == 10) | 2791 | if (item.Type == 10) |
2792 | { | 2792 | { |
2793 | partLocalID = part.LocalId; | 2793 | // partLocalID = part.LocalId; |
2794 | partItemID = item.ItemID; | 2794 | partItemID = item.ItemID; |
2795 | 2795 | ||
2796 | object[] resobj = new object[] | 2796 | object[] resobj = new object[] |
@@ -2815,7 +2815,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2815 | { | 2815 | { |
2816 | if (item.Type == 10) | 2816 | if (item.Type == 10) |
2817 | { | 2817 | { |
2818 | partLocalID = partInst.LocalId; | 2818 | // partLocalID = partInst.LocalId; |
2819 | partItemID = item.ItemID; | 2819 | partItemID = item.ItemID; |
2820 | Object[] resobj = new object[] | 2820 | Object[] resobj = new object[] |
2821 | { | 2821 | { |
@@ -2843,7 +2843,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2843 | { | 2843 | { |
2844 | if (item.Type == 10) | 2844 | if (item.Type == 10) |
2845 | { | 2845 | { |
2846 | partLocalID = partInst.LocalId; | 2846 | // partLocalID = partInst.LocalId; |
2847 | partItemID = item.ItemID; | 2847 | partItemID = item.ItemID; |
2848 | Object[] resobj = new object[] | 2848 | Object[] resobj = new object[] |
2849 | { | 2849 | { |
@@ -2873,7 +2873,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2873 | { | 2873 | { |
2874 | if (item.Type == 10) | 2874 | if (item.Type == 10) |
2875 | { | 2875 | { |
2876 | partLocalID = partInst.LocalId; | 2876 | // partLocalID = partInst.LocalId; |
2877 | partItemID = item.ItemID; | 2877 | partItemID = item.ItemID; |
2878 | Object[] resobj = new object[] | 2878 | Object[] resobj = new object[] |
2879 | { | 2879 | { |
@@ -2924,7 +2924,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
2924 | { | 2924 | { |
2925 | if (item.Type == 10) | 2925 | if (item.Type == 10) |
2926 | { | 2926 | { |
2927 | partLocalID = partInst.LocalId; | 2927 | // partLocalID = partInst.LocalId; |
2928 | partItemID = item.ItemID; | 2928 | partItemID = item.ItemID; |
2929 | Object[] resObjDef = new object[] | 2929 | Object[] resObjDef = new object[] |
2930 | { | 2930 | { |
@@ -3049,7 +3049,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3049 | 3049 | ||
3050 | } | 3050 | } |
3051 | 3051 | ||
3052 | double angle = 2 * Math.Acos(rot.s); | 3052 | // double angle = 2 * Math.Acos(rot.s); |
3053 | double s = Math.Sqrt(1 - rot.s * rot.s); | 3053 | double s = Math.Sqrt(1 - rot.s * rot.s); |
3054 | if (s < 0.001) | 3054 | if (s < 0.001) |
3055 | { | 3055 | { |
@@ -6592,7 +6592,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6592 | 6592 | ||
6593 | while (count < len) | 6593 | while (count < len) |
6594 | { | 6594 | { |
6595 | int l = input[idx].Length; | 6595 | // int l = input[idx].Length; |
6596 | string ln = input[idx]; | 6596 | string ln = input[idx]; |
6597 | 6597 | ||
6598 | int need = len-count-1; | 6598 | 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 | |||
127 | // No unbound free variables, so we only filled one bag. If empty, bagof fails. | 127 | // No unbound free variables, so we only filled one bag. If empty, bagof fails. |
128 | if (_findallBagArray.Count > 0) | 128 | if (_findallBagArray.Count > 0) |
129 | { | 129 | { |
130 | // disable warning on l1, don't see how we can | ||
131 | // code this differently | ||
132 | #pragma warning disable 0168 | ||
130 | foreach (bool l1 in bagArrayVariable.unify(_findallBagArray)) | 133 | foreach (bool l1 in bagArrayVariable.unify(_findallBagArray)) |
131 | yield return false; | 134 | yield return false; |
135 | #pragma warning restore 0168 | ||
132 | } | 136 | } |
133 | } | 137 | } |
134 | else | 138 | else |
135 | { | 139 | { |
136 | foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables) | 140 | foreach (KeyValuePair<object[], List<object>> valuesAndBag in _bagForFreeVariables) |
137 | { | 141 | { |
142 | // disable warning on l1 and l2, don't see how we can | ||
143 | // code this differently | ||
144 | #pragma warning disable 0168 | ||
138 | foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key)) | 145 | foreach (bool l1 in YP.unifyArrays(_freeVariables, valuesAndBag.Key)) |
139 | { | 146 | { |
140 | foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value)) | 147 | foreach (bool l2 in bagArrayVariable.unify(valuesAndBag.Value)) |
141 | yield return false; | 148 | yield return false; |
142 | } | 149 | } |
150 | #pragma warning restore 0168 | ||
143 | // Debug: Should we free memory of the answers already returned? | 151 | // Debug: Should we free memory of the answers already returned? |
144 | } | 152 | } |
145 | } | 153 | } |
@@ -153,11 +161,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
153 | public IEnumerable<bool> result(object Bag) | 161 | public IEnumerable<bool> result(object Bag) |
154 | { | 162 | { |
155 | Variable bagArrayVariable = new Variable(); | 163 | Variable bagArrayVariable = new Variable(); |
164 | // disable warning on l1, don't see how we can | ||
165 | // code this differently | ||
166 | #pragma warning disable 0168 | ||
156 | foreach (bool l1 in resultArray(bagArrayVariable)) | 167 | foreach (bool l1 in resultArray(bagArrayVariable)) |
157 | { | 168 | { |
158 | foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue()))) | 169 | foreach (bool l2 in YP.unify(Bag, ListPair.make((List<object>)bagArrayVariable.getValue()))) |
159 | yield return false; | 170 | yield return false; |
160 | } | 171 | } |
172 | #pragma warning restore 0168 | ||
161 | } | 173 | } |
162 | 174 | ||
163 | /// <summary> | 175 | /// <summary> |
@@ -169,6 +181,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
169 | public IEnumerable<bool> resultSet(object Bag) | 181 | public IEnumerable<bool> resultSet(object Bag) |
170 | { | 182 | { |
171 | Variable bagArrayVariable = new Variable(); | 183 | Variable bagArrayVariable = new Variable(); |
184 | // disable warning on l1, don't see how we can | ||
185 | // code this differently | ||
186 | #pragma warning disable 0168 | ||
172 | foreach (bool l1 in resultArray(bagArrayVariable)) | 187 | foreach (bool l1 in resultArray(bagArrayVariable)) |
173 | { | 188 | { |
174 | List<object> bagArray = (List<object>)bagArrayVariable.getValue(); | 189 | List<object> bagArray = (List<object>)bagArrayVariable.getValue(); |
@@ -176,14 +191,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
176 | foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray))) | 191 | foreach (bool l2 in YP.unify(Bag, ListPair.makeWithoutRepeatedTerms(bagArray))) |
177 | yield return false; | 192 | yield return false; |
178 | } | 193 | } |
194 | #pragma warning restore 0168 | ||
179 | } | 195 | } |
180 | 196 | ||
181 | public static IEnumerable<bool> bagofArray | 197 | public static IEnumerable<bool> bagofArray |
182 | (object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable) | 198 | (object Template, object Goal, IEnumerable<bool> goalIterator, Variable bagArrayVariable) |
183 | { | 199 | { |
184 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); | 200 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); |
201 | // disable warning on l1, don't see how we can | ||
202 | // code this differently | ||
203 | #pragma warning disable 0168 | ||
185 | foreach (bool l1 in goalIterator) | 204 | foreach (bool l1 in goalIterator) |
186 | bagOfAnswers.add(); | 205 | bagOfAnswers.add(); |
206 | #pragma warning restore 0168 | ||
187 | return bagOfAnswers.resultArray(bagArrayVariable); | 207 | return bagOfAnswers.resultArray(bagArrayVariable); |
188 | } | 208 | } |
189 | 209 | ||
@@ -191,8 +211,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
191 | (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) | 211 | (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) |
192 | { | 212 | { |
193 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); | 213 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); |
214 | // disable warning on l1, don't see how we can | ||
215 | // code this differently | ||
216 | #pragma warning disable 0168 | ||
194 | foreach (bool l1 in goalIterator) | 217 | foreach (bool l1 in goalIterator) |
195 | bagOfAnswers.add(); | 218 | bagOfAnswers.add(); |
219 | #pragma warning restore 0168 | ||
196 | return bagOfAnswers.result(Bag); | 220 | return bagOfAnswers.result(Bag); |
197 | } | 221 | } |
198 | 222 | ||
@@ -200,8 +224,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
200 | (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) | 224 | (object Template, object Goal, IEnumerable<bool> goalIterator, object Bag) |
201 | { | 225 | { |
202 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); | 226 | BagofAnswers bagOfAnswers = new BagofAnswers(Template, Goal); |
227 | // disable warning on l1, don't see how we can | ||
228 | // code this differently | ||
229 | #pragma warning disable 0168 | ||
203 | foreach (bool l1 in goalIterator) | 230 | foreach (bool l1 in goalIterator) |
204 | bagOfAnswers.add(); | 231 | bagOfAnswers.add(); |
232 | #pragma warning restore 0168 | ||
205 | return bagOfAnswers.resultSet(Bag); | 233 | return bagOfAnswers.resultSet(Bag); |
206 | } | 234 | } |
207 | 235 | ||
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 | |||
81 | public static IEnumerable<bool> findall(object Template, IEnumerable<bool> goal, object Bag) | 81 | public static IEnumerable<bool> findall(object Template, IEnumerable<bool> goal, object Bag) |
82 | { | 82 | { |
83 | FindallAnswers findallAnswers = new FindallAnswers(Template); | 83 | FindallAnswers findallAnswers = new FindallAnswers(Template); |
84 | // disable warning on l1, don't see how we can | ||
85 | // code this differently | ||
86 | #pragma warning disable 0168 | ||
84 | foreach (bool l1 in goal) | 87 | foreach (bool l1 in goal) |
85 | findallAnswers.add(); | 88 | findallAnswers.add(); |
89 | #pragma warning restore 0168 | ||
86 | return findallAnswers.result(Bag); | 90 | return findallAnswers.result(Bag); |
87 | } | 91 | } |
88 | 92 | ||
@@ -95,8 +99,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
95 | public static List<object> findallArray(object Template, IEnumerable<bool> goal) | 99 | public static List<object> findallArray(object Template, IEnumerable<bool> goal) |
96 | { | 100 | { |
97 | FindallAnswers findallAnswers = new FindallAnswers(Template); | 101 | FindallAnswers findallAnswers = new FindallAnswers(Template); |
102 | // disable warning on l1, don't see how we can | ||
103 | // code this differently | ||
104 | #pragma warning disable 0168 | ||
98 | foreach (bool l1 in goal) | 105 | foreach (bool l1 in goal) |
99 | findallAnswers.add(); | 106 | findallAnswers.add(); |
107 | #pragma warning restore 0168 | ||
100 | return findallAnswers.resultArray(); | 108 | return findallAnswers.resultArray(); |
101 | } | 109 | } |
102 | } | 110 | } |
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 | |||
57 | Functor1 argFunctor = (Functor1)arg; | 57 | Functor1 argFunctor = (Functor1)arg; |
58 | if (_name.Equals(argFunctor._name)) | 58 | if (_name.Equals(argFunctor._name)) |
59 | { | 59 | { |
60 | // disable warning on l1, don't see how we can | ||
61 | // code this differently | ||
62 | #pragma warning disable 0168 | ||
60 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) | 63 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) |
61 | yield return false; | 64 | yield return false; |
65 | #pragma warning restore 0168 | ||
62 | } | 66 | } |
63 | } | 67 | } |
64 | else if (arg is Variable) | 68 | else if (arg is Variable) |
65 | { | 69 | { |
70 | // disable warning on l1, don't see how we can | ||
71 | // code this differently | ||
72 | #pragma warning disable 0168 | ||
66 | foreach (bool l1 in ((Variable)arg).unify(this)) | 73 | foreach (bool l1 in ((Variable)arg).unify(this)) |
67 | yield return false; | 74 | yield return false; |
75 | #pragma warning restore 0168 | ||
76 | |||
68 | } | 77 | } |
69 | } | 78 | } |
70 | 79 | ||
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 | |||
59 | Functor2 argFunctor = (Functor2)arg; | 59 | Functor2 argFunctor = (Functor2)arg; |
60 | if (_name.Equals(argFunctor._name)) | 60 | if (_name.Equals(argFunctor._name)) |
61 | { | 61 | { |
62 | // disable warning on l1, don't see how we can | ||
63 | // code this differently | ||
64 | #pragma warning disable 0168 | ||
62 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) | 65 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) |
63 | { | 66 | { |
64 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) | 67 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) |
65 | yield return false; | 68 | yield return false; |
66 | } | 69 | } |
70 | #pragma warning restore 0168 | ||
67 | } | 71 | } |
68 | } | 72 | } |
69 | else if (arg is Variable) | 73 | else if (arg is Variable) |
70 | { | 74 | { |
75 | // disable warning on l1, don't see how we can | ||
76 | // code this differently | ||
77 | #pragma warning disable 0168 | ||
71 | foreach (bool l1 in ((Variable)arg).unify(this)) | 78 | foreach (bool l1 in ((Variable)arg).unify(this)) |
72 | yield return false; | 79 | yield return false; |
80 | #pragma warning restore 0168 | ||
73 | } | 81 | } |
74 | } | 82 | } |
75 | 83 | ||
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 | |||
61 | Functor3 argFunctor = (Functor3)arg; | 61 | Functor3 argFunctor = (Functor3)arg; |
62 | if (_name.Equals(argFunctor._name)) | 62 | if (_name.Equals(argFunctor._name)) |
63 | { | 63 | { |
64 | // disable warning on l1, l2, l3 don't see how we can | ||
65 | // code this differently | ||
66 | #pragma warning disable 0168 | ||
64 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) | 67 | foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) |
65 | { | 68 | { |
66 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) | 69 | foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) |
@@ -69,12 +72,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
69 | yield return false; | 72 | yield return false; |
70 | } | 73 | } |
71 | } | 74 | } |
75 | #pragma warning restore 0168 | ||
72 | } | 76 | } |
73 | } | 77 | } |
74 | else if (arg is Variable) | 78 | else if (arg is Variable) |
75 | { | 79 | { |
80 | // disable warning on l1, don't see how we can | ||
81 | // code this differently | ||
82 | #pragma warning disable 0168 | ||
76 | foreach (bool l1 in ((Variable)arg).unify(this)) | 83 | foreach (bool l1 in ((Variable)arg).unify(this)) |
77 | yield return false; | 84 | yield return false; |
85 | #pragma warning restore 0168 | ||
78 | } | 86 | } |
79 | } | 87 | } |
80 | 88 | ||
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 | |||
44 | yield return false; | 44 | yield return false; |
45 | } | 45 | } |
46 | 46 | ||
47 | // disable warning about unused variables: the following code | ||
48 | // is infested with it. | ||
49 | #pragma warning disable 0168, 0219 | ||
50 | |||
47 | // Debug: Hand-modify this central predicate to do tail recursion. | 51 | // Debug: Hand-modify this central predicate to do tail recursion. |
48 | public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3) | 52 | public static IEnumerable<bool> read_tokens(object arg1, object arg2, object arg3) |
49 | { | 53 | { |
@@ -188,7 +192,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
188 | // Compiler output follows. | 192 | // Compiler output follows. |
189 | 193 | ||
190 | class YPInnerClass { } | 194 | class YPInnerClass { } |
191 | static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } | 195 | // static Type getDeclaringClass() { return typeof(YPInnerClass).DeclaringType; } |
192 | 196 | ||
193 | public static IEnumerable<bool> parseInput(object TermList) | 197 | public static IEnumerable<bool> parseInput(object TermList) |
194 | { | 198 | { |
@@ -224,10 +228,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
224 | if (YP.termEqual(Term, Atom.a(@"end_of_file"))) | 228 | if (YP.termEqual(Term, Atom.a(@"end_of_file"))) |
225 | { | 229 | { |
226 | yield break; | 230 | yield break; |
227 | goto cutIf1; | 231 | // unreachable code: |
232 | // goto cutIf1; | ||
228 | } | 233 | } |
229 | yield return false; | 234 | yield return false; |
230 | cutIf1: | 235 | // cutIf1: |
231 | { } | 236 | { } |
232 | } | 237 | } |
233 | } | 238 | } |
@@ -4452,6 +4457,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
4452 | { } | 4457 | { } |
4453 | } | 4458 | } |
4454 | } | 4459 | } |
4455 | 4460 | #pragma warning restore 0168 | |
4456 | } | 4461 | } |
4457 | } | 4462 | } |
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 | |||
92 | } | 92 | } |
93 | else | 93 | else |
94 | { | 94 | { |
95 | // disable warning on l1, don't see how we can | ||
96 | // code this differently | ||
97 | #pragma warning disable 0168 | ||
95 | foreach (bool l1 in YP.unify(this, arg)) | 98 | foreach (bool l1 in YP.unify(this, arg)) |
96 | yield return false; | 99 | yield return false; |
100 | #pragma warning restore 0168 | ||
97 | } | 101 | } |
98 | } | 102 | } |
99 | 103 | ||
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 | |||
572 | 572 | ||
573 | Variable Name = new Variable(); | 573 | Variable Name = new Variable(); |
574 | Variable ArgList = new Variable(); | 574 | Variable ArgList = new Variable(); |
575 | // disable warning on l1, don't see how we can | ||
576 | // code this differently | ||
577 | #pragma warning disable 0168 | ||
575 | foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) | 578 | foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) |
576 | { | 579 | { |
577 | object[] args = ListPair.toArray(ArgList); | 580 | object[] args = ListPair.toArray(ArgList); |
@@ -585,6 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
585 | 588 | ||
586 | return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); | 589 | return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); |
587 | } | 590 | } |
591 | #pragma warning restore 0168 | ||
588 | 592 | ||
589 | return YP.fail(); | 593 | return YP.fail(); |
590 | } | 594 | } |
@@ -597,11 +601,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
597 | 601 | ||
598 | if (!(Term is Variable)) | 602 | if (!(Term is Variable)) |
599 | { | 603 | { |
604 | // disable warning on l1, don't see how we can | ||
605 | // code this differently | ||
606 | #pragma warning disable 0168 | ||
600 | foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term))) | 607 | foreach (bool l1 in YP.unify(FunctorName, getFunctorName(Term))) |
601 | { | 608 | { |
602 | foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length)) | 609 | foreach (bool l2 in YP.unify(Arity, getFunctorArgs(Term).Length)) |
603 | yield return false; | 610 | yield return false; |
604 | } | 611 | } |
612 | #pragma warning restore 0168 | ||
605 | } | 613 | } |
606 | else | 614 | else |
607 | throw new NotImplementedException("Debug: must finish functor/3"); | 615 | throw new NotImplementedException("Debug: must finish functor/3"); |
@@ -621,8 +629,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
621 | if (argNumberInt >= 1 && argNumberInt <= termArgs.Length) | 629 | if (argNumberInt >= 1 && argNumberInt <= termArgs.Length) |
622 | { | 630 | { |
623 | // The first ArgNumber is at 1, not 0. | 631 | // The first ArgNumber is at 1, not 0. |
632 | // disable warning on l1, don't see how we can | ||
633 | // code this differently | ||
634 | #pragma warning disable 0168 | ||
624 | foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) | 635 | foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) |
625 | yield return false; | 636 | yield return false; |
637 | #pragma warning restore 0168 | ||
626 | } | 638 | } |
627 | } | 639 | } |
628 | } | 640 | } |
@@ -814,8 +826,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
814 | object[] args = new object[] { Priority, Specifier, Operator }; | 826 | object[] args = new object[] { Priority, Specifier, Operator }; |
815 | foreach (object[] answer in _operatorTable) | 827 | foreach (object[] answer in _operatorTable) |
816 | { | 828 | { |
829 | // disable warning on l1, don't see how we can | ||
830 | // code this differently | ||
831 | #pragma warning disable 0168 | ||
817 | foreach (bool l1 in YP.unifyArrays(args, answer)) | 832 | foreach (bool l1 in YP.unifyArrays(args, answer)) |
818 | yield return false; | 833 | yield return false; |
834 | #pragma warning restore 0168 | ||
819 | } | 835 | } |
820 | } | 836 | } |
821 | 837 | ||
@@ -847,12 +863,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
847 | int afterInt = atomAtom._name.Length - (beforeInt + lengthInt); | 863 | int afterInt = atomAtom._name.Length - (beforeInt + lengthInt); |
848 | if (afterInt >= 0) | 864 | if (afterInt >= 0) |
849 | { | 865 | { |
866 | // disable warning on l1, don't see how we can | ||
867 | // code this differently | ||
868 | #pragma warning disable 0168 | ||
850 | foreach (bool l1 in YP.unify(After, afterInt)) | 869 | foreach (bool l1 in YP.unify(After, afterInt)) |
851 | { | 870 | { |
852 | foreach (bool l2 in YP.unify | 871 | foreach (bool l2 in YP.unify |
853 | (Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt)))) | 872 | (Sub_atom, Atom.a(atomAtom._name.Substring(beforeInt, lengthInt)))) |
854 | yield return false; | 873 | yield return false; |
855 | } | 874 | } |
875 | #pragma warning restore 0168 | ||
856 | } | 876 | } |
857 | } | 877 | } |
858 | 878 | ||
@@ -1201,9 +1221,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1201 | if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT)) | 1221 | if (arity == 2 && (name == Atom.a(",") || name == Atom.a(";") || name == Atom.DOT)) |
1202 | return false; | 1222 | return false; |
1203 | // Use the same mapping to static predicates in YP as the compiler. | 1223 | // Use the same mapping to static predicates in YP as the compiler. |
1224 | // disable warning on l1, don't see how we can | ||
1225 | // code this differently | ||
1226 | #pragma warning disable 0168 | ||
1204 | foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable())) | 1227 | foreach (bool l1 in YPCompiler.functorCallYPFunctionName(name, arity, new Variable())) |
1205 | return false; | 1228 | return false; |
1206 | // Debug: Do we need to check if name._module is null? | 1229 | // Debug: Do we need to check if name._module is null? |
1230 | #pragma warning restore 0168 | ||
1207 | return true; | 1231 | return true; |
1208 | } | 1232 | } |
1209 | 1233 | ||
@@ -1342,9 +1366,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1342 | 1366 | ||
1343 | foreach (NameArity key in _predicatesStore.Keys) | 1367 | foreach (NameArity key in _predicatesStore.Keys) |
1344 | { | 1368 | { |
1369 | // disable warning on l1, don't see how we can | ||
1370 | // code this differently | ||
1371 | #pragma warning disable 0168 | ||
1345 | foreach (bool l1 in YP.unify | 1372 | foreach (bool l1 in YP.unify |
1346 | (new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity)) | 1373 | (new Functor2(Atom.SLASH, key._name, key._arity), NameSlashArity)) |
1347 | yield return false; | 1374 | yield return false; |
1375 | #pragma warning restore 0168 | ||
1348 | } | 1376 | } |
1349 | } | 1377 | } |
1350 | 1378 | ||
@@ -1414,7 +1442,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1414 | /// <returns></returns> | 1442 | /// <returns></returns> |
1415 | public static void script_event(object script_event, object script_params) | 1443 | public static void script_event(object script_event, object script_params) |
1416 | { | 1444 | { |
1417 | string function = ((Atom)YP.getValue(script_event))._name; | 1445 | // string function = ((Atom)YP.getValue(script_event))._name; |
1418 | object[] array = ListPair.toArray(script_params); | 1446 | object[] array = ListPair.toArray(script_params); |
1419 | if (array == null) | 1447 | if (array == null) |
1420 | return; // YP.fail(); | 1448 | return; // YP.fail(); |
@@ -1600,11 +1628,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
1600 | if (_exception != null) | 1628 | if (_exception != null) |
1601 | { | 1629 | { |
1602 | bool didUnify = false; | 1630 | bool didUnify = false; |
1631 | // disable warning on l1, don't see how we can | ||
1632 | // code this differently | ||
1633 | #pragma warning disable 0168 | ||
1603 | foreach (bool l1 in YP.unify(_exception._term, Catcher)) | 1634 | foreach (bool l1 in YP.unify(_exception._term, Catcher)) |
1604 | { | 1635 | { |
1605 | didUnify = true; | 1636 | didUnify = true; |
1606 | yield return false; | 1637 | yield return false; |
1607 | } | 1638 | } |
1639 | #pragma warning restore 0168 | ||
1640 | |||
1608 | if (!didUnify) | 1641 | if (!didUnify) |
1609 | throw _exception; | 1642 | throw _exception; |
1610 | } | 1643 | } |
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 | |||
209 | object[] functorArgs = YP.getFunctorArgs(Term); | 209 | object[] functorArgs = YP.getFunctorArgs(Term); |
210 | 210 | ||
211 | Variable pred = new Variable(); | 211 | Variable pred = new Variable(); |
212 | // disable warning on l1, don't see how we can | ||
213 | // code this differently | ||
214 | #pragma warning disable 0168 | ||
212 | foreach (bool l1 in ((CompilerState)State)._pred.match | 215 | foreach (bool l1 in ((CompilerState)State)._pred.match |
213 | (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) | 216 | (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) |
214 | { | 217 | { |
215 | if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) | 218 | if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) |
216 | { | 219 | { |
217 | return true; | 220 | return true; |
218 | } | 221 | } |
219 | } | 222 | } |
223 | #pragma warning restore 0168 | ||
220 | 224 | ||
221 | return false; | 225 | return false; |
222 | } | 226 | } |
@@ -228,14 +232,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
228 | object[] functorArgs = YP.getFunctorArgs(Term); | 232 | object[] functorArgs = YP.getFunctorArgs(Term); |
229 | 233 | ||
230 | Variable pred = new Variable(); | 234 | Variable pred = new Variable(); |
235 | // disable warning on l1, don't see how we can | ||
236 | // code this differently | ||
237 | #pragma warning disable 0168 | ||
231 | foreach (bool l1 in ((CompilerState)State)._pred.match | 238 | foreach (bool l1 in ((CompilerState)State)._pred.match |
232 | (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) | 239 | (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) |
233 | { | 240 | { |
234 | if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) | 241 | if (CompilerState.isNoneOut(YP.getFunctorArgs(pred.getValue()))) |
235 | { | 242 | { |
236 | return true; | 243 | return true; |
237 | } | 244 | } |
238 | } | 245 | } |
246 | #pragma warning restore 0168 | ||
239 | 247 | ||
240 | return false; | 248 | return false; |
241 | } | 249 | } |
@@ -275,6 +283,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog | |||
275 | } | 283 | } |
276 | } | 284 | } |
277 | 285 | ||
286 | // disable warning unused variables, the following code is | ||
287 | // infested with it. | ||
288 | #pragma warning disable 0168, 0219 | ||
289 | |||
278 | /// <summary> | 290 | /// <summary> |
279 | /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction | 291 | /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction |
280 | /// to return an anonymous YP.IClause for the Head and Body of a rule clause. | 292 | /// to return an anonymous YP.IClause for the Head and Body of a rule clause. |
@@ -3939,12 +3951,12 @@ namespace Temporary { | |||
3939 | YP.nl(); | 3951 | YP.nl(); |
3940 | convertStatementListCSharp(RestStatements, Level); | 3952 | convertStatementListCSharp(RestStatements, Level); |
3941 | return; | 3953 | return; |
3942 | goto cutIf1; | 3954 | // goto cutIf1; |
3943 | } | 3955 | } |
3944 | convertStatementListCSharp(RestStatements, Level); | 3956 | convertStatementListCSharp(RestStatements, Level); |
3945 | return; | 3957 | return; |
3946 | cutIf1: | 3958 | // cutIf1: |
3947 | { } | 3959 | // { } |
3948 | } | 3960 | } |
3949 | } | 3961 | } |
3950 | { | 3962 | { |
@@ -4111,12 +4123,12 @@ namespace Temporary { | |||
4111 | YP.write(Atom.a(@", ")); | 4123 | YP.write(Atom.a(@", ")); |
4112 | convertArgListCSharp(Tail); | 4124 | convertArgListCSharp(Tail); |
4113 | return; | 4125 | return; |
4114 | goto cutIf1; | 4126 | // goto cutIf1; |
4115 | } | 4127 | } |
4116 | convertArgListCSharp(Tail); | 4128 | convertArgListCSharp(Tail); |
4117 | return; | 4129 | return; |
4118 | cutIf1: | 4130 | // cutIf1: |
4119 | { } | 4131 | // { } |
4120 | } | 4132 | } |
4121 | } | 4133 | } |
4122 | } | 4134 | } |
@@ -4266,13 +4278,13 @@ namespace Temporary { | |||
4266 | YP.put_code(Code); | 4278 | YP.put_code(Code); |
4267 | convertStringCodesCSharp(RestCodes); | 4279 | convertStringCodesCSharp(RestCodes); |
4268 | return; | 4280 | return; |
4269 | goto cutIf1; | 4281 | // goto cutIf1; |
4270 | } | 4282 | } |
4271 | YP.put_code(Code); | 4283 | YP.put_code(Code); |
4272 | convertStringCodesCSharp(RestCodes); | 4284 | convertStringCodesCSharp(RestCodes); |
4273 | return; | 4285 | return; |
4274 | cutIf1: | 4286 | // cutIf1: |
4275 | { } | 4287 | // { } |
4276 | } | 4288 | } |
4277 | } | 4289 | } |
4278 | } | 4290 | } |
@@ -4623,12 +4635,12 @@ namespace Temporary { | |||
4623 | YP.write(Atom.a(@", ")); | 4635 | YP.write(Atom.a(@", ")); |
4624 | convertArgListJavascript(Tail); | 4636 | convertArgListJavascript(Tail); |
4625 | return; | 4637 | return; |
4626 | goto cutIf1; | 4638 | // goto cutIf1; |
4627 | } | 4639 | } |
4628 | convertArgListJavascript(Tail); | 4640 | convertArgListJavascript(Tail); |
4629 | return; | 4641 | return; |
4630 | cutIf1: | 4642 | // cutIf1: |
4631 | { } | 4643 | // { } |
4632 | } | 4644 | } |
4633 | } | 4645 | } |
4634 | } | 4646 | } |
@@ -4777,7 +4789,7 @@ namespace Temporary { | |||
4777 | YP.put_code(Code); | 4789 | YP.put_code(Code); |
4778 | convertStringCodesJavascript(RestCodes); | 4790 | convertStringCodesJavascript(RestCodes); |
4779 | return; | 4791 | return; |
4780 | goto cutIf1; | 4792 | // goto cutIf1; |
4781 | } | 4793 | } |
4782 | if (YP.termEqual(Code, 92)) | 4794 | if (YP.termEqual(Code, 92)) |
4783 | { | 4795 | { |
@@ -4785,13 +4797,13 @@ namespace Temporary { | |||
4785 | YP.put_code(Code); | 4797 | YP.put_code(Code); |
4786 | convertStringCodesJavascript(RestCodes); | 4798 | convertStringCodesJavascript(RestCodes); |
4787 | return; | 4799 | return; |
4788 | goto cutIf1; | 4800 | // goto cutIf1; |
4789 | } | 4801 | } |
4790 | YP.put_code(Code); | 4802 | YP.put_code(Code); |
4791 | convertStringCodesJavascript(RestCodes); | 4803 | convertStringCodesJavascript(RestCodes); |
4792 | return; | 4804 | return; |
4793 | cutIf1: | 4805 | // cutIf1: |
4794 | { } | 4806 | // { } |
4795 | } | 4807 | } |
4796 | } | 4808 | } |
4797 | } | 4809 | } |
@@ -5420,12 +5432,12 @@ namespace Temporary { | |||
5420 | YP.write(Atom.a(@", ")); | 5432 | YP.write(Atom.a(@", ")); |
5421 | convertArgListPython(Tail); | 5433 | convertArgListPython(Tail); |
5422 | return; | 5434 | return; |
5423 | goto cutIf1; | 5435 | // goto cutIf1; |
5424 | } | 5436 | } |
5425 | convertArgListPython(Tail); | 5437 | convertArgListPython(Tail); |
5426 | return; | 5438 | return; |
5427 | cutIf1: | 5439 | // cutIf1: |
5428 | { } | 5440 | // { } |
5429 | } | 5441 | } |
5430 | } | 5442 | } |
5431 | } | 5443 | } |
@@ -5573,7 +5585,7 @@ namespace Temporary { | |||
5573 | YP.put_code(Code); | 5585 | YP.put_code(Code); |
5574 | convertStringCodesPython(RestCodes); | 5586 | convertStringCodesPython(RestCodes); |
5575 | return; | 5587 | return; |
5576 | goto cutIf1; | 5588 | // goto cutIf1; |
5577 | } | 5589 | } |
5578 | if (YP.termEqual(Code, 92)) | 5590 | if (YP.termEqual(Code, 92)) |
5579 | { | 5591 | { |
@@ -5581,13 +5593,13 @@ namespace Temporary { | |||
5581 | YP.put_code(Code); | 5593 | YP.put_code(Code); |
5582 | convertStringCodesPython(RestCodes); | 5594 | convertStringCodesPython(RestCodes); |
5583 | return; | 5595 | return; |
5584 | goto cutIf1; | 5596 | // goto cutIf1; |
5585 | } | 5597 | } |
5586 | YP.put_code(Code); | 5598 | YP.put_code(Code); |
5587 | convertStringCodesPython(RestCodes); | 5599 | convertStringCodesPython(RestCodes); |
5588 | return; | 5600 | return; |
5589 | cutIf1: | 5601 | // cutIf1: |
5590 | { } | 5602 | // { } |
5591 | } | 5603 | } |
5592 | } | 5604 | } |
5593 | } | 5605 | } |
@@ -5646,6 +5658,7 @@ namespace Temporary { | |||
5646 | } | 5658 | } |
5647 | } | 5659 | } |
5648 | } | 5660 | } |
5661 | #pragma warning restore 0168 | ||
5649 | 5662 | ||
5650 | } | 5663 | } |
5651 | } | 5664 | } |
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 | |||
40 | { | 40 | { |
41 | public class Compiler | 41 | public class Compiler |
42 | { | 42 | { |
43 | private static readonly log4net.ILog m_log | 43 | // private static readonly log4net.ILog m_log |
44 | = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 44 | // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | // * Uses "LSL2Converter" to convert LSL to C# if necessary. | 46 | // * Uses "LSL2Converter" to convert LSL to C# if necessary. |
47 | // * Compiles C#-code into an assembly | 47 | // * Compiles C#-code into an assembly |
@@ -79,7 +79,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
79 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp | 79 | private static CSharpCodeProvider YPcodeProvider = new CSharpCodeProvider(); // YP is translated into CSharp |
80 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); | 80 | private static YP2CSConverter YP_Converter = new YP2CSConverter(); |
81 | 81 | ||
82 | private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files | 82 | // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files |
83 | private static UInt64 scriptCompileCounter = 0; // And a counter | 83 | private static UInt64 scriptCompileCounter = 0; // And a counter |
84 | 84 | ||
85 | public IScriptEngine m_scriptEngine; | 85 | public IScriptEngine m_scriptEngine; |
@@ -273,7 +273,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
273 | { | 273 | { |
274 | Directory.CreateDirectory(ScriptEnginesPath); | 274 | Directory.CreateDirectory(ScriptEnginesPath); |
275 | } | 275 | } |
276 | catch (Exception ex) | 276 | catch (Exception) |
277 | { | 277 | { |
278 | } | 278 | } |
279 | } | 279 | } |
@@ -285,7 +285,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
285 | { | 285 | { |
286 | Directory.CreateDirectory(ScriptEnginesPath); | 286 | Directory.CreateDirectory(ScriptEnginesPath); |
287 | } | 287 | } |
288 | catch (Exception ex) | 288 | catch (Exception) |
289 | { | 289 | { |
290 | } | 290 | } |
291 | } | 291 | } |
@@ -486,7 +486,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
486 | // } | 486 | // } |
487 | 487 | ||
488 | string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); | 488 | string rootPath = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory); |
489 | string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location); | 489 | // string rootPathSE = Path.GetDirectoryName(GetType().Assembly.Location); |
490 | //Console.WriteLine("Assembly location: " + rootPath); | 490 | //Console.WriteLine("Assembly location: " + rootPath); |
491 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll")); | 491 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.dll")); |
492 | parameters.ReferencedAssemblies.Add(Path.Combine(rootPath, "OpenSim.Region.ScriptEngine.Shared.Api.Runtime.dll")); | 492 | 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 | |||
69 | YP.tell(myCS_SW); | 69 | YP.tell(myCS_SW); |
70 | 70 | ||
71 | //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); | 71 | //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); |
72 | // disable warning on l1, don't see how we can | ||
73 | // code this differently | ||
74 | #pragma warning disable 0168 | ||
72 | foreach (bool l1 in Parser.parseInput(TermList)) | 75 | foreach (bool l1 in Parser.parseInput(TermList)) |
73 | { | 76 | { |
74 | foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) | 77 | foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) |
75 | { | 78 | { |
76 | ListPair VFC = new ListPair(FunctionCode, new Variable()); | 79 | // ListPair VFC = new ListPair(FunctionCode, new Variable()); |
77 | //Console.WriteLine("-------------------------") | 80 | //Console.WriteLine("-------------------------") |
78 | //Console.WriteLine(FunctionCode.ToString()) | 81 | //Console.WriteLine(FunctionCode.ToString()) |
79 | //Console.WriteLine("-------------------------") | 82 | //Console.WriteLine("-------------------------") |
@@ -81,6 +84,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
81 | //YPCompiler.convertStringCodesCSharp(VFC); | 84 | //YPCompiler.convertStringCodesCSharp(VFC); |
82 | } | 85 | } |
83 | } | 86 | } |
87 | #pragma warning restore 0168 | ||
84 | YP.seen(); | 88 | YP.seen(); |
85 | myCS_SW.Close(); | 89 | myCS_SW.Close(); |
86 | YP.told(); | 90 | 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 | |||
73 | eventFlags |= kvp.Value; | 73 | eventFlags |= kvp.Value; |
74 | } | 74 | } |
75 | } | 75 | } |
76 | catch(Exception e) | 76 | catch(Exception) |
77 | { | 77 | { |
78 | //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); | 78 | //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); |
79 | } | 79 | } |
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 | |||
58 | private Scene m_Scene; | 58 | private Scene m_Scene; |
59 | private IConfig m_ScriptConfig; | 59 | private IConfig m_ScriptConfig; |
60 | private Compiler m_Compiler; | 60 | private Compiler m_Compiler; |
61 | private EventManager m_EventManager; | 61 | // private EventManager m_EventManager; |
62 | private int m_EventLimit; | 62 | private int m_EventLimit; |
63 | private bool m_KillTimedOutScripts; | 63 | private bool m_KillTimedOutScripts; |
64 | public AsyncCommandManager m_AsyncCommands; | 64 | public AsyncCommandManager m_AsyncCommands; |
@@ -111,12 +111,12 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
111 | get { return m_ScriptEngines; } | 111 | get { return m_ScriptEngines; } |
112 | } | 112 | } |
113 | 113 | ||
114 | private struct RezScriptParms | 114 | // private struct RezScriptParms |
115 | { | 115 | // { |
116 | uint LocalID; | 116 | // uint LocalID; |
117 | LLUUID ItemID; | 117 | // LLUUID ItemID; |
118 | string Script; | 118 | // string Script; |
119 | } | 119 | // } |
120 | 120 | ||
121 | public IConfig Config | 121 | public IConfig Config |
122 | { | 122 | { |
@@ -190,7 +190,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
190 | m_ScriptEngines.Add(this); | 190 | m_ScriptEngines.Add(this); |
191 | } | 191 | } |
192 | 192 | ||
193 | m_EventManager = new EventManager(this); | 193 | // m_EventManager = new EventManager(this); |
194 | 194 | ||
195 | StartEngine(minThreads, maxThreads, idleTimeout, prio, | 195 | StartEngine(minThreads, maxThreads, idleTimeout, prio, |
196 | maxScriptQueue, stackSize); | 196 | maxScriptQueue, stackSize); |
@@ -527,7 +527,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
527 | if (File.Exists(m_Assemblies[assetID]+".mdb")) | 527 | if (File.Exists(m_Assemblies[assetID]+".mdb")) |
528 | File.Delete(m_Assemblies[assetID]+".mdb"); | 528 | File.Delete(m_Assemblies[assetID]+".mdb"); |
529 | } | 529 | } |
530 | catch (Exception e) | 530 | catch (Exception) |
531 | { | 531 | { |
532 | } | 532 | } |
533 | m_Assemblies.Remove(assetID); | 533 | m_Assemblies.Remove(assetID); |