aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJeff Ames2009-09-29 08:32:59 +0900
committerJeff Ames2009-09-29 08:32:59 +0900
commitf00126dc2dfc9e23aa50227f02ee9adbe1efdfa6 (patch)
tree47e63f1f5f5b7e48f19cabc4c5685c4d58ff1697 /OpenSim
parentMore reordering (diff)
downloadopensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.zip
opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.gz
opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.bz2
opensim-SC_OLD-f00126dc2dfc9e23aa50227f02ee9adbe1efdfa6.tar.xz
Add copyright header. Formatting cleanup.
Diffstat (limited to '')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs2
-rw-r--r--OpenSim/Data/MSSQL/MSSQLUserAccountData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLAuthenticationData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLLegacyRegionData.cs2
-rw-r--r--OpenSim/Data/MySQL/MySQLUserAccountData.cs2
-rw-r--r--OpenSim/Data/Null/NullRegionData.cs6
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs29
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs12
-rw-r--r--OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Mesh.cs2
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs50
-rw-r--r--OpenSim/Server/Base/ServerUtils.cs2
-rw-r--r--OpenSim/Tests/Clients/Grid/GridClient.cs29
-rw-r--r--OpenSim/Tools/Compiler/Program.cs36
16 files changed, 113 insertions, 69 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
index 78fc22c..099faea 100644
--- a/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLAuthenticationData.cs
@@ -135,7 +135,7 @@ namespace OpenSim.Data.MSSQL
135 135
136 insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm); 136 insertBuilder.AppendFormat("insert into '{0}' ('UUID', '", m_Realm);
137 insertBuilder.Append(String.Join("', '", fields)); 137 insertBuilder.Append(String.Join("', '", fields));
138 insertBuilder.Append("') values ( @principalID, @"); 138 insertBuilder.Append("') values (@principalID, @");
139 insertBuilder.Append(String.Join(", @", fields)); 139 insertBuilder.Append(String.Join(", @", fields));
140 insertBuilder.Append(")"); 140 insertBuilder.Append(")");
141 141
diff --git a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
index 1520888..e0c0ed6 100644
--- a/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLUserAccountData.cs
@@ -152,7 +152,7 @@ namespace OpenSim.Data.MSSQL
152 StringBuilder insertBuilder = new StringBuilder(); 152 StringBuilder insertBuilder = new StringBuilder();
153 insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm); 153 insertBuilder.AppendFormat("insert into '{0}' ('UUID', 'ScopeID', '", m_Realm);
154 insertBuilder.Append(String.Join("', '", fields)); 154 insertBuilder.Append(String.Join("', '", fields));
155 insertBuilder.Append("') values ( @principalID, @scopeID, @"); 155 insertBuilder.Append("') values (@principalID, @scopeID, @");
156 insertBuilder.Append(String.Join(", @", fields)); 156 insertBuilder.Append(String.Join(", @", fields));
157 insertBuilder.Append(")"); 157 insertBuilder.Append(")");
158 158
diff --git a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
index afd59bd..e508b52 100644
--- a/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
+++ b/OpenSim/Data/MySQL/MySQLAuthenticationData.cs
@@ -127,7 +127,7 @@ namespace OpenSim.Data.MySQL
127 { 127 {
128 string insert = "insert into `" + m_Realm + "` (`UUID`, `" + 128 string insert = "insert into `" + m_Realm + "` (`UUID`, `" +
129 String.Join("`, `", fields) + 129 String.Join("`, `", fields) +
130 "`) values ( ?principalID, ?" + String.Join(", ?", fields) + ")"; 130 "`) values (?principalID, ?" + String.Join(", ?", fields) + ")";
131 131
132 cmd.CommandText = insert; 132 cmd.CommandText = insert;
133 133
diff --git a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
index 4a16a70..ed62172 100644
--- a/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
+++ b/OpenSim/Data/MySQL/MySQLLegacyRegionData.cs
@@ -773,7 +773,7 @@ namespace OpenSim.Data.MySQL
773 "use_estate_sun, fixed_sun, sun_position, " + 773 "use_estate_sun, fixed_sun, sun_position, " +
774 "covenant, Sandbox, sunvectorx, sunvectory, " + 774 "covenant, Sandbox, sunvectorx, sunvectory, " +
775 "sunvectorz, loaded_creation_datetime, " + 775 "sunvectorz, loaded_creation_datetime, " +
776 "loaded_creation_id) values ( ?RegionUUID, ?BlockTerraform, " + 776 "loaded_creation_id) values (?RegionUUID, ?BlockTerraform, " +
777 "?BlockFly, ?AllowDamage, ?RestrictPushing, " + 777 "?BlockFly, ?AllowDamage, ?RestrictPushing, " +
778 "?AllowLandResell, ?AllowLandJoinDivide, " + 778 "?AllowLandResell, ?AllowLandJoinDivide, " +
779 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " + 779 "?BlockShowInSearch, ?AgentLimit, ?ObjectBonus, " +
diff --git a/OpenSim/Data/MySQL/MySQLUserAccountData.cs b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
index 5352727..d48144d 100644
--- a/OpenSim/Data/MySQL/MySQLUserAccountData.cs
+++ b/OpenSim/Data/MySQL/MySQLUserAccountData.cs
@@ -146,7 +146,7 @@ namespace OpenSim.Data.MySQL
146 { 146 {
147 string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" + 147 string insert = "insert into `" + m_Realm + "` (`UUID`, `ScopeID`, `" +
148 String.Join("`, `", fields) + 148 String.Join("`, `", fields) +
149 "`) values ( ?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")"; 149 "`) values (?principalID, ?scopeID, ?" + String.Join(", ?", fields) + ")";
150 150
151 cmd.CommandText = insert; 151 cmd.CommandText = insert;
152 152
diff --git a/OpenSim/Data/Null/NullRegionData.cs b/OpenSim/Data/Null/NullRegionData.cs
index 218fcd0..e8263ea 100644
--- a/OpenSim/Data/Null/NullRegionData.cs
+++ b/OpenSim/Data/Null/NullRegionData.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Data.Null
47 { 47 {
48 List<RegionData> ret = new List<RegionData>(); 48 List<RegionData> ret = new List<RegionData>();
49 49
50 foreach(RegionData r in m_regionData.Values) 50 foreach (RegionData r in m_regionData.Values)
51 { 51 {
52 if (regionName.Contains("%")) 52 if (regionName.Contains("%"))
53 { 53 {
@@ -71,7 +71,7 @@ namespace OpenSim.Data.Null
71 { 71 {
72 List<RegionData> ret = new List<RegionData>(); 72 List<RegionData> ret = new List<RegionData>();
73 73
74 foreach(RegionData r in m_regionData.Values) 74 foreach (RegionData r in m_regionData.Values)
75 { 75 {
76 if (r.posX == posX && r.posY == posY) 76 if (r.posX == posX && r.posY == posY)
77 ret.Add(r); 77 ret.Add(r);
@@ -95,7 +95,7 @@ namespace OpenSim.Data.Null
95 { 95 {
96 List<RegionData> ret = new List<RegionData>(); 96 List<RegionData> ret = new List<RegionData>();
97 97
98 foreach(RegionData r in m_regionData.Values) 98 foreach (RegionData r in m_regionData.Values)
99 { 99 {
100 if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY) 100 if (r.posX >= startX && r.posX <= endX && r.posY >= startY && r.posY <= endY)
101 ret.Add(r); 101 ret.Add(r);
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
index ea205a2..2b336bb 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/RegionCache.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Reflection; 30using System.Reflection;
4 31
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 51bb114..ec262b0 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -3517,7 +3517,7 @@ if (m_shape != null) {
3517 } 3517 }
3518 else 3518 else
3519 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like 3519 { // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like
3520 // (mumbles, well, at least if you have infinte CPU powers :-) ) 3520 // (mumbles, well, at least if you have infinte CPU powers :-))
3521 PhysicsActor pa = this.PhysActor; 3521 PhysicsActor pa = this.PhysActor;
3522 if (pa != null) 3522 if (pa != null)
3523 { 3523 {
diff --git a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
index 6b30959..c7bb56a 100644
--- a/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/Voice/FreeSwitchVoice/FreeSwitchVoiceModule.cs
@@ -260,12 +260,12 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
260 260
261 public void PostInitialise() 261 public void PostInitialise()
262 { 262 {
263 if(m_pluginEnabled) 263 if (m_pluginEnabled)
264 { 264 {
265 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene"); 265 m_log.Info("[FreeSwitchVoice] registering IVoiceModule with the scene");
266 266
267 // register the voice interface for this module, so the script engine can call us 267 // register the voice interface for this module, so the script engine can call us
268 m_scene.RegisterModuleInterface<IVoiceModule>(this); 268 m_scene.RegisterModuleInterface<IVoiceModule>(this);
269 } 269 }
270 } 270 }
271 271
@@ -811,7 +811,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Voice.FreeSwitchVoice
811 811
812 lock (m_ParcelAddress) 812 lock (m_ParcelAddress)
813 { 813 {
814 if (m_ParcelAddress.ContainsKey( land.GlobalID.ToString() )) 814 if (m_ParcelAddress.ContainsKey(land.GlobalID.ToString()))
815 { 815 {
816 m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}", 816 m_log.DebugFormat("[FreeSwitchVoice]: parcel id {0}: using sip address {1}",
817 land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]); 817 land.GlobalID, m_ParcelAddress[land.GlobalID.ToString()]);
diff --git a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
index 805c3d4..964d0bb 100644
--- a/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
+++ b/OpenSim/Region/OptionalModules/Avatar/XmlRpcGroups/XmlRpcGroupsServicesConnectorModule.cs
@@ -871,7 +871,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.XmlRpcGroups
871 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function); 871 m_log.ErrorFormat("[XMLRPCGROUPDATA]: An error has occured while attempting to access the XmlRpcGroups server method: {0}", function);
872 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString()); 872 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", e.ToString());
873 873
874 foreach( string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None)) 874 foreach (string ResponseLine in req.RequestResponse.Split(new string[] { Environment.NewLine },StringSplitOptions.None))
875 { 875 {
876 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine); 876 m_log.ErrorFormat("[XMLRPCGROUPDATA]: {0} ", ResponseLine);
877 } 877 }
diff --git a/OpenSim/Region/Physics/Meshing/Mesh.cs b/OpenSim/Region/Physics/Meshing/Mesh.cs
index 7567556..aae8871 100644
--- a/OpenSim/Region/Physics/Meshing/Mesh.cs
+++ b/OpenSim/Region/Physics/Meshing/Mesh.cs
@@ -149,7 +149,7 @@ namespace OpenSim.Region.Physics.Meshing
149 149
150 public float[] getVertexListAsFloatLocked() 150 public float[] getVertexListAsFloatLocked()
151 { 151 {
152 if( pinnedVirtexes.IsAllocated ) 152 if (pinnedVirtexes.IsAllocated)
153 return (float[])(pinnedVirtexes.Target); 153 return (float[])(pinnedVirtexes.Target);
154 float[] result; 154 float[] result;
155 155
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 0873035..56eb359 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -171,7 +171,7 @@ namespace OpenSim.Region.Physics.Meshing
171 171
172 } 172 }
173 173
174 private ulong GetMeshKey( PrimitiveBaseShape pbs, PhysicsVector size, float lod ) 174 private ulong GetMeshKey(PrimitiveBaseShape pbs, PhysicsVector size, float lod)
175 { 175 {
176 ulong hash = 5381; 176 ulong hash = 5381;
177 177
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
index 5a94957..fe26429 100644
--- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs
@@ -546,11 +546,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
546 bool retried = false; 546 bool retried = false;
547 do 547 do
548 { 548 {
549 lock (CScodeProvider) 549 lock (CScodeProvider)
550 { 550 {
551 results = CScodeProvider.CompileAssemblyFromSource( 551 results = CScodeProvider.CompileAssemblyFromSource(
552 parameters, Script); 552 parameters, Script);
553 } 553 }
554 // Deal with an occasional segv in the compiler. 554 // Deal with an occasional segv in the compiler.
555 // Rarely, if ever, occurs twice in succession. 555 // Rarely, if ever, occurs twice in succession.
556 // Line # == 0 and no file name are indications that 556 // Line # == 0 and no file name are indications that
@@ -573,20 +573,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
573 { 573 {
574 complete = true; 574 complete = true;
575 } 575 }
576 } 576 } while (!complete);
577 while(!complete);
578 break; 577 break;
579 case enumCompileType.js: 578 case enumCompileType.js:
580 results = JScodeProvider.CompileAssemblyFromSource( 579 results = JScodeProvider.CompileAssemblyFromSource(
581 parameters, Script); 580 parameters, Script);
582 break; 581 break;
583 case enumCompileType.yp: 582 case enumCompileType.yp:
584 results = YPcodeProvider.CompileAssemblyFromSource( 583 results = YPcodeProvider.CompileAssemblyFromSource(
585 parameters, Script); 584 parameters, Script);
586 break; 585 break;
587 default: 586 default:
588 throw new Exception("Compiler is not able to recongnize "+ 587 throw new Exception("Compiler is not able to recongnize "+
589 "language type \"" + lang.ToString() + "\""); 588 "language type \"" + lang.ToString() + "\"");
590 } 589 }
591 590
592 // Check result 591 // Check result
@@ -602,12 +601,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
602 { 601 {
603 foreach (CompilerError CompErr in results.Errors) 602 foreach (CompilerError CompErr in results.Errors)
604 { 603 {
605 604 string severity = CompErr.IsWarning ? "Warning" : "Error";
606 string severity = "Error";
607 if (CompErr.IsWarning)
608 {
609 severity = "Warning";
610 }
611 605
612 KeyValuePair<int, int> lslPos; 606 KeyValuePair<int, int> lslPos;
613 607
@@ -615,18 +609,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools
615 609
616 if (severity == "Error") 610 if (severity == "Error")
617 { 611 {
618 lslPos = FindErrorPosition(CompErr.Line, CompErr.Column); 612 lslPos = FindErrorPosition(CompErr.Line, CompErr.Column);
619 string text = CompErr.ErrorText; 613 string text = CompErr.ErrorText;
620 614
621 // Use LSL type names 615 // Use LSL type names
622 if (lang == enumCompileType.lsl) 616 if (lang == enumCompileType.lsl)
623 text = ReplaceTypes(CompErr.ErrorText); 617 text = ReplaceTypes(CompErr.ErrorText);
624 618
625 // The Second Life viewer's script editor begins 619 // The Second Life viewer's script editor begins
626 // countingn lines and columns at 0, so we subtract 1. 620 // countingn lines and columns at 0, so we subtract 1.
627 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", 621 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
628 lslPos.Key - 1, lslPos.Value - 1, 622 lslPos.Key - 1, lslPos.Value - 1,
629 CompErr.ErrorNumber, text, severity); 623 CompErr.ErrorNumber, text, severity);
630 hadErrors = true; 624 hadErrors = true;
631 } 625 }
632 } 626 }
diff --git a/OpenSim/Server/Base/ServerUtils.cs b/OpenSim/Server/Base/ServerUtils.cs
index 656fcf5..db3a4ce 100644
--- a/OpenSim/Server/Base/ServerUtils.cs
+++ b/OpenSim/Server/Base/ServerUtils.cs
@@ -188,7 +188,7 @@ namespace OpenSim.Server.Base
188 { 188 {
189 string qstring = String.Empty; 189 string qstring = String.Empty;
190 190
191 foreach(KeyValuePair<string, string> kvp in data) 191 foreach (KeyValuePair<string, string> kvp in data)
192 { 192 {
193 string part; 193 string part;
194 if (kvp.Value != String.Empty) 194 if (kvp.Value != String.Empty)
diff --git a/OpenSim/Tests/Clients/Grid/GridClient.cs b/OpenSim/Tests/Clients/Grid/GridClient.cs
index ccda661..8798c5e 100644
--- a/OpenSim/Tests/Clients/Grid/GridClient.cs
+++ b/OpenSim/Tests/Clients/Grid/GridClient.cs
@@ -1,4 +1,31 @@
1using System; 1/*
2 * Copyright (c) Contributors, http://opensimulator.org/
3 * See CONTRIBUTORS.TXT for a full list of copyright holders.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met:
7 * * Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * * Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
12 * * Neither the name of the OpenSimulator Project nor the
13 * names of its contributors may be used to endorse or promote products
14 * derived from this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY
17 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27
28using System;
2using System.Collections.Generic; 29using System.Collections.Generic;
3using System.Text; 30using System.Text;
4using System.Reflection; 31using System.Reflection;
diff --git a/OpenSim/Tools/Compiler/Program.cs b/OpenSim/Tools/Compiler/Program.cs
index 9cd6bc8..b18e029 100644
--- a/OpenSim/Tools/Compiler/Program.cs
+++ b/OpenSim/Tools/Compiler/Program.cs
@@ -37,19 +37,19 @@ namespace OpenSim.Tools.LSL.Compiler
37 class Program 37 class Program
38 { 38 {
39 private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap; 39 private static Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> m_positionMap;
40 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider(); 40 private static CSharpCodeProvider CScodeProvider = new CSharpCodeProvider();
41 41
42 static void Main(string[] args) 42 static void Main(string[] args)
43 { 43 {
44 string source = null; 44 string source = null;
45 45
46 if(args.Length == 0) 46 if (args.Length == 0)
47 { 47 {
48 Console.WriteLine("No input file specified"); 48 Console.WriteLine("No input file specified");
49 Environment.Exit(1); 49 Environment.Exit(1);
50 } 50 }
51 51
52 if(!File.Exists(args[0])) 52 if (!File.Exists(args[0]))
53 { 53 {
54 Console.WriteLine("Input file does not exist"); 54 Console.WriteLine("Input file does not exist");
55 Environment.Exit(1); 55 Environment.Exit(1);
@@ -136,11 +136,7 @@ namespace OpenSim.Tools.LSL.Compiler
136 string errtext = String.Empty; 136 string errtext = String.Empty;
137 foreach (CompilerError CompErr in results.Errors) 137 foreach (CompilerError CompErr in results.Errors)
138 { 138 {
139 string severity = "Error"; 139 string severity = CompErr.IsWarning ? "Warning" : "Error";
140 if ( CompErr.IsWarning )
141 {
142 severity = "Warning";
143 }
144 140
145 KeyValuePair<int, int> lslPos; 141 KeyValuePair<int, int> lslPos;
146 142
@@ -153,8 +149,8 @@ namespace OpenSim.Tools.LSL.Compiler
153 // The Second Life viewer's script editor begins 149 // The Second Life viewer's script editor begins
154 // countingn lines and columns at 0, so we subtract 1. 150 // countingn lines and columns at 0, so we subtract 1.
155 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n", 151 errtext += String.Format("Line ({0},{1}): {4} {2}: {3}\n",
156 lslPos.Key - 1, lslPos.Value - 1, 152 lslPos.Key - 1, lslPos.Value - 1,
157 CompErr.ErrorNumber, text, severity); 153 CompErr.ErrorNumber, text, severity);
158 } 154 }
159 155
160 disp = "Completed with errors"; 156 disp = "Completed with errors";
@@ -237,20 +233,20 @@ namespace OpenSim.Tools.LSL.Compiler
237 private static string ReplaceTypes(string message) 233 private static string ReplaceTypes(string message)
238 { 234 {
239 message = message.Replace( 235 message = message.Replace(
240 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString", 236 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString",
241 "string"); 237 "string");
242 238
243 message = message.Replace( 239 message = message.Replace(
244 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger", 240 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger",
245 "integer"); 241 "integer");
246 242
247 message = message.Replace( 243 message = message.Replace(
248 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat", 244 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat",
249 "float"); 245 "float");
250 246
251 message = message.Replace( 247 message = message.Replace(
252 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list", 248 "OpenSim.Region.ScriptEngine.Shared.LSL_Types.list",
253 "list"); 249 "list");
254 250
255 return message; 251 return message;
256 } 252 }
@@ -263,7 +259,7 @@ namespace OpenSim.Tools.LSL.Compiler
263 private class kvpSorter : IComparer<KeyValuePair<int,int>> 259 private class kvpSorter : IComparer<KeyValuePair<int,int>>
264 { 260 {
265 public int Compare(KeyValuePair<int,int> a, 261 public int Compare(KeyValuePair<int,int> a,
266 KeyValuePair<int,int> b) 262 KeyValuePair<int,int> b)
267 { 263 {
268 return a.Key.CompareTo(b.Key); 264 return a.Key.CompareTo(b.Key);
269 } 265 }