diff options
author | Steven Bennetts <steve@lindenlab.com> | 2009-08-29 06:23:41 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2009-08-29 06:23:41 +0000 |
commit | a1ed9ccf7330354d5df5083b44643f2a7e56b748 (patch) | |
tree | 75caa29925495a74548111da1800d67126343d13 /indra/lscript/lscript_compile/lscript_tree.cpp | |
parent | c4384d64a11fe96764f240a9e220989ad5546f16 (diff) |
Partial merge of: viewer-2.0.0-3@131138 texture-pipeline-3@131862 -> viewer-2.0.0-3
Includes:
* DEV-31909 VWR-13251: Revise lscript_library.cpp to allow localization of LSL editor hovertips
* DEV-21938 llSHA1String does not appear where expected in the dropdown "Insert" menu in the LSL editor
* Some cleanup to llerror so that it doesn't depend on llfixedbuffer
* A few misc. server specific changes not related to the texture-pipeline changes (llapp, lloptioninterface)
Diffstat (limited to 'indra/lscript/lscript_compile/lscript_tree.cpp')
-rw-r--r-- | indra/lscript/lscript_compile/lscript_tree.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/indra/lscript/lscript_compile/lscript_tree.cpp b/indra/lscript/lscript_compile/lscript_tree.cpp index e291d4c6f8..98146d6f2b 100644 --- a/indra/lscript/lscript_compile/lscript_tree.cpp +++ b/indra/lscript/lscript_compile/lscript_tree.cpp @@ -10673,20 +10673,21 @@ void LLScriptScript::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa { mGlobalScope = new LLScriptScope(gScopeStringTable); // zeroth, add library functions to global scope - S32 i; + U16 function_index = 0; const char *arg; LLScriptScopeEntry *sentry; - for (i = 0; i < gScriptLibrary.mNextNumber; i++) + for (std::vector<LLScriptLibraryFunction>::const_iterator i = gScriptLibrary.mFunctions.begin(); + i != gScriptLibrary.mFunctions.end(); ++i) { // First, check to make sure this isn't a god only function, or that the viewer's agent is a god. - if (!gScriptLibrary.mFunctions[i]->mGodOnly || mGodLike) + if (!i->mGodOnly || mGodLike) { - if (gScriptLibrary.mFunctions[i]->mReturnType) - sentry = mGlobalScope->addEntry(gScriptLibrary.mFunctions[i]->mName, LIT_LIBRARY_FUNCTION, char2type(*gScriptLibrary.mFunctions[i]->mReturnType)); + if (i->mReturnType) + sentry = mGlobalScope->addEntry(i->mName, LIT_LIBRARY_FUNCTION, char2type(*i->mReturnType)); else - sentry = mGlobalScope->addEntry(gScriptLibrary.mFunctions[i]->mName, LIT_LIBRARY_FUNCTION, LST_NULL); - sentry->mLibraryNumber = i; - arg = gScriptLibrary.mFunctions[i]->mArgs; + sentry = mGlobalScope->addEntry(i->mName, LIT_LIBRARY_FUNCTION, LST_NULL); + sentry->mLibraryNumber = function_index; + arg = i->mArgs; if (arg) { while (*arg) @@ -10698,6 +10699,7 @@ void LLScriptScript::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa } } } + function_index++; } // first go and collect all the global variables if (mGlobals) |