summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_execute
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript/lscript_execute')
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/CMakeLists.txt3
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/llscriptresource.cpp0
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/llscriptresourceconsumer.cpp2
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/llscriptresourcepool.cpp0
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/lscript_execute.cpp44
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/lscript_heapruntime.cpp0
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/lscript_heapruntime.h0
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/lscript_readlso.cpp17
-rwxr-xr-x[-rw-r--r--]indra/lscript/lscript_execute/lscript_readlso.h1
9 files changed, 30 insertions, 37 deletions
diff --git a/indra/lscript/lscript_execute/CMakeLists.txt b/indra/lscript/lscript_execute/CMakeLists.txt
index 3a16ffdc01..49605982a8 100644..100755
--- a/indra/lscript/lscript_execute/CMakeLists.txt
+++ b/indra/lscript/lscript_execute/CMakeLists.txt
@@ -10,6 +10,9 @@ include_directories(
${LLMATH_INCLUDE_DIRS}
${LSCRIPT_INCLUDE_DIRS}
)
+include_directories(SYSTEM
+ ${LLCOMMON_SYSTEM_INCLUDE_DIRS}
+ )
set(lscript_execute_SOURCE_FILES
llscriptresource.cpp
diff --git a/indra/lscript/lscript_execute/llscriptresource.cpp b/indra/lscript/lscript_execute/llscriptresource.cpp
index 2c6811b226..2c6811b226 100644..100755
--- a/indra/lscript/lscript_execute/llscriptresource.cpp
+++ b/indra/lscript/lscript_execute/llscriptresource.cpp
diff --git a/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp b/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
index 55d47b6de2..0ce5eb7dab 100644..100755
--- a/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
+++ b/indra/lscript/lscript_execute/llscriptresourceconsumer.cpp
@@ -56,7 +56,7 @@ bool LLScriptResourceConsumer::switchScriptResourcePools(LLScriptResourcePool& n
{
if (&new_pool == &LLScriptResourcePool::null)
{
- llwarns << "New pool is null" << llendl;
+ LL_WARNS() << "New pool is null" << LL_ENDL;
}
if (isInPool(new_pool))
diff --git a/indra/lscript/lscript_execute/llscriptresourcepool.cpp b/indra/lscript/lscript_execute/llscriptresourcepool.cpp
index 6bdc2bbd48..6bdc2bbd48 100644..100755
--- a/indra/lscript/lscript_execute/llscriptresourcepool.cpp
+++ b/indra/lscript/lscript_execute/llscriptresourcepool.cpp
diff --git a/indra/lscript/lscript_execute/lscript_execute.cpp b/indra/lscript/lscript_execute/lscript_execute.cpp
index d79e9f8bde..5eb7ffc5a9 100644..100755
--- a/indra/lscript/lscript_execute/lscript_execute.cpp
+++ b/indra/lscript/lscript_execute/lscript_execute.cpp
@@ -35,7 +35,6 @@
#include "lscript_library.h"
#include "lscript_heapruntime.h"
#include "lscript_alloc.h"
-#include "llstat.h"
// Static
@@ -77,7 +76,7 @@ LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
filesize = 0;
} else {
filesize = bytestream2integer(sizearray, pos);
@@ -86,7 +85,7 @@ LLScriptExecuteLSL2::LLScriptExecuteLSL2(LLFILE *fp)
fseek(fp, 0, SEEK_SET);
if (fread(mBuffer, 1, filesize, fp) != filesize)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
fclose(fp);
@@ -290,7 +289,7 @@ void LLScriptExecuteLSL2::init()
void LLScriptExecuteLSL2::recordBoundaryError( const LLUUID &id )
{
set_fault(mBuffer, LSRF_BOUND_CHECK_ERROR);
- llwarns << "Script boundary error for ID " << id << llendl;
+ LL_WARNS() << "Script boundary error for ID " << id << LL_ENDL;
}
@@ -418,10 +417,13 @@ void LLScriptExecuteLSL2::callEventHandler(LSCRIPTStateEventType event, const LL
void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, const LLUUID &id, F32 time_slice)
{
S32 major_version = getMajorVersion();
- LLScriptDataCollection* eventdata;
- for (eventdata = mEventData.mEventDataList.getFirstData(); eventdata; eventdata = mEventData.mEventDataList.getNextData())
+ for (std::list<LLScriptDataCollection*>::iterator it = mEventData.mEventDataList.begin(), end_it = mEventData.mEventDataList.end();
+ it != end_it;
+ ++it)
{
+ LLScriptDataCollection* eventdata = *it;
+
if (eventdata->mType == event)
{
// push a zero to be popped
@@ -459,7 +461,8 @@ void LLScriptExecuteLSL2::callQueuedEventHandler(LSCRIPTStateEventType event, co
S32 opcode_start = get_state_event_opcoode_start(mBuffer, current_state, event);
set_ip(mBuffer, opcode_start);
- mEventData.mEventDataList.deleteCurrentData();
+ delete *it;
+ mEventData.mEventDataList.erase(it);
break;
}
}
@@ -514,7 +517,7 @@ void LLScriptExecuteLSL2::callNextQueuedEventHandler(U64 event_register, const L
}
else
{
- llwarns << "Somehow got an event that we're not registered for!" << llendl;
+ LL_WARNS() << "Somehow got an event that we're not registered for!" << LL_ENDL;
}
delete eventdata;
}
@@ -622,7 +625,7 @@ S32 LLScriptExecuteLSL2::writeState(U8 **dest, U32 header_size, U32 footer_size)
// registers
integer2bytestream(*dest, dest_offset, registers_size);
- // llinfos << "Writing CE: " << getCurrentEvents() << llendl;
+ // LL_INFOS() << "Writing CE: " << getCurrentEvents() << LL_ENDL;
bytestream2bytestream(*dest, dest_offset, mBuffer, src_offset, registers_size);
// heap
@@ -674,11 +677,11 @@ S32 LLScriptExecuteLSL2::readState(U8 *src)
// copy data into register area
bytestream2bytestream(mBuffer, dest_offset, src, src_offset, size);
-// llinfos << "Read CE: " << getCurrentEvents() << llendl;
+// LL_INFOS() << "Read CE: " << getCurrentEvents() << LL_ENDL;
if (get_register(mBuffer, LREG_TM) != TOP_OF_MEMORY)
{
- llwarns << "Invalid state. Top of memory register does not match"
- << " constant." << llendl;
+ LL_WARNS() << "Invalid state. Top of memory register does not match"
+ << " constant." << LL_ENDL;
reset_hp_to_safe_spot(mBuffer);
return -1;
}
@@ -806,16 +809,7 @@ void LLScriptExecute::runInstructions(BOOL b_print, const LLUUID &id,
// is there a fault?
// if yes, print out message and exit
S32 value = getVersion();
- S32 major_version = 0;
- if (value == LSL2_VERSION1_END_NUMBER)
- {
- major_version = 1;
- }
- else if (value == LSL2_VERSION_NUMBER)
- {
- major_version = 2;
- }
- else
+ if ( (value != LSL2_VERSION1_END_NUMBER) && (value != LSL2_VERSION_NUMBER) )
{
setFault(LSRF_VERSION_MISMATCH);
}
@@ -4030,7 +4024,7 @@ void lscript_run(const std::string& filename, BOOL b_debug)
if (filename.empty())
{
- llerrs << "filename is NULL" << llendl;
+ LL_ERRS() << "filename is NULL" << LL_ENDL;
// Just reporting error is likely not enough. Need
// to check how to abort or error out gracefully
// from this function. XXXTBD
@@ -4055,8 +4049,8 @@ void lscript_run(const std::string& filename, BOOL b_debug)
F32 time = timer.getElapsedTimeF32();
F32 ips = execute->mInstructionCount / time;
- llinfos << execute->mInstructionCount << " instructions in " << time << " seconds" << llendl;
- llinfos << ips/1000 << "K instructions per second" << llendl;
+ LL_INFOS() << execute->mInstructionCount << " instructions in " << time << " seconds" << LL_ENDL;
+ LL_INFOS() << ips/1000 << "K instructions per second" << LL_ENDL;
printf("ip: 0x%X\n", get_register(execute->mBuffer, LREG_IP));
printf("sp: 0x%X\n", get_register(execute->mBuffer, LREG_SP));
printf("bp: 0x%X\n", get_register(execute->mBuffer, LREG_BP));
diff --git a/indra/lscript/lscript_execute/lscript_heapruntime.cpp b/indra/lscript/lscript_execute/lscript_heapruntime.cpp
index 749857753d..749857753d 100644..100755
--- a/indra/lscript/lscript_execute/lscript_heapruntime.cpp
+++ b/indra/lscript/lscript_execute/lscript_heapruntime.cpp
diff --git a/indra/lscript/lscript_execute/lscript_heapruntime.h b/indra/lscript/lscript_execute/lscript_heapruntime.h
index 0e924a2036..0e924a2036 100644..100755
--- a/indra/lscript/lscript_execute/lscript_heapruntime.h
+++ b/indra/lscript/lscript_execute/lscript_heapruntime.h
diff --git a/indra/lscript/lscript_execute/lscript_readlso.cpp b/indra/lscript/lscript_execute/lscript_readlso.cpp
index 35caa41ae1..abcb28e998 100644..100755
--- a/indra/lscript/lscript_execute/lscript_readlso.cpp
+++ b/indra/lscript/lscript_execute/lscript_readlso.cpp
@@ -37,7 +37,7 @@ LLScriptLSOParse::LLScriptLSOParse(LLFILE *fp)
S32 pos = 0;
if (fread(&sizearray, 1, 4, fp) != 4)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
filesize = 0;
} else {
filesize = bytestream2integer(sizearray, pos);
@@ -46,7 +46,7 @@ LLScriptLSOParse::LLScriptLSOParse(LLFILE *fp)
fseek(fp, 0, SEEK_SET);
if (fread(mRawData, 1, filesize, fp) != filesize)
{
- llwarns << "Short read" << llendl;
+ LL_WARNS() << "Short read" << LL_ENDL;
}
initOpCodePrinting();
@@ -114,7 +114,7 @@ void LLScriptLSOParse::printRegisters(LLFILE *fp)
else if (gMajorVersion == LSL2_MAJOR_VERSION_TWO)
{
U64 data = get_register_u64(mRawData, (LSCRIPTRegisters)i);
- fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data && 0xFFFFFFFF));
+ fprintf(fp, "%s: 0x%X%X\n", gLSCRIPTRegisterNames[i], (U32)(data>>32), (U32)(data & 0xFFFFFFFF));
}
}
fprintf(fp, "=============================\n\n");
@@ -123,7 +123,7 @@ void LLScriptLSOParse::printRegisters(LLFILE *fp)
void LLScriptLSOParse::printGlobals(LLFILE *fp)
{
// print out registers first
- S32 offset, varoffset;
+ S32 varoffset;
S32 ivalue;
F32 fpvalue;
LLVector3 vvalue;
@@ -144,8 +144,7 @@ void LLScriptLSOParse::printGlobals(LLFILE *fp)
// get offset to skip past name
varoffset = global_v_offset;
- offset = bytestream2integer(mRawData, global_v_offset);
-
+ bytestream2integer(mRawData, global_v_offset);
// get typeexport
type = *(mRawData + global_v_offset++);
@@ -262,8 +261,6 @@ void LLScriptLSOParse::printGlobalFunctions(LLFILE *fp)
fprintf(fp, "[Function #%d] [0x%X] %s\n", function_number, orig_function_offset, name);
fprintf(fp, "\tReturn Type: %s\n", LSCRIPTTypeNames[type]);
type = *(mRawData + function_offset++);
- S32 params;
- params = 0;
S32 pcount = 0;
while (type)
{
@@ -347,16 +344,16 @@ void LLScriptLSOParse::printStates(LLFILE *fp)
read_ahead = event_jump_table;
S32 temp_end;
- S32 dummy;
opcode_end = worst_case_opcode_end;
+ (void)opcode_end;
for (k = LSTT_STATE_BEGIN; k < LSTT_STATE_END; k++)
{
if (event_handlers & LSCRIPTStateBitField[k])
{
temp_end = bytestream2integer(mRawData, read_ahead);
- dummy = bytestream2integer(mRawData, read_ahead);
+ bytestream2integer(mRawData, read_ahead);
if ( (temp_end < opcode_end)
&&(temp_end > event_offset))
{
diff --git a/indra/lscript/lscript_execute/lscript_readlso.h b/indra/lscript/lscript_execute/lscript_readlso.h
index a545a9daf8..f3b2b66746 100644..100755
--- a/indra/lscript/lscript_execute/lscript_readlso.h
+++ b/indra/lscript/lscript_execute/lscript_readlso.h
@@ -28,7 +28,6 @@
#define LL_LSCRIPT_READLSO_H
#include "lscript_byteconvert.h"
-#include "linked_lists.h"
// list of op code print functions
void print_noop(LLFILE *fp, U8 *buffer, S32 &offset, S32 tabs);