From 65c5efe43b68700bad94076d4cd421160203c5de Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Fri, 16 May 2008 01:22:11 +0000
Subject: Formatting cleanup.
---
.../Region/ScriptEngine/LSOEngine/LSO/Engine.cs | 10 ++++----
.../LSOEngine/LSO/LSL_BaseClass_OPCODES.cs | 4 ++--
.../ScriptEngine/LSOEngine/LSO/LSO_Parser.cs | 28 +++-------------------
3 files changed, 10 insertions(+), 32 deletions(-)
(limited to 'OpenSim/Region/ScriptEngine/LSOEngine/LSO')
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
index 0208350..f53772e 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/Engine.cs
@@ -168,7 +168,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
Common.SendToDebug("IL_CREATE_CONSTRUCTOR()");
//ConstructorBuilder constructor = typeBuilder.DefineConstructor(
// MethodAttributes.Public,
- // CallingConventions.Standard,
+ // CallingConventions.Standard,
// new Type[0]);
ConstructorBuilder constructor = typeBuilder.DefineConstructor(
MethodAttributes.Public |
@@ -192,8 +192,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//// Create state object
//FieldName = "State";
//FieldBuilder State_fb = typeBuilder.DefineField(
- // FieldName,
- // typeof(UInt32),
+ // FieldName,
+ // typeof(UInt32),
// FieldAttributes.Public);
//il.Emit(OpCodes.Ldarg_0);
//il.Emit(OpCodes.Ldc_I4, 0);
@@ -206,8 +206,8 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//FieldName = "LSL_BuiltIns";
//FieldBuilder LSL_BuiltIns_fb = typeBuilder.DefineField(
- // FieldName,
- // objType1,
+ // FieldName,
+ // objType1,
// FieldAttributes.Public);
////LSL_BuiltIn_Commands_TestImplementation _ti = new LSL_BuiltIn_Commands_TestImplementation();
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
index 1b73311..7805aa3 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSL_BaseClass_OPCODES.cs
@@ -34,9 +34,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// *
// * These are internal "assembly" commands,
// * basic operators like "ADD", "PUSH" and "POP"
- // *
+ // *
// * It also contains managed stack and keeps track of internal variables, etc.
- // *
+ // *
// */
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
index 06ae1e9..b2a2f25 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/LSO/LSO_Parser.cs
@@ -69,14 +69,12 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
fs.Close();
}
-
///
/// Parse LSO file.
///
public void Parse()
{
- // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
-
+ // The LSO Format consist of 6 major blocks: header, statics, functions, states, heap, and stack.
// HEADER BLOCK
Common.SendToDebug("Reading HEADER BLOCK at: 0");
@@ -156,7 +154,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
Common.SendToDebug("Number of Static Blocks read: " + StaticBlockCount);
-
// FUNCTION BLOCK
// Always right after STATIC BLOCK
LSO_Struct.FunctionBlock myFunctionBlock = new LSO_Struct.FunctionBlock();
@@ -186,7 +183,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
-
// STATE FRAME BLOCK
// Always right after FUNCTION BLOCK
Common.SendToDebug("Reading STATE BLOCK at: " + myHeader.SR);
@@ -213,7 +209,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
-
// STATE BLOCK
// For each StateFrameBlock there is one StateBlock with multiple event handlers
@@ -239,7 +234,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// We need to count number of bits flagged in EventMask?
-
// for each bit in myStateFrameBlock.StatePointer[i].EventMask
// ADDING TO ALL RIGHT NOW, SHOULD LIMIT TO ONLY THE ONES IN USE
@@ -273,7 +267,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
-
//// READ FUNCTION CODE CHUNKS
//// Functions + Function start pos (GFR)
//// TODO: Somehow be able to identify and reference this
@@ -293,7 +286,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
for (int i = 0; i < myStateFrameBlock.StateCount; i++)
{
- // TODO: Somehow organize events and functions so they can be found again,
+ // TODO: Somehow organize events and functions so they can be found again,
// two level search ain't no good
for (int ii = 0; ii < myStateFrameBlock.StatePointer[i].EventMask.Count - 1; ii++)
{
@@ -320,7 +313,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
}
}
-
if (Common.IL_CreateFunctionList)
IL_INSERT_FUNCTIONLIST();
}
@@ -371,7 +363,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//private byte[] br_read_smallendian(int len)
//{
- // byte[] bytes = new byte[len];
+ // byte[] bytes = new byte[len];
// br.Read(bytes,0, len);
// return bytes;
//}
@@ -459,7 +451,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
Common.SendToDebug("Return type #" + myCodeChunk.ReturnType.ObjectType + ": " +
((LSO_Enums.Variable_Type_Codes) myCodeChunk.ReturnType.ObjectType).ToString());
-
// TODO: How to determine number of codechunks -- does this method work?
myCodeChunk.CodeChunkArguments = new List();
byte reader = br_read(1)[0];
@@ -492,7 +483,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
// End marker is 0x000
myCodeChunk.EndMarker = reader;
-
//
// Emit: START OF METHOD (FUNCTION)
//
@@ -515,11 +505,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
Common.SendToDebug("CLR:" + eventname + ":ILGenerator il = methodBuilder.GetILGenerator();");
ILGenerator il = methodBuilder.GetILGenerator();
-
if (Common.IL_UseTryCatch)
IL_INSERT_TRY(il, eventname);
-
// Push Console.WriteLine command to stack ... Console.WriteLine("Hello World!");
//Common.SendToDebug("CLR:" + eventname + ":il.Emit(OpCodes.Call...");
//il.Emit(OpCodes.Call, typeof(Console).GetMethod
@@ -534,7 +522,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
il.Emit(OpCodes.Ldarg, _ic);
}
-
//
// CALLING OPCODE PROCESSOR, one command at the time TO GENERATE IL
//
@@ -544,7 +531,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
FoundRet = LSL_PROCESS_OPCODE(il);
}
-
if (Common.IL_UseTryCatch)
IL_INSERT_END_TRY(il, eventname);
@@ -558,17 +544,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
Common.SendToDebug("Creating function list");
-
string eventname = "GetFunctions";
Common.SendToDebug("Creating IL " + eventname);
// Define a private String field.
//FieldBuilder myField = myTypeBuilder.DefineField("EventList", typeof(String[]), FieldAttributes.Public);
-
//FieldBuilder mem = typeBuilder.DefineField("mem", typeof(Array), FieldAttributes.Private);
-
MethodBuilder methodBuilder = typeBuilder.DefineMethod(eventname,
MethodAttributes.Public,
typeof (string[]),
@@ -579,7 +562,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
ILGenerator il = methodBuilder.GetILGenerator();
-
// IL_INSERT_TRY(il, eventname);
// // Push string to stack
@@ -615,17 +597,14 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
//il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("AddFunction", new Type[] { typeof(string) }));
}
-
// IL_INSERT_END_TRY(il, eventname);
-
il.Emit(OpCodes.Ldloc_0); // Load local variable 0 onto stack
// il.Emit(OpCodes.Call, typeof(LSL_BaseClass).GetMethod("SetFunctionList", new Type[] { typeof(Array) }));
il.Emit(OpCodes.Ret); // Return
}
-
private void IL_INSERT_TRY(ILGenerator il, string eventname)
{
/*
@@ -687,7 +666,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine.LSO
{
Common.SendToDebug("Found cached STATIC BLOCK");
-
return StaticBlocks[pos];
}
--
cgit v1.1