From 44ab16f93d4007f0bbd1591e2830bae0332aeef2 Mon Sep 17 00:00:00 2001 From: Kent Hansen Date: Sun, 19 Feb 2012 18:52:19 +0100 Subject: 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 Reviewed-by: Olivier Goffart --- src/tools/moc/generator.cpp | 4 ++-- src/tools/moc/generator.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/tools') diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index 937a62e87c..3362a1abc1 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -443,7 +443,7 @@ void Generator::generateClassInfos() } } -void Generator::generateFunctions(QList& list, const char *functype, int type) +void Generator::generateFunctions(const QList& list, const char *functype, int type) { if (list.isEmpty()) return; @@ -492,7 +492,7 @@ void Generator::generateFunctions(QList& list, const char *functype } } -void Generator::generateFunctionRevisions(QList& list, const char *functype) +void Generator::generateFunctionRevisions(const QList& list, const char *functype) { if (list.count()) fprintf(out, "\n // %ss: revision\n", functype); diff --git a/src/tools/moc/generator.h b/src/tools/moc/generator.h index 4e96511695..46eee4ca06 100644 --- a/src/tools/moc/generator.h +++ b/src/tools/moc/generator.h @@ -56,8 +56,8 @@ public: void generateCode(); private: void generateClassInfos(); - void generateFunctions(QList &list, const char *functype, int type); - void generateFunctionRevisions(QList& list, const char *functype); + void generateFunctions(const QList &list, const char *functype, int type); + void generateFunctionRevisions(const QList& list, const char *functype); void generateEnums(int index); void generateProperties(); void generateMetacall(); -- cgit v1.2.3