From a1ed9ccf7330354d5df5083b44643f2a7e56b748 Mon Sep 17 00:00:00 2001 From: Steven Bennetts Date: Sat, 29 Aug 2009 06:23:41 +0000 Subject: 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) --- indra/lscript/lscript_compile/lscript_tree.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'indra/lscript/lscript_compile') 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::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) -- cgit v1.2.3