diff options
author | Richard Linden <none@none> | 2013-10-08 11:59:24 -0700 |
---|---|---|
committer | Richard Linden <none@none> | 2013-10-08 11:59:24 -0700 |
commit | 80dfbbaacd82179e54163ed48b1bc444e3becbd5 (patch) | |
tree | da3858b58b5ec9c34d6eefa60c4fe87fc5743249 /indra/lscript/lscript_compile/lscript_bytecode.cpp | |
parent | f7158bc5afcec1da8b9d2d5a4ed86921e62d4959 (diff) | |
parent | 2eeee8a9491398697a8f3167bc4f715a3970fc3a (diff) |
merge from viewer-release
Diffstat (limited to 'indra/lscript/lscript_compile/lscript_bytecode.cpp')
-rwxr-xr-x | indra/lscript/lscript_compile/lscript_bytecode.cpp | 19 |
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 |