diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2012-02-20 06:48:17 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-20 11:27:55 +0100 |
commit | cbe21c59a05ceb357c1a6bd2a84480dab0e79ea0 (patch) | |
tree | 35c3b66b4640d981f397f97687eff8da7204ab42 | |
parent | d00db53a12d253fd71d400e413f73817fa43289e (diff) |
Minuscule moc cleanup: Don't declare i in function scope
This is not C.
Furthermore, the function-level i was already shadowed in several
places by "for (int i = 0; ..." blocks later in the function.
Change-Id: Ic1777f78d9838bc2921d68337be05de454bbeabe
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
-rw-r--r-- | src/tools/moc/generator.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/tools/moc/generator.cpp b/src/tools/moc/generator.cpp index f3a2b4a39b..7355275587 100644 --- a/src/tools/moc/generator.cpp +++ b/src/tools/moc/generator.cpp @@ -140,13 +140,11 @@ void Generator::generateCode() // // build the data array // - int i = 0; - // filter out undeclared enumerators and sets { QList<EnumDef> enumList; - for (i = 0; i < cdef->enumList.count(); ++i) { + for (int i = 0; i < cdef->enumList.count(); ++i) { EnumDef def = cdef->enumList.at(i); if (cdef->enumDeclarations.contains(def.name)) { enumList += def; @@ -186,7 +184,7 @@ void Generator::generateCode() fprintf(out, " %4d, %4d, // enums/sets\n", cdef->enumList.count(), cdef->enumList.count() ? index : 0); int enumsIndex = index; - for (i = 0; i < cdef->enumList.count(); ++i) + for (int i = 0; i < cdef->enumList.count(); ++i) index += 4 + (cdef->enumList.at(i).values.count() * 2); fprintf(out, " %4d, %4d, // constructors\n", isConstructible ? cdef->constructorList.count() : 0, isConstructible ? index : 0); @@ -252,7 +250,7 @@ void Generator::generateCode() fprintf(out, " \""); int col = 0; int len = 0; - for (i = 0; i < strings.size(); ++i) { + for (int i = 0; i < strings.size(); ++i) { QByteArray s = strings.at(i); len = s.length(); if (col && col + len >= 72) { |