From 313f7f60fda81c987e0ac4da4dc8c2f5def46b72 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 30 Jun 2008 11:57:47 +0000 Subject: properly explaining each #pragma warning disable massaging OSHttpRequestPump to not abort on exceptions... --- .../Shared/Api/Runtime/YieldProlog/BagofAnswers.cs | 56 +++++++++---------- .../Shared/Api/Runtime/YieldProlog/Functor2.cs | 16 +++--- .../Shared/Api/Runtime/YieldProlog/Functor3.cs | 16 +++--- .../Shared/Api/Runtime/YieldProlog/Parser.cs | 8 +-- .../Shared/Api/Runtime/YieldProlog/Variable.cs | 8 +-- .../Shared/Api/Runtime/YieldProlog/YP.cs | 64 +++++++++++----------- .../Shared/Api/Runtime/YieldProlog/YPCompiler.cs | 18 +++--- 7 files changed, 93 insertions(+), 93 deletions(-) (limited to 'OpenSim/Region/ScriptEngine/Shared/Api') diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs index c52adb1..c2bb0b7 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/BagofAnswers.cs @@ -127,27 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in bagArrayVariable.unify(_findallBagArray)) yield return false; - #pragma warning restore 0168 +#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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 // Debug: Should we free memory of the answers already returned? } } @@ -161,15 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 } /// @@ -181,9 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in resultArray(bagArrayVariable)) { List bagArray = (List)bagArrayVariable.getValue(); @@ -191,19 +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 +#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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); - #pragma warning restore 0168 +#pragma warning restore 0168 return bagOfAnswers.resultArray(bagArrayVariable); } @@ -211,12 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); - #pragma warning restore 0168 +#pragma warning restore 0168 return bagOfAnswers.result(Bag); } @@ -224,12 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in goalIterator) bagOfAnswers.add(); - #pragma warning restore 0168 +#pragma warning restore 0168 return bagOfAnswers.resultSet(Bag); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs index 7e4f27d..4ae325e 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor2.cs @@ -59,25 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in ((Variable)arg).unify(this)) yield return false; - #pragma warning restore 0168 +#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 6ef8327..907bfca 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Functor3.cs @@ -61,9 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in YP.unify(_arg1, argFunctor._arg1)) { foreach (bool l2 in YP.unify(_arg2, argFunctor._arg2)) @@ -72,17 +72,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog yield return false; } } - #pragma warning restore 0168 +#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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in ((Variable)arg).unify(this)) yield return false; - #pragma warning restore 0168 +#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 e9dd8f1..3d86905 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Parser.cs @@ -44,9 +44,9 @@ 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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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) @@ -4457,6 +4457,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { } } } - #pragma warning restore 0168 +#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 8e2aa7e..f68a941 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/Variable.cs @@ -92,12 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in YP.unify(this, arg)) yield return false; - #pragma warning restore 0168 +#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 f0e8147..c212fb8 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -572,9 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in new ListPair(Name, ArgList).unify(List)) { object[] args = ListPair.toArray(ArgList); @@ -588,7 +588,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog return YP.unify(Term, Functor.make((Atom)YP.getValue(Name), args)); } - #pragma warning restore 0168 +#pragma warning restore 0168 return YP.fail(); } @@ -601,15 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 } else throw new NotImplementedException("Debug: must finish functor/3"); @@ -629,12 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in YP.unify(Value, termArgs[argNumberInt - 1])) yield return false; - #pragma warning restore 0168 +#pragma warning restore 0168 } } } @@ -826,12 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in YP.unifyArrays(args, answer)) yield return false; - #pragma warning restore 0168 +#pragma warning restore 0168 } } @@ -863,16 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 } } @@ -1221,13 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 return true; } @@ -1366,13 +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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#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 +#pragma warning restore 0168 } } @@ -1628,15 +1628,15 @@ 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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in YP.unify(_exception._term, Catcher)) { didUnify = true; yield return false; } - #pragma warning restore 0168 +#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 d6115ce..96f2b89 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YPCompiler.cs @@ -209,9 +209,9 @@ 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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in ((CompilerState)State)._pred.match (new object[] { functorName, functorArgs.Length, pred, Atom.a("det") })) { @@ -220,7 +220,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog return true; } } - #pragma warning restore 0168 +#pragma warning restore 0168 return false; } @@ -232,9 +232,9 @@ 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 +// disable warning: don't see how we can code this differently short +// of rewriting the whole thing +#pragma warning disable 0168 foreach (bool l1 in ((CompilerState)State)._pred.match (new object[] { functorName, functorArgs.Length, pred, Atom.a("semidet") })) { @@ -243,7 +243,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog return true; } } - #pragma warning restore 0168 +#pragma warning restore 0168 return false; } @@ -285,7 +285,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog // disable warning unused variables, the following code is // infested with it. - #pragma warning disable 0168, 0219 +#pragma warning disable 0168, 0219 /// /// Use makeFunctionPseudoCode, convertFunctionCSharp and compileAnonymousFunction -- cgit v1.1