summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_compile/lscript_bytecode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/lscript/lscript_compile/lscript_bytecode.cpp')
-rwxr-xr-xindra/lscript/lscript_compile/lscript_bytecode.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/indra/lscript/lscript_compile/lscript_bytecode.cpp b/indra/lscript/lscript_compile/lscript_bytecode.cpp
index 95b2f35a94..667e5dafc1 100755
--- a/indra/lscript/lscript_compile/lscript_bytecode.cpp
+++ b/indra/lscript/lscript_compile/lscript_bytecode.cpp
@@ -40,8 +40,8 @@ LLScriptJumpTable::LLScriptJumpTable()
LLScriptJumpTable::~LLScriptJumpTable()
{
- mLabelMap.deleteAllData();
- mJumpMap.deleteAllData();
+ delete_and_clear(mLabelMap);
+ delete_and_clear(mJumpMap);
}
void LLScriptJumpTable::addLabel(char *name, S32 offset)
@@ -203,17 +203,14 @@ void LLScriptByteCodeChunk::addJump(char *name)
void LLScriptByteCodeChunk::connectJumps()
{
- char *jump;
- S32 offset, jumppos;
-
if (mJumpTable)
{
- for (jump = mJumpTable->mJumpMap.getFirstKey();
- jump;
- jump = mJumpTable->mJumpMap.getNextKey())
+ for(std::map<char *, S32 *>::iterator it = mJumpTable->mJumpMap.begin(), end_it = mJumpTable->mJumpMap.end();
+ it != end_it;
+ ++it)
{
- jumppos = *mJumpTable->mJumpMap[jump];
- offset = *mJumpTable->mLabelMap[jump] - jumppos;
+ S32 jumppos = *it->second;
+ S32 offset = *mJumpTable->mLabelMap[it->first] - jumppos;
jumppos = jumppos - 4;
integer2bytestream(mCodeChunk, jumppos, offset);
}
@@ -308,7 +305,7 @@ void LLScriptScriptCodeChunk::build(LLFILE *efp, LLFILE *bcfp)
if (fwrite(mCompleteCode, 1, mTotalSize, bcfp) != (size_t)mTotalSize)
{
- llwarns << "Short write" << llendl;
+ LL_WARNS() << "Short write" << LL_ENDL;
}
}
else