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>
bb10
Kent Hansen 2012-02-20 06:48:17 +01:00 committed by Qt by Nokia
parent d00db53a12
commit cbe21c59a0
1 changed files with 3 additions and 5 deletions

View File

@ -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) {