summaryrefslogtreecommitdiff
path: root/indra/lscript/lscript_compile/lscript_tree.cpp
diff options
context:
space:
mode:
authorBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
committerBryan O'Sullivan <bos@lindenlab.com>2009-08-31 13:47:47 -0700
commit30ff6cabd61f2f083df5df1e6e70cc94742af477 (patch)
tree631935f1cf59d19a91cdad65e9a75fe825afda7d /indra/lscript/lscript_compile/lscript_tree.cpp
parentff11d74820c89822cd067b51727d9df1dc87d0d0 (diff)
parent3ac3a4b206c08ed06b889bdaa24074b6aa0e020a (diff)
Merge with trunk
Diffstat (limited to 'indra/lscript/lscript_compile/lscript_tree.cpp')
-rw-r--r--indra/lscript/lscript_compile/lscript_tree.cpp18
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 7fa115bb20..3b8bbbe805 100644
--- a/indra/lscript/lscript_compile/lscript_tree.cpp
+++ b/indra/lscript/lscript_compile/lscript_tree.cpp
@@ -10679,20 +10679,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)
@@ -10704,6 +10705,7 @@ void LLScriptScript::recurse(LLFILE *fp, S32 tabs, S32 tabsize, LSCRIPTCompilePa
}
}
}
+ function_index++;
}
// first go and collect all the global variables
if (mGlobals)