Small moc cleanup: Pass lists by const reference

generateFunctions() shouldn't (and doesn't) modify the list of
functions, so the list should be passed by const reference.

Change-Id: If5ff810e5623e734816c3089eb8b3fd4f54f2345
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
This commit is contained in:
Kent Hansen 2012-02-19 18:52:19 +01:00 committed by Qt by Nokia
parent fec37f0e9a
commit 44ab16f93d
2 changed files with 4 additions and 4 deletions

View File

@ -443,7 +443,7 @@ void Generator::generateClassInfos()
}
}
void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype, int type)
void Generator::generateFunctions(const QList<FunctionDef>& list, const char *functype, int type)
{
if (list.isEmpty())
return;
@ -492,7 +492,7 @@ void Generator::generateFunctions(QList<FunctionDef>& list, const char *functype
}
}
void Generator::generateFunctionRevisions(QList<FunctionDef>& list, const char *functype)
void Generator::generateFunctionRevisions(const QList<FunctionDef>& list, const char *functype)
{
if (list.count())
fprintf(out, "\n // %ss: revision\n", functype);

View File

@ -56,8 +56,8 @@ public:
void generateCode();
private:
void generateClassInfos();
void generateFunctions(QList<FunctionDef> &list, const char *functype, int type);
void generateFunctionRevisions(QList<FunctionDef>& list, const char *functype);
void generateFunctions(const QList<FunctionDef> &list, const char *functype, int type);
void generateFunctionRevisions(const QList<FunctionDef>& list, const char *functype);
void generateEnums(int index);
void generateProperties();
void generateMetacall();