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. --- .../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 ++- 12 files changed, 165 insertions(+), 45 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared') 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(); -- cgit v1.1