aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorMike Mazur2008-07-24 05:23:42 +0000
committerMike Mazur2008-07-24 05:23:42 +0000
commitbb777a9c3c6824411b96bd6e14ff8d6325fbda38 (patch)
tree8b8e5f58290678827c3f13d58e723ec26e0c672b /OpenSim/Region
parentReplace implicit casts from LSLFloat to int and uint which were removed in (diff)
downloadopensim-SC-bb777a9c3c6824411b96bd6e14ff8d6325fbda38.zip
opensim-SC-bb777a9c3c6824411b96bd6e14ff8d6325fbda38.tar.gz
opensim-SC-bb777a9c3c6824411b96bd6e14ff8d6325fbda38.tar.bz2
opensim-SC-bb777a9c3c6824411b96bd6e14ff8d6325fbda38.tar.xz
Replace the try/catch with a null check.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs9
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs9
2 files changed, 6 insertions, 12 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs
index 16b12c3..8abf3b9 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/LSL2CSCodeTransformer.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
34 public class LSL2CSCodeTransformer 34 public class LSL2CSCodeTransformer
35 { 35 {
36 private SYMBOL m_astRoot = null; 36 private SYMBOL m_astRoot = null;
37 private static Dictionary<string, string> m_datatypeLSL2OpenSim = new Dictionary<string, string>(); 37 private static Dictionary<string, string> m_datatypeLSL2OpenSim = null;
38 38
39 /// <summary> 39 /// <summary>
40 /// Pass the new CodeTranformer an abstract syntax tree. 40 /// Pass the new CodeTranformer an abstract syntax tree.
@@ -45,8 +45,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
45 m_astRoot = astRoot; 45 m_astRoot = astRoot;
46 46
47 // let's populate the dictionary 47 // let's populate the dictionary
48 try 48 if (null == m_datatypeLSL2OpenSim)
49 { 49 {
50 m_datatypeLSL2OpenSim = new Dictionary<string, string>();
50 m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger"); 51 m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger");
51 m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat"); 52 m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat");
52 //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used 53 //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used
@@ -56,10 +57,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
56 m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion"); 57 m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion");
57 m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list"); 58 m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list");
58 } 59 }
59 catch
60 {
61 // temporary workaround since we are adding to a static datatype
62 }
63 } 60 }
64 61
65 /// <summary> 62 /// <summary>
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs
index a7ca18c..a44b545 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/LSL2CSCodeTransformer.cs
@@ -34,7 +34,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
34 public class LSL2CSCodeTransformer 34 public class LSL2CSCodeTransformer
35 { 35 {
36 private SYMBOL m_astRoot = null; 36 private SYMBOL m_astRoot = null;
37 private static Dictionary<string, string> m_datatypeLSL2OpenSim = new Dictionary<string, string>(); 37 private static Dictionary<string, string> m_datatypeLSL2OpenSim = null;
38 38
39 /// <summary> 39 /// <summary>
40 /// Pass the new CodeTranformer an abstract syntax tree. 40 /// Pass the new CodeTranformer an abstract syntax tree.
@@ -45,8 +45,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
45 m_astRoot = astRoot; 45 m_astRoot = astRoot;
46 46
47 // let's populate the dictionary 47 // let's populate the dictionary
48 try 48 if (null == m_datatypeLSL2OpenSim)
49 { 49 {
50 m_datatypeLSL2OpenSim = new Dictionary<string, string>();
50 m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger"); 51 m_datatypeLSL2OpenSim.Add("integer", "LSL_Types.LSLInteger");
51 m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat"); 52 m_datatypeLSL2OpenSim.Add("float", "LSL_Types.LSLFloat");
52 //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used 53 //m_datatypeLSL2OpenSim.Add("key", "LSL_Types.key"); // key doesn't seem to be used
@@ -56,10 +57,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
56 m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion"); 57 m_datatypeLSL2OpenSim.Add("rotation", "LSL_Types.Quaternion");
57 m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list"); 58 m_datatypeLSL2OpenSim.Add("list", "LSL_Types.list");
58 } 59 }
59 catch
60 {
61 // temporary workaround since we are adding to a static datatype
62 }
63 } 60 }
64 61
65 /// <summary> 62 /// <summary>